[164e09]: src / Makefile_mingw Maximize Restore History

Download this file

Makefile_mingw    77 lines (57 with data), 2.0 kB

# Use MinGW Make to process this file. Y must provide your sytem system specific MATLABROOT
# variable on the command line e.g.:
#
# make -f Makefile_mingw64 MATLABROOT="C:\Program Files\MATLAB\R2011b" ARCH=win64

ifndef MATLABROOT
  $(warning MATLABROOT variable is udefined. Using default MATLABROOT="C:\Program Files\MATLAB\R2011b" )
  MATLABROOT=C:\Program Files\MATLAB\R2011b
endif

ifndef ARCH
  $(warning ARCH variable is udefined. Using default ARCH=win64 )
  ARCH=win64
endif

MATLABLIBS=-lmwlapack -lmwblas
MATLABLINKFLAGS=-L"$(MATLABROOT)\bin\$(ARCH)" $(MATLABLIBS)

CC=gcc

CFLAGS=-O3 -s -w -std=c99 -I./thirdparty -I./
DIRECTIVES=-DCOMPILING_LTFAT -DLTFAT_DLL_NEVERUSED -DMATLABFORTRAN

include filedefs.mk

DFILES = $(addprefix d,$(files)) $(addprefix d,$(files_blaslapack)) $(files_notypechange)
SFILES = $(addprefix s,$(files)) $(addprefix s,$(files_blaslapack))

all: shared

shared: double_shared single_shared

static: double_static single_static

double_shared: $(DFILES) Makefile_mingw
	$(CC) -shared -Wl,--dll $(DFILES) \
	-o ../lib/ltfat.dll ltfat_notdllexport.def -static-libgcc -L../mex -lfftw3-3 $(MATLABLINKFLAGS)
	del *.o *.a
	copy /Y ..\lib\ltfat.dll ..\mex\
  
single_shared: $(SFILES) Makefile_mingw  
	$(CC) -shared -Wl,--dll $(SFILES) \
	-o ../lib/ltfatf.dll -static-libgcc -L../mex -lfftw3-3 -lfftw3f-3 -lltfat $(MATLABLINKFLAGS)
	del *.o *.a
	copy /Y ..\lib\ltfatf.dll ..\mex\
	
double_static: $(DFILES) Makefile_mingw
	ar rvu libltfat.a $(DFILES) 
	ranlib libltfat.a
	copy /Y libltfat.a ..\lib
	del *.o *.a	
	
single_static: $(SFILES) Makefile_mingw
	ar rvu libltfatf.a $(SFILES) 
	ranlib libltfatf.a
	copy /Y libltfatf.a ..\lib
	del *.o *.a	

s%.o: %.c config.h
	$(CC) $(CFLAGS) $(DIRECTIVES) -DLTFAT_SINGLE  -c $< -o s$*.o

d%.o: %.c config.h
	$(CC) $(CFLAGS) $(DIRECTIVES) -DLTFAT_DOUBLE  -c $< -o d$*.o

%.o: %.c
	$(CC) $(CFLAGS) $(DIRECTIVES) -c $<

clean:
	del ..\lib\ltfat.dll
	del ..\lib\ltfatf.dll
	del ..\lib\libltfat.a
	del ..\lib\libltfatf.a
	del ..\mex\ltfat.dll
	del ..\mex\ltfatf.dll
	del *.o *.a