Mercurial > MadButterfly
annotate examples/tank/Makefile @ 155:6749f6639924
Fix bug for STAILQ that fail to remove a node.
The previous one should be re-linked to next of removed one.
But, it is linked to the removed one. Fix it!
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Wed, 01 Oct 2008 14:46:08 +0800 |
parents | 3895d2224e67 |
children | 0299cdb004a1 |
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/) | |
7 SVG2CODE= svg2code.py | |
8 M4 = m4 | |
9 M4FLAGS = -I /usr/local/share/mb | |
10 LDFLAGS += | |
11 LIBS += -lmbfly -lX11 -L/usr/local/lib `pkg-config --libs cairo` | |
12 CFLAGS += -I/usr/local/include `pkg-config --cflags cairo` | |
13 BIN = tank | |
14 | |
15 all: tank | |
16 | |
17 tank: tank_main.o $(SVGOS) | |
18 $(CC) $(LDFLAGS) -o $@ $(.ALLSRC) $(LIBS) | |
19 | |
20 tank_main.o: tank_main.c svgs.h | |
21 $(CC) $(CFLAGS) -c tank_main.c | |
22 | |
23 svgs.h: $(SVGHS) | |
24 echo "#ifndef __SVGS_H_" > $@ | |
25 echo "#define __SVGS_H_" >> $@ | |
26 echo >> $@ | |
27 for H in $(SVGHS); do \ | |
28 echo "#include \"$$H\"" >> $@; \ | |
29 done | |
30 echo >> $@ | |
31 echo "#endif /* __SVGS_H_ */" >> $@ | |
32 | |
33 .for SVG in $(SVGS) | |
34 $(SVG:C/\.svg/.o/): $(SVG:C/.svg/.c/) | |
35 $(CC) $(CFLAGS) -c -o $@ $(.ALLSRC) | |
36 | |
37 $(SVG:C/\.svg/.mb/): $(SVG) | |
38 $(SVG2CODE) $(SVG) $@ | |
39 | |
40 $(SVG:C/\.svg/.h/): $(SVG:C/\.svg/.mb/) | |
41 $(M4) $(M4FLAGS) mb_c_header.m4 $(.ALLSRC) > $@ | |
42 | |
43 $(SVG:C/\.svg/.c/): $(SVG:C/\.svg/.mb/) | |
44 $(M4) $(M4FLAGS) mb_c_source.m4 $(.ALLSRC) > $@ | |
45 | |
46 .endfor | |
47 | |
48 clean: | |
49 @for f in svgs.h $(SVGHS) $(SVGCS) $(SVGOS) $(MBS) \ | |
50 *~ *.core tank tank_main.o; do \ | |
51 if [ -e $$f ]; then \ | |
52 echo "delete $$f"; rm -f $$f; \ | |
53 fi; \ | |
54 done |