Mercurial > MadButterfly
annotate examples/tank/Makefile @ 165:e959ed450b67
* compilation passed
author | "Mat <MatLinuxer2@gmail.com>" |
---|---|
date | Tue, 21 Oct 2008 02:22:17 +0800 |
parents | 3fec69d26be3 |
children | 73c4e93d331c |
rev | line source |
---|---|
115 | 1 SVGS = brick.svg bullet.svg bush.svg mud.svg rock.svg \ |
155
6749f6639924
Fix bug for STAILQ that fail to remove a node.
Thinker K.F. Li <thinker@branda.to>
parents:
115
diff
changeset
|
2 tank1.svg tank2.svg tank_en.svg bang.svg |
115 | 3 SVGHS = $(SVGS:C/\.svg/.h/) |
4 SVGCS = $(SVGS:C/\.svg/.c/) | |
5 SVGOS = $(SVGS:C/\.svg/.o/) | |
6 MBS = $(SVGS:C/\.svg/.mb/) | |
161
0299cdb004a1
* patch for linux, compilation still buggy.
"Mat <MatLinuxer2@gmail.com>"
parents:
155
diff
changeset
|
7 SVG2CODE= ../../tools/svg2code.py |
0299cdb004a1
* patch for linux, compilation still buggy.
"Mat <MatLinuxer2@gmail.com>"
parents:
155
diff
changeset
|
8 MB_C_HEADER= ../../tools/mb_c_header.m4 |
165 | 9 MB_C_SOURCE= ../../tools/mb_c_source.m4 |
115 | 10 M4 = m4 |
164
3fec69d26be3
* use enviroment to adopt M4FLAGS
"Mat <MatLinuxer2@gmail.com>"
parents:
163
diff
changeset
|
11 M4FLAGS ?= -I /usr/local/share/mb |
115 | 12 LDFLAGS += |
165 | 13 LIBS += -lmbfly -lX11 -L/usr/local/lib `pkg-config --libs cairo` -L../../src |
161
0299cdb004a1
* patch for linux, compilation still buggy.
"Mat <MatLinuxer2@gmail.com>"
parents:
155
diff
changeset
|
14 CFLAGS += -I/usr/local/include `pkg-config --cflags cairo` -I../../src |
115 | 15 BIN = tank |
16 | |
17 all: tank | |
18 | |
19 tank: tank_main.o $(SVGOS) | |
20 $(CC) $(LDFLAGS) -o $@ $(.ALLSRC) $(LIBS) | |
21 | |
22 tank_main.o: tank_main.c svgs.h | |
23 $(CC) $(CFLAGS) -c tank_main.c | |
24 | |
25 svgs.h: $(SVGHS) | |
26 echo "#ifndef __SVGS_H_" > $@ | |
27 echo "#define __SVGS_H_" >> $@ | |
28 echo >> $@ | |
29 for H in $(SVGHS); do \ | |
30 echo "#include \"$$H\"" >> $@; \ | |
31 done | |
32 echo >> $@ | |
33 echo "#endif /* __SVGS_H_ */" >> $@ | |
34 | |
35 .for SVG in $(SVGS) | |
36 $(SVG:C/\.svg/.o/): $(SVG:C/.svg/.c/) | |
37 $(CC) $(CFLAGS) -c -o $@ $(.ALLSRC) | |
38 | |
39 $(SVG:C/\.svg/.mb/): $(SVG) | |
40 $(SVG2CODE) $(SVG) $@ | |
41 | |
42 $(SVG:C/\.svg/.h/): $(SVG:C/\.svg/.mb/) | |
161
0299cdb004a1
* patch for linux, compilation still buggy.
"Mat <MatLinuxer2@gmail.com>"
parents:
155
diff
changeset
|
43 $(M4) $(M4FLAGS) $(MB_C_HEADER) $(.ALLSRC) > $@ |
115 | 44 |
45 $(SVG:C/\.svg/.c/): $(SVG:C/\.svg/.mb/) | |
165 | 46 $(M4) $(M4FLAGS) $(MB_C_SOURCE) $(.ALLSRC) > $@ |
115 | 47 |
48 .endfor | |
49 | |
50 clean: | |
51 @for f in svgs.h $(SVGHS) $(SVGCS) $(SVGOS) $(MBS) \ | |
52 *~ *.core tank tank_main.o; do \ | |
53 if [ -e $$f ]; then \ | |
54 echo "delete $$f"; rm -f $$f; \ | |
55 fi; \ | |
56 done |