Mercurial > MadButterfly
annotate examples/tank/Makefile @ 163:7d700e5f82ba
* revert M4FLAGS
author | "Mat <MatLinuxer2@gmail.com>" |
---|---|
date | Mon, 20 Oct 2008 14:25:31 +0800 |
parents | 0299cdb004a1 |
children | 3fec69d26be3 |
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 |
115 | 9 M4 = m4 |
163 | 10 M4FLAGS = -I /usr/local/share/mb |
115 | 11 LDFLAGS += |
12 LIBS += -lmbfly -lX11 -L/usr/local/lib `pkg-config --libs cairo` | |
161
0299cdb004a1
* patch for linux, compilation still buggy.
"Mat <MatLinuxer2@gmail.com>"
parents:
155
diff
changeset
|
13 CFLAGS += -I/usr/local/include `pkg-config --cflags cairo` -I../../src |
115 | 14 BIN = tank |
15 | |
16 all: tank | |
17 | |
18 tank: tank_main.o $(SVGOS) | |
19 $(CC) $(LDFLAGS) -o $@ $(.ALLSRC) $(LIBS) | |
20 | |
21 tank_main.o: tank_main.c svgs.h | |
22 $(CC) $(CFLAGS) -c tank_main.c | |
23 | |
24 svgs.h: $(SVGHS) | |
25 echo "#ifndef __SVGS_H_" > $@ | |
26 echo "#define __SVGS_H_" >> $@ | |
27 echo >> $@ | |
28 for H in $(SVGHS); do \ | |
29 echo "#include \"$$H\"" >> $@; \ | |
30 done | |
31 echo >> $@ | |
32 echo "#endif /* __SVGS_H_ */" >> $@ | |
33 | |
34 .for SVG in $(SVGS) | |
35 $(SVG:C/\.svg/.o/): $(SVG:C/.svg/.c/) | |
36 $(CC) $(CFLAGS) -c -o $@ $(.ALLSRC) | |
37 | |
38 $(SVG:C/\.svg/.mb/): $(SVG) | |
39 $(SVG2CODE) $(SVG) $@ | |
40 | |
41 $(SVG:C/\.svg/.h/): $(SVG:C/\.svg/.mb/) | |
161
0299cdb004a1
* patch for linux, compilation still buggy.
"Mat <MatLinuxer2@gmail.com>"
parents:
155
diff
changeset
|
42 $(M4) $(M4FLAGS) $(MB_C_HEADER) $(.ALLSRC) > $@ |
115 | 43 |
44 $(SVG:C/\.svg/.c/): $(SVG:C/\.svg/.mb/) | |
161
0299cdb004a1
* patch for linux, compilation still buggy.
"Mat <MatLinuxer2@gmail.com>"
parents:
155
diff
changeset
|
45 $(M4) $(M4FLAGS) $(MB_C_HEADER) $(.ALLSRC) > $@ |
115 | 46 |
47 .endfor | |
48 | |
49 clean: | |
50 @for f in svgs.h $(SVGHS) $(SVGCS) $(SVGOS) $(MBS) \ | |
51 *~ *.core tank tank_main.o; do \ | |
52 if [ -e $$f ]; then \ | |
53 echo "delete $$f"; rm -f $$f; \ | |
54 fi; \ | |
55 done |