Mercurial > MadButterfly
comparison src/Makefile.pmake @ 171:129de2d83abe
Use makefile created by autoconfig.
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Fri, 31 Oct 2008 00:45:21 +0800 |
parents | src/Makefile@9e2316dc6ecb |
children | 29e1b2bffe4c |
comparison
equal
deleted
inserted
replaced
170:f3366433eee5 | 171:129de2d83abe |
---|---|
1 SRCS = coord.c geo.c shape_path.c shape_text.c shape_rect.c \ | |
2 redraw_man.c timer.c animate.c paint.c event.c observer.c \ | |
3 X_supp.c timertool.c tools.c shift.c chgcolor.c \ | |
4 visibility.c rotate.c | |
5 OBJS = ${SRCS:C/(.*)\.c/\1.o/g} | |
6 TESTCASE_OBJS = ${SRCS:C/(.*)\.c/testcase-\1.o/g} | |
7 CFLAGS+= -Wall -I/usr/local/include `pkg-config --cflags cairo` | |
8 LDFLAGS = `pkg-config --libs cairo` | |
9 BINS = libmbfly.a X_main | |
10 PREFIX?=/usr/local/ | |
11 HEADERS= X_supp.h animate.h mb.h mb_timer.h mb_types.h \ | |
12 observer.h paint.h redraw_man.h shapes.h tools.h | |
13 MKDIR?= mkdir -p | |
14 | |
15 all: $(BINS) | |
16 | |
17 install: $(BINS) | |
18 $(INSTALL) -d ${PREFIX}include/mb | |
19 .for i in $(HEADERS) | |
20 $(INSTALL) -o root -m 0644 ${i} ${PREFIX}include/mb/ | |
21 .endfor | |
22 $(INSTALL) -o root libmbfly.a ${PREFIX}lib/ | |
23 | |
24 uninstall: | |
25 .for i in $(HEADERS) | |
26 rm -f ${PREFIX}include/mb/${i} | |
27 .endfor | |
28 rm -f ${PREFIX}lib/libmbfly.a | |
29 rmdir ${PREFIX}include/mb/ | |
30 | |
31 testcase: testcase.o $(TESTCASE_OBJS) | |
32 $(CC) $(LDFLAGS) -o $@ $(.ALLSRC) -L/usr/local/lib -lcunit | |
33 | |
34 libmbfly.a: $(OBJS) | |
35 $(AR) -cr $@ $(.ALLSRC) | |
36 | |
37 | |
38 .for i in $(TESTCASE_OBJS) | |
39 ${i}: ${i:C/testcase-(.*).o/\1.c/} | |
40 $(CC) $(CFLAGS) -DUNITTEST -g -c -o $@ $(.ALLSRC) | |
41 .endfor | |
42 | |
43 testcase.o: testcase.c | |
44 $(CC) $(CFLAGS) -c $(.ALLSRC) | |
45 | |
46 X_main: X_main.o libmbfly.a | |
47 $(CC) $(CFALGS) `pkg-config --libs cairo` -o $@ $(.ALLSRC) | |
48 | |
49 X_main.o: X_main.c | |
50 $(CC) $(CFLAGS) `pkg-config --cflags cairo` -c $(.ALLSRC) | |
51 | |
52 clean: | |
53 for i in *.o *~ *.core $(SHAPE_OBJS) $(BINS) testcase; do \ | |
54 echo "delete $$i"; \ | |
55 rm -f $$i; \ | |
56 done | |
57 | |
58 depend: | |
59 mkdep $(CFLAGS) $(SRCS) |