annotate examples/svg2code_ex/Makefile @ 130:3a4d6179e6a9

change mb_c_source.m4 and mb_c_header.m4 to specify parent for SVG object
author Thinker K.F. Li <thinker@branda.to>
date Tue, 16 Sep 2008 21:23:34 +0800
parents c14cb6d12030
children 7d700e5f82ba
rev   line source
72
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
1 SVG=svg2code_ex.svg
110
Thinker K.F. Li <thinker@branda.to>
parents: 108
diff changeset
2 TOOLSDIR=/usr/local/share/mb
108
565b55508c8d More dox
Thinker K.F. Li <thinker@branda.to>
parents: 91
diff changeset
3 INCS=-I/usr/local/include
78
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
4 CFLAGS+=`pkg-config --cflags cairo` $(INCS) -Wall
108
565b55508c8d More dox
Thinker K.F. Li <thinker@branda.to>
parents: 91
diff changeset
5 LDFLAGS=-L/usr/local/lib `pkg-config --libs cairo`
78
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
6 LIBS=-lmbfly
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
7 BINS= ex1
72
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
8
78
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
9 all: $(BINS)
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
10
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
11 ex1: main.o $(SVG:C/.svg/.o/)
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
12 $(CC) $(LDFLAGS) -o $@ $(.ALLSRC) $(LIBS)
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
13
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
14 main.o: main.c $(SVG:C/.svg/.h/)
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
15 $(CC) $(CFLAGS) -c -o $@ main.c
73
9ab15ebc9061 Observer for mouse events
Thinker K.F. Li <thinker@branda.to>
parents: 72
diff changeset
16
9ab15ebc9061 Observer for mouse events
Thinker K.F. Li <thinker@branda.to>
parents: 72
diff changeset
17 $(SVG:C/.svg/.o/): $(SVG:C/.svg/.c/) $(SVG:C/.svg/.h/)
9ab15ebc9061 Observer for mouse events
Thinker K.F. Li <thinker@branda.to>
parents: 72
diff changeset
18 $(CC) -c $(CFLAGS) -o $@ $(SVG:C/.svg/.c/)
72
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
19
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
20 $(SVG:C/.svg/.mb/): $(SVG)
110
Thinker K.F. Li <thinker@branda.to>
parents: 108
diff changeset
21 /usr/local/bin/svg2code.py $(.ALLSRC) $@
78
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
22
72
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
23 $(SVG:C/.svg/.c/): $(SVG:C/.svg/.mb/)
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
24 m4 -I $(TOOLSDIR) mb_c_source.m4 $(.ALLSRC) > $@
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
25
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
26 $(SVG:C/.svg/.h/): $(SVG:C/.svg/.mb/)
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
27 m4 -I $(TOOLSDIR) mb_c_header.m4 $(.ALLSRC) > $@
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
28
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
29 clean:
91
a0d1ecdaa6a5 clean *.core in makefile.
Thinker K.F. Li <thinker@branda.to>
parents: 78
diff changeset
30 for i in *.mb *.o *.core *~ $(SVG:C/.svg/.c/) $(SVG:C/.svg/.h/) $(BINS); do \
72
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
31 if [ -e "$$i" ]; then \
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
32 echo "delete $$i"; \
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
33 rm -f "$$i"; \
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
34 fi; \
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
35 done