Mercurial > MadButterfly
annotate examples/tank/Makefile.pmake @ 1109:77596f3d8d0c
Minor changes on OpenVG graphic engine
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Tue, 07 Dec 2010 12:42:41 +0800 |
parents | a7358d9127c8 |
children |
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/) | |
167
73c4e93d331c
Make makefile more flexible that user can specify dirtories.
Thinker K.F. Li <thinker@branda.to>
parents:
165
diff
changeset
|
7 SVG2CODE= svg2code.py |
73c4e93d331c
Make makefile more flexible that user can specify dirtories.
Thinker K.F. Li <thinker@branda.to>
parents:
165
diff
changeset
|
8 MB_C_HEADER= mb_c_header.m4 |
73c4e93d331c
Make makefile more flexible that user can specify dirtories.
Thinker K.F. Li <thinker@branda.to>
parents:
165
diff
changeset
|
9 MB_C_SOURCE= mb_c_source.m4 |
115 | 10 M4 = m4 |
173
c490796f6c82
Remove src/mb (soft-link).
Thinker K.F. Li <thinker@branda.to>
parents:
167
diff
changeset
|
11 PREFIX?= /usr/local |
c490796f6c82
Remove src/mb (soft-link).
Thinker K.F. Li <thinker@branda.to>
parents:
167
diff
changeset
|
12 M4MACRODIR?= $(PREFIX)/share/mb |
167
73c4e93d331c
Make makefile more flexible that user can specify dirtories.
Thinker K.F. Li <thinker@branda.to>
parents:
165
diff
changeset
|
13 M4FLAGS ?= -I $(M4MACRODIR) |
115 | 14 LDFLAGS += |
173
c490796f6c82
Remove src/mb (soft-link).
Thinker K.F. Li <thinker@branda.to>
parents:
167
diff
changeset
|
15 INCDIR?= $(PREFIX)/include |
c490796f6c82
Remove src/mb (soft-link).
Thinker K.F. Li <thinker@branda.to>
parents:
167
diff
changeset
|
16 LIBDIR?= $(PREFIX)/lib |
c490796f6c82
Remove src/mb (soft-link).
Thinker K.F. Li <thinker@branda.to>
parents:
167
diff
changeset
|
17 LIBS += -lmbfly -lX11 -L$(LIBDIR) `pkg-config --libs cairo` |
c490796f6c82
Remove src/mb (soft-link).
Thinker K.F. Li <thinker@branda.to>
parents:
167
diff
changeset
|
18 CFLAGS += -I$(INCDIR) `pkg-config --cflags cairo` |
115 | 19 BIN = tank |
20 | |
21 all: tank | |
22 | |
23 tank: tank_main.o $(SVGOS) | |
24 $(CC) $(LDFLAGS) -o $@ $(.ALLSRC) $(LIBS) | |
25 | |
26 tank_main.o: tank_main.c svgs.h | |
27 $(CC) $(CFLAGS) -c tank_main.c | |
28 | |
29 svgs.h: $(SVGHS) | |
30 echo "#ifndef __SVGS_H_" > $@ | |
31 echo "#define __SVGS_H_" >> $@ | |
32 echo >> $@ | |
33 for H in $(SVGHS); do \ | |
34 echo "#include \"$$H\"" >> $@; \ | |
35 done | |
36 echo >> $@ | |
37 echo "#endif /* __SVGS_H_ */" >> $@ | |
38 | |
39 .for SVG in $(SVGS) | |
40 $(SVG:C/\.svg/.o/): $(SVG:C/.svg/.c/) | |
41 $(CC) $(CFLAGS) -c -o $@ $(.ALLSRC) | |
42 | |
43 $(SVG:C/\.svg/.mb/): $(SVG) | |
44 $(SVG2CODE) $(SVG) $@ | |
45 | |
46 $(SVG:C/\.svg/.h/): $(SVG:C/\.svg/.mb/) | |
161
0299cdb004a1
* patch for linux, compilation still buggy.
"Mat <MatLinuxer2@gmail.com>"
parents:
155
diff
changeset
|
47 $(M4) $(M4FLAGS) $(MB_C_HEADER) $(.ALLSRC) > $@ |
115 | 48 |
49 $(SVG:C/\.svg/.c/): $(SVG:C/\.svg/.mb/) | |
165 | 50 $(M4) $(M4FLAGS) $(MB_C_SOURCE) $(.ALLSRC) > $@ |
115 | 51 |
52 .endfor | |
53 | |
54 clean: | |
55 @for f in svgs.h $(SVGHS) $(SVGCS) $(SVGOS) $(MBS) \ | |
56 *~ *.core tank tank_main.o; do \ | |
57 if [ -e $$f ]; then \ | |
58 echo "delete $$f"; rm -f $$f; \ | |
59 fi; \ | |
60 done |