Mercurial > MadButterfly
annotate src/Makefile @ 4:399517bf65dc
Add rules for X_main to Makefile
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Fri, 25 Jul 2008 11:42:37 +0800 |
parents | 31402929c587 |
children | 9c331ec9e210 |
rev | line source |
---|---|
2 | 1 SRCS = coord.c |
1 | 2 TESTCASE_OBJS = ${SRCS:C/(.*)\.c/testcase-\1.o/g} |
2 | 3 CFLAGS = -I/usr/local/include |
4
399517bf65dc
Add rules for X_main to Makefile
Thinker K.F. Li <thinker@branda.to>
parents:
2
diff
changeset
|
4 BINS = testcase X_main |
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 | |
4
399517bf65dc
Add rules for X_main to Makefile
Thinker K.F. Li <thinker@branda.to>
parents:
2
diff
changeset
|
19 X_main: X_main.o |
399517bf65dc
Add rules for X_main to Makefile
Thinker K.F. Li <thinker@branda.to>
parents:
2
diff
changeset
|
20 $(CC) $(CFALGS) `pkg-config --libs cairo` -o $@ $(.ALLSRC) |
399517bf65dc
Add rules for X_main to Makefile
Thinker K.F. Li <thinker@branda.to>
parents:
2
diff
changeset
|
21 |
399517bf65dc
Add rules for X_main to Makefile
Thinker K.F. Li <thinker@branda.to>
parents:
2
diff
changeset
|
22 X_main.o: X_main.c |
399517bf65dc
Add rules for X_main to Makefile
Thinker K.F. Li <thinker@branda.to>
parents:
2
diff
changeset
|
23 $(CC) $(CFLAGS) `pkg-config --cflags cairo` -c $(.ALLSRC) |
399517bf65dc
Add rules for X_main to Makefile
Thinker K.F. Li <thinker@branda.to>
parents:
2
diff
changeset
|
24 |
1 | 25 clean: |
2 | 26 for i in *.o *~ *.core $(BINS); do \ |
1 | 27 echo "delete $$i"; \ |
28 rm -f $$i; \ | |
29 done |