2
|
1 SRCS = coord.c
|
1
|
2 TESTCASE_OBJS = ${SRCS:C/(.*)\.c/testcase-\1.o/g}
|
2
|
3 CFLAGS = -I/usr/local/include
|
|
4 BINS = testcase
|
1
|
5
|
2
|
6 all: $(BINS)
|
1
|
7
|
|
8 testcase: testcase.o $(TESTCASE_OBJS)
|
|
9 $(CC) $(LDFLAGS) -o $@ $(.ALLSRC) -L/usr/local/lib -lcunit
|
|
10
|
|
11 .for i in $(TESTCASE_OBJS)
|
|
12 ${i}: ${i:C/testcase-(.*).o/\1.c/}
|
|
13 $(CC) $(CFLAGS) -DUNITTEST -g -c -o $@ $(.ALLSRC)
|
|
14 .endfor
|
|
15
|
|
16 testcase.o: testcase.c
|
|
17 $(CC) $(CFLAGS) -c $(.ALLSRC)
|
|
18
|
|
19 clean:
|
2
|
20 for i in *.o *~ *.core $(BINS); do \
|
1
|
21 echo "delete $$i"; \
|
|
22 rm -f $$i; \
|
|
23 done
|