1KFVER=130
2
3ifeq ($(shell uname -s),Darwin)
4	SHARED := -Wl,-install_name,libkissfft.dylib -o libkissfft.dylib
5else
6	SHARED := -Wl,-soname,libkissfft.so -o libkissfft.so
7endif
8
9all:
10	gcc -Wall -fPIC -c *.c -Dkiss_fft_scalar=float -o kiss_fft.o
11	ar crus libkissfft.a kiss_fft.o
12	gcc -shared $(SHARED) kiss_fft.o
13
14install: all
15	cp libkissfft.so /usr/local/lib/
16
17doc:
18	@echo "Start by reading the README file.  If you want to build and test lots of stuff, do a 'make testall'"
19	@echo "but be aware that 'make testall' has dependencies that the basic kissfft software does not."
20	@echo "It is generally unneeded to run these tests yourself, unless you plan on changing the inner workings"
21	@echo "of kissfft and would like to make use of its regression tests."
22
23testall:
24	# The simd and int32_t types may or may not work on your machine
25	make -C test DATATYPE=simd CFLAGADD="$(CFLAGADD)" test
26	make -C test DATATYPE=int32_t CFLAGADD="$(CFLAGADD)" test
27	make -C test DATATYPE=int16_t CFLAGADD="$(CFLAGADD)" test
28	make -C test DATATYPE=float CFLAGADD="$(CFLAGADD)" test
29	make -C test DATATYPE=double CFLAGADD="$(CFLAGADD)" test
30	echo "all tests passed"
31
32tarball: clean
33	hg archive -r v$(KFVER) -t tgz kiss_fft$(KFVER).tar.gz
34	hg archive -r v$(KFVER) -t zip kiss_fft$(KFVER).zip
35
36clean:
37	cd test && make clean
38	cd tools && make clean
39	rm -f kiss_fft*.tar.gz *~ *.pyc kiss_fft*.zip
40
41asm: kiss_fft.s
42
43kiss_fft.s: kiss_fft.c kiss_fft.h _kiss_fft_guts.h
44	[ -e kiss_fft.s ] && mv kiss_fft.s kiss_fft.s~ || true
45	gcc -S kiss_fft.c -O3 -mtune=native -ffast-math -fomit-frame-pointer -unroll-loops -dA -fverbose-asm
46	gcc -o kiss_fft_short.s -S kiss_fft.c -O3 -mtune=native -ffast-math -fomit-frame-pointer -dA -fverbose-asm -DFIXED_POINT
47	[ -e kiss_fft.s~ ] && diff kiss_fft.s~ kiss_fft.s || true
48