annotate src/Makefile @ 2:31402929c587

Transform position
author Thinker K.F. Li <thinker@branda.to>
date Wed, 23 Jul 2008 16:07:37 +0800
parents b5c0162ccf69
children 399517bf65dc
rev   line source
2
31402929c587 Transform position
Thinker K.F. Li <thinker@branda.to>
parents: 1
diff changeset
1 SRCS = coord.c
1
b5c0162ccf69 Coordination tranforming
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
2 TESTCASE_OBJS = ${SRCS:C/(.*)\.c/testcase-\1.o/g}
2
31402929c587 Transform position
Thinker K.F. Li <thinker@branda.to>
parents: 1
diff changeset
3 CFLAGS = -I/usr/local/include
31402929c587 Transform position
Thinker K.F. Li <thinker@branda.to>
parents: 1
diff changeset
4 BINS = testcase
1
b5c0162ccf69 Coordination tranforming
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
5
2
31402929c587 Transform position
Thinker K.F. Li <thinker@branda.to>
parents: 1
diff changeset
6 all: $(BINS)
1
b5c0162ccf69 Coordination tranforming
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
7
b5c0162ccf69 Coordination tranforming
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
8 testcase: testcase.o $(TESTCASE_OBJS)
b5c0162ccf69 Coordination tranforming
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
9 $(CC) $(LDFLAGS) -o $@ $(.ALLSRC) -L/usr/local/lib -lcunit
b5c0162ccf69 Coordination tranforming
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
10
b5c0162ccf69 Coordination tranforming
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
11 .for i in $(TESTCASE_OBJS)
b5c0162ccf69 Coordination tranforming
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
12 ${i}: ${i:C/testcase-(.*).o/\1.c/}
b5c0162ccf69 Coordination tranforming
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
13 $(CC) $(CFLAGS) -DUNITTEST -g -c -o $@ $(.ALLSRC)
b5c0162ccf69 Coordination tranforming
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
14 .endfor
b5c0162ccf69 Coordination tranforming
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
15
b5c0162ccf69 Coordination tranforming
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
16 testcase.o: testcase.c
b5c0162ccf69 Coordination tranforming
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
17 $(CC) $(CFLAGS) -c $(.ALLSRC)
b5c0162ccf69 Coordination tranforming
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
18
b5c0162ccf69 Coordination tranforming
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
19 clean:
2
31402929c587 Transform position
Thinker K.F. Li <thinker@branda.to>
parents: 1
diff changeset
20 for i in *.o *~ *.core $(BINS); do \
1
b5c0162ccf69 Coordination tranforming
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
21 echo "delete $$i"; \
b5c0162ccf69 Coordination tranforming
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
22 rm -f $$i; \
b5c0162ccf69 Coordination tranforming
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
23 done