More debug code moving.
[fjl] / Makefile
index ecee87c5273e1cf9116669514c634e9d0766990c..6da3eb2960f1d50edf1e7ffd847fb7901c6c9a5d 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,30 +1,45 @@
 CC=gcc
-CFLAGS=-std=gnu99 -O2 -msse4.1 -g
-LDFLAGS=
+CFLAGS=-std=gnu99 -O2 -msse4.1 -g -Wall -Wextra
+LDFLAGS=-lm -lrt
 
-all: tests
+all: tests driver
 
-UNSTUFF_TEST_OBJS=unstuff.o unstuff_test.o
+UNSTUFF_TEST_OBJS=unstuff.o unstuff_test.o benchmark.o
 unstuff_test: $(UNSTUFF_TEST_OBJS)
        $(CC) $(LDFLAGS) -o $@ $(UNSTUFF_TEST_OBJS)
 
-INPUT_TEST_OBJS=input.o input_test.o
-input_test: $(INPUT_TEST_OBJS)
-       $(CC) $(LDFLAGS) -o $@ $(INPUT_TEST_OBJS)
+BITSOURCE_TEST_OBJS=bitsource.o bitsource_test.o
+bitsource_test: $(BITSOURCE_TEST_OBJS)
+       $(CC) $(LDFLAGS) -o $@ $(BITSOURCE_TEST_OBJS)
 
-DEHUFF_TEST_OBJS=dehuff.o dehuff_test.o
+DEHUFF_TEST_OBJS=dehuff.o input.o bitsource.o dehuff_test.o
 dehuff_test: $(DEHUFF_TEST_OBJS)
        $(CC) $(LDFLAGS) -o $@ $(DEHUFF_TEST_OBJS)
 
-OBJS=$(UNSTUFF_TEST_OBJS)
+BYTESOURCE_TEST_OBJS=bytesource.o choice.o unstuff.o bytesource_test.o idct_float.o
+bytesource_test: $(BYTESOURCE_TEST_OBJS)
+       $(CC) $(LDFLAGS) -o $@ $(BYTESOURCE_TEST_OBJS)
 
-tests: unstuff_test input_test dehuff_test
+IDCT_TEST_OBJS=idct_float.o idct_imprecise_int.o idct_reference.o idct_test.o benchmark.o
+idct_test: $(IDCT_TEST_OBJS)
+       $(CC) $(LDFLAGS) -o $@ $(IDCT_TEST_OBJS)
+
+DRIVER_OBJS=driver.o idct_float.o unstuff.o bytesource.o bitsource.o choice.o dehuff.o input.o
+driver: $(DRIVER_OBJS)
+       $(CC) $(LDFLAGS) -o $@ $(DRIVER_OBJS)
+
+tests: unstuff_test bitsource_test dehuff_test bytesource_test idct_test
 clean:
        $(RM) $(UNSTUFF_TEST_OBJS) unstuff_test
-       $(RM) $(INPUT_TEST_OBJS) input_test
+       $(RM) $(BITSOURCE_TEST_OBJS) bitsource_test
        $(RM) $(DEHUFF_TEST_OBJS) dehuff_test
+       $(RM) $(BYTESOURCE_TEST_OBJS) bytesource_test
+       $(RM) $(IDCT_TEST_OBJS) idct_test
+       $(RM) $(DRIVER_OBJS) driver
 
 test: tests
        ./unstuff_test
-       ./input_test
+       ./bitsource_test
        ./dehuff_test
+       ./bytesource_test
+       ./idct_test