annotate examples/svg2code_ex/Makefile @ 163:7d700e5f82ba

* revert M4FLAGS
author "Mat <MatLinuxer2@gmail.com>"
date Mon, 20 Oct 2008 14:25:31 +0800
parents c14cb6d12030
children 67e13d694230
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
163
7d700e5f82ba * revert M4FLAGS
"Mat <MatLinuxer2@gmail.com>"
parents: 110
diff changeset
3 INCS=-I/usr/local/include -I../../src/mb
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
163
7d700e5f82ba * revert M4FLAGS
"Mat <MatLinuxer2@gmail.com>"
parents: 110
diff changeset
8 SVG2CODE= ../../tools/svg2code.py
7d700e5f82ba * revert M4FLAGS
"Mat <MatLinuxer2@gmail.com>"
parents: 110
diff changeset
9 MB_C_HEADER= ../../tools/mb_c_header.m4
7d700e5f82ba * revert M4FLAGS
"Mat <MatLinuxer2@gmail.com>"
parents: 110
diff changeset
10 MB_C_SOURCE= ../../tools/mb_c_source.m4
72
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
11
78
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
12 all: $(BINS)
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 ex1: main.o $(SVG:C/.svg/.o/)
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
15 $(CC) $(LDFLAGS) -o $@ $(.ALLSRC) $(LIBS)
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
16
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
17 main.o: main.c $(SVG:C/.svg/.h/)
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
18 $(CC) $(CFLAGS) -c -o $@ main.c
73
9ab15ebc9061 Observer for mouse events
Thinker K.F. Li <thinker@branda.to>
parents: 72
diff changeset
19
9ab15ebc9061 Observer for mouse events
Thinker K.F. Li <thinker@branda.to>
parents: 72
diff changeset
20 $(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
21 $(CC) -c $(CFLAGS) -o $@ $(SVG:C/.svg/.c/)
72
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
22
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
23 $(SVG:C/.svg/.mb/): $(SVG)
163
7d700e5f82ba * revert M4FLAGS
"Mat <MatLinuxer2@gmail.com>"
parents: 110
diff changeset
24 $(SVG2CODE) $(.ALLSRC) $@
78
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
25
72
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
26 $(SVG:C/.svg/.c/): $(SVG:C/.svg/.mb/)
163
7d700e5f82ba * revert M4FLAGS
"Mat <MatLinuxer2@gmail.com>"
parents: 110
diff changeset
27 m4 -I $(TOOLSDIR) $(MB_C_SOURCE) $(.ALLSRC) > $@
72
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 $(SVG:C/.svg/.h/): $(SVG:C/.svg/.mb/)
163
7d700e5f82ba * revert M4FLAGS
"Mat <MatLinuxer2@gmail.com>"
parents: 110
diff changeset
30 m4 -I $(TOOLSDIR) $(MB_C_HEADER) $(.ALLSRC) > $@
72
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
31
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
32 clean:
91
a0d1ecdaa6a5 clean *.core in makefile.
Thinker K.F. Li <thinker@branda.to>
parents: 78
diff changeset
33 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
34 if [ -e "$$i" ]; then \
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
35 echo "delete $$i"; \
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
36 rm -f "$$i"; \
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
37 fi; \
163
7d700e5f82ba * revert M4FLAGS
"Mat <MatLinuxer2@gmail.com>"
parents: 110
diff changeset
38 done