Add a simple Makefile for compiling and running tests.
[fjl] / Makefile
1 CC=gcc
2 CFLAGS=-std=gnu99 -O2 -msse4.1
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 INPUT_TEST_OBJS=input.o input_test.o
12 input_test: $(INPUT_TEST_OBJS)
13         $(CC) $(LDFLAGS) -o $@ $(INPUT_TEST_OBJS)
14
15 OBJS=$(UNSTUFF_TEST_OBJS)
16
17 tests: unstuff_test input_test
18 clean:
19         $(RM) $(UNSTUFF_TEST_OBJS) unstuff_test
20         $(RM) $(INPUT_TEST_OBJS) input_test
21
22 test: tests
23         ./unstuff_test
24         ./input_test