299b1e3ab88ea845ab9a76237467f981ec68ff71
[fjl] / Makefile
1 CC=gcc
2 CFLAGS=-std=gnu99 -O2 -msse4.1 -g -Wall -Wextra
3 LDFLAGS=
4
5 all: tests
6
7 UNSTUFF_TEST_OBJS=unstuff.o unstuff_test.o
8 unstuff_test: $(UNSTUFF_TEST_OBJS)
9         $(CC) $(LDFLAGS) -o $@ $(UNSTUFF_TEST_OBJS)
10
11 BITSOURCE_TEST_OBJS=bitsource.o bitsource_test.o
12 bitsource_test: $(BITSOURCE_TEST_OBJS)
13         $(CC) $(LDFLAGS) -o $@ $(BITSOURCE_TEST_OBJS)
14
15 DEHUFF_TEST_OBJS=dehuff.o bitsource.o dehuff_test.o
16 dehuff_test: $(DEHUFF_TEST_OBJS)
17         $(CC) $(LDFLAGS) -o $@ $(DEHUFF_TEST_OBJS)
18
19 BYTESOURCE_TEST_OBJS=bytesource.o choice.o unstuff.o bytesource_test.o
20 bytesource_test: $(BYTESOURCE_TEST_OBJS)
21         $(CC) $(LDFLAGS) -o $@ $(BYTESOURCE_TEST_OBJS)
22
23 tests: unstuff_test bitsource_test dehuff_test bytesource_test
24 clean:
25         $(RM) $(UNSTUFF_TEST_OBJS) unstuff_test
26         $(RM) $(BITSOURCE_TEST_OBJS) bitsource_test
27         $(RM) $(DEHUFF_TEST_OBJS) dehuff_test
28         $(RM) $(BYTESOURCE_TEST_OBJS) bytesource_test
29
30 test: tests
31         ./unstuff_test
32         ./bitsource_test
33         ./dehuff_test
34         ./bytesource_test