shun_iwasawa a35b8f
WARNINGS=-W -Wall -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return \
shun_iwasawa a35b8f
    -Wcast-align -Wcast-qual -Wnested-externs -Wshadow -Wbad-function-cast \
shun_iwasawa a35b8f
    -Wwrite-strings
shun_iwasawa a35b8f
shun_iwasawa a35b8f
ifeq "$(DATATYPE)" ""
shun_iwasawa a35b8f
 DATATYPE=float
shun_iwasawa a35b8f
endif
shun_iwasawa a35b8f
shun_iwasawa a35b8f
ifeq  "$(DATATYPE)" "int32_t"
shun_iwasawa a35b8f
 TYPEFLAGS=-DFIXED_POINT=32
shun_iwasawa a35b8f
endif
shun_iwasawa a35b8f
shun_iwasawa a35b8f
ifeq  "$(DATATYPE)" "int16_t"
shun_iwasawa a35b8f
 TYPEFLAGS=-DFIXED_POINT=16
shun_iwasawa a35b8f
endif
shun_iwasawa a35b8f
shun_iwasawa a35b8f
ifeq  "$(DATATYPE)" "simd"
shun_iwasawa a35b8f
 TYPEFLAGS=-DUSE_SIMD=1 -msse
shun_iwasawa a35b8f
endif
shun_iwasawa a35b8f
shun_iwasawa a35b8f
ifeq "$(TYPEFLAGS)"  ""
shun_iwasawa a35b8f
 TYPEFLAGS=-Dkiss_fft_scalar=$(DATATYPE)
shun_iwasawa a35b8f
endif
shun_iwasawa a35b8f
shun_iwasawa a35b8f
ifneq ("$(KISS_FFT_USE_ALLOCA)","")
shun_iwasawa a35b8f
	CFLAGS+= -DKISS_FFT_USE_ALLOCA=1
shun_iwasawa a35b8f
endif 
shun_iwasawa a35b8f
CFLAGS+= $(CFLAGADD)
shun_iwasawa a35b8f
shun_iwasawa a35b8f
shun_iwasawa a35b8f
FFTUTIL=fft_$(DATATYPE)
shun_iwasawa a35b8f
FASTFILT=fastconv_$(DATATYPE)
shun_iwasawa a35b8f
FASTFILTREAL=fastconvr_$(DATATYPE)
shun_iwasawa a35b8f
PSDPNG=psdpng_$(DATATYPE)
shun_iwasawa a35b8f
DUMPHDR=dumphdr_$(DATATYPE)
shun_iwasawa a35b8f
shun_iwasawa a35b8f
all: $(FFTUTIL) $(FASTFILT) $(FASTFILTREAL) 
shun_iwasawa a35b8f
# 	$(PSDPNG) 
shun_iwasawa a35b8f
#	$(DUMPHDR)
shun_iwasawa a35b8f
shun_iwasawa a35b8f
#CFLAGS=-Wall -O3 -pedantic -march=pentiumpro -ffast-math -fomit-frame-pointer $(WARNINGS)
shun_iwasawa a35b8f
# If the above flags do not work, try the following
shun_iwasawa a35b8f
CFLAGS=-Wall -O3 $(WARNINGS) 
shun_iwasawa a35b8f
# tip: try -openmp or -fopenmp to use multiple cores
shun_iwasawa a35b8f
shun_iwasawa a35b8f
$(FASTFILTREAL): ../kiss_fft.c kiss_fastfir.c kiss_fftr.c
shun_iwasawa a35b8f
	$(CC) -o $@ $(CFLAGS) -I.. $(TYPEFLAGS) -DREAL_FASTFIR  $+ -DFAST_FILT_UTIL -lm 
shun_iwasawa a35b8f
shun_iwasawa a35b8f
$(FASTFILT): ../kiss_fft.c kiss_fastfir.c
shun_iwasawa a35b8f
	$(CC) -o $@ $(CFLAGS) -I.. $(TYPEFLAGS) $+  -DFAST_FILT_UTIL -lm
shun_iwasawa a35b8f
shun_iwasawa a35b8f
$(FFTUTIL): ../kiss_fft.c fftutil.c kiss_fftnd.c kiss_fftr.c kiss_fftndr.c
shun_iwasawa a35b8f
	$(CC) -o $@ $(CFLAGS) -I.. $(TYPEFLAGS) $+ -lm
shun_iwasawa a35b8f
shun_iwasawa a35b8f
$(PSDPNG): ../kiss_fft.c psdpng.c kiss_fftr.c
shun_iwasawa a35b8f
	$(CC) -o $@ $(CFLAGS) -I.. $(TYPEFLAGS) $+ -lpng -lm
shun_iwasawa a35b8f
shun_iwasawa a35b8f
$(DUMPHDR): ../kiss_fft.c dumphdr.c
shun_iwasawa a35b8f
	$(CC) -o $@ $(CFLAGS) -I.. $(TYPEFLAGS) $+ -lm
shun_iwasawa a35b8f
shun_iwasawa a35b8f
clean:
shun_iwasawa a35b8f
	rm -f *~ fft fft_* fastconv fastconv_* fastconvr fastconvr_* psdpng psdpng_*