TOP=..
include $(TOP)/Config

cg-tests =\
     u1f1 \
     u1fr \
     urf1 \
     urfr

dd-tests =\
     test-DD \
     test-DD0 \
     test-DD-d1 \
     test-DD-1 \
     test-conj \
     test-conj1 \
     test-conj2 \
     test-conj2d \
     test-conj0 \
     test-conj-1 \
     test-conj-2 \
     test-conjD-1

programs=\
     $(dd-tests) \
     $(cg-tests:%=test-%)


.PHONY: all clean realclean

all: $(programs)

clean:
	$(RM) $(programs:%=%.o) *~

realclean: clean
	$(RM) $(programs)

$(dd-tests): %: %.c
	$(CC) $(CFLAGS) -o $@ $< $(TOP)/dwf.o $(TOP)/xmp/qmp.c -lm

$(cg-tests:%=test-%): test-%: %.c cg.c cg.h
	$(CC) $(CFLAGS) -o $@ cg.c $< $(TOP)/dwf.o $(TOP)/xmp/qmp.c -lm

$(programs): $(TOP)/dwf.o $(TOP)/sse-dwf-cg.h $(TOP)/xmp/qmp.c $(TOP)/xmp/qmp.h

$(TOP)/dwf.o $(TOP)/sse-dwf-cg.h:
	make -C.. compile

