annotate examples/svg2code_ex/Makefile @ 91:a0d1ecdaa6a5

clean *.core in makefile.
author Thinker K.F. Li <thinker@branda.to>
date Sat, 23 Aug 2008 22:26:46 +0800
parents 3645e29e4986
children 565b55508c8d
rev   line source
72
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
1 SVG=svg2code_ex.svg
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
2 TOOLSDIR=../../tools
73
9ab15ebc9061 Observer for mouse events
Thinker K.F. Li <thinker@branda.to>
parents: 72
diff changeset
3 INCS=-I../../src
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
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
5 LDFLAGS=-L../../src/ `pkg-config --libs cairo`
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)
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
21 $(TOOLSDIR)/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