PROGS = testcorrc testcorrasm testcorravx
all: $(PROGS) 

.SUFFIXES:
.SUFFIXES: .o .asm .c
.SECONDARY:

DIR = `basename $(PWD)`

CCFLAGS = -g

.asm.o:
	yasm -P ebe.inc -Worphan-labels -f win64 -l $*.lst -o $*.o $<

.o:
	gcc -o $@ $<

testcorrc: testcorr.c corr.c
	gcc -O3 -funroll-all-loops -o testcorrc testcorr.c corr.c -lm

testcorrasm: testcorr.c corr.o
	gcc -O3 -funroll-all-loops -o testcorrasm testcorr.c corr.o -lm

testcorravx: testcorr.c corravx.o
	gcc -O3 -funroll-all-loops -o testcorravx testcorr.c corravx.o -lm

clean:
	rm -f $(PROGS) *.o *.lst *~ .*.gdb

tgz: clean
	(cd ..; tar cvzf  $(DIR).tgz $(DIR))