[6bc853]: src / Makefile_mingw32 Maximize Restore History

Download this file

Makefile_mingw32    72 lines (52 with data), 1.8 kB

# Use MinGW Make to process this file
# make -f Makefile_mingw32
#
#



ifndef OCTAVEROOT
  $(warning OCTAVEROOT variable is udefined. Using default (probably wrong) OCTAVEROOT="c:\Octave\Octave3.6.4_gcc4.6.2")
  OCTAVEROOT=c:\Octave\Octave3.6.4_gcc4.6.2
endif
OCTAVELIBS=-lfftw3 -lfftw3f -lblas -llapack
OCTAVELINKFLAGS=-L$(OCTAVEROOT)\lib $(OCTAVELIBS)

#CC = i686-pc-mingw32-gcc 
CC=gcc

CFLAGS=-O3 -s -Wall -std=c99 -m32 -I../thirdparty -I./
DIRECTIVES=-DCOMPILING_LTFAT -DLTFAT_DLL_NEVERUSED

include filedefs.mk

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

all: static

static: double_static single_static

shared: double_shared single_shared

double_shared: $(DFILES) Makefile_mingw32
	$(CC) -m32 -shared -Wl,--dll $(DFILES) \
	-o ../lib/ltfat.dll ltfat_notdllexport.def -static-libgcc $(OCTAVELINKFLAGS) 
	del *.o *.a
	copy /Y ..\lib\ltfat.dll ..\oct
  
single_shared: $(SFILES) Makefile_mingw32  
	$(CC) -m32 -shared -Wl,--dll $(SFILES) \
	-o ../lib/ltfatf.dll -static-libgcc -L../oct -lltfat $(OCTAVELINKFLAGS)
	del *.o *.a
	copy /Y ..\lib\ltfatf.dll ..\oct

double_static: $(DFILES) Makefile_mingw32
	ar rvu libltfat.a $(DFILES) 
	ranlib libltfat.a
	copy /Y libltfat.a ..\lib
	del *.o *.a	
	
single_static: $(SFILES) Makefile_mingw32
	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 *.o *.a