annotate examples/svg2code_ex/Makefile.pmake @ 326:85951268ee0f

Fix bug in makefile for examples/menu
author Thinker K.F. Li <thinker@branda.to>
date Fri, 06 Mar 2009 00:10:02 +0800
parents d0646a6df46f
children
rev   line source
72
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
1 SVG=svg2code_ex.svg
175
67e13d694230 Fix bug of src/Makefile.am & examples accept PREFIX variable.
Thinker K.F. Li <thinker@branda.to>
parents: 163
diff changeset
2 PREFIX?=/usr/local
67e13d694230 Fix bug of src/Makefile.am & examples accept PREFIX variable.
Thinker K.F. Li <thinker@branda.to>
parents: 163
diff changeset
3 TOOLSDIR?=$(PREFIX)/share/mb
67e13d694230 Fix bug of src/Makefile.am & examples accept PREFIX variable.
Thinker K.F. Li <thinker@branda.to>
parents: 163
diff changeset
4 INCDIR?=$(PREFIX)/include
67e13d694230 Fix bug of src/Makefile.am & examples accept PREFIX variable.
Thinker K.F. Li <thinker@branda.to>
parents: 163
diff changeset
5 LIBDIR?=$(PREFIX)/lib
67e13d694230 Fix bug of src/Makefile.am & examples accept PREFIX variable.
Thinker K.F. Li <thinker@branda.to>
parents: 163
diff changeset
6 BINDIR?=$(PREFIX)/bin
67e13d694230 Fix bug of src/Makefile.am & examples accept PREFIX variable.
Thinker K.F. Li <thinker@branda.to>
parents: 163
diff changeset
7 INCS=-I$(INCDIR)
78
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
8 CFLAGS+=`pkg-config --cflags cairo` $(INCS) -Wall
175
67e13d694230 Fix bug of src/Makefile.am & examples accept PREFIX variable.
Thinker K.F. Li <thinker@branda.to>
parents: 163
diff changeset
9 LDFLAGS=-L$(LIBDIR) `pkg-config --libs cairo`
78
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
10 LIBS=-lmbfly
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
11 BINS= ex1
175
67e13d694230 Fix bug of src/Makefile.am & examples accept PREFIX variable.
Thinker K.F. Li <thinker@branda.to>
parents: 163
diff changeset
12 SVG2CODE= $(BINDIR)/svg2code.py
67e13d694230 Fix bug of src/Makefile.am & examples accept PREFIX variable.
Thinker K.F. Li <thinker@branda.to>
parents: 163
diff changeset
13 MB_C_HEADER= $(TOOLSDIR)/mb_c_header.m4
67e13d694230 Fix bug of src/Makefile.am & examples accept PREFIX variable.
Thinker K.F. Li <thinker@branda.to>
parents: 163
diff changeset
14 MB_C_SOURCE= $(TOOLSDIR)/mb_c_source.m4
72
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
15
78
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
16 all: $(BINS)
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
17
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
18 ex1: main.o $(SVG:C/.svg/.o/)
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
19 $(CC) $(LDFLAGS) -o $@ $(.ALLSRC) $(LIBS)
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
20
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
21 main.o: main.c $(SVG:C/.svg/.h/)
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
22 $(CC) $(CFLAGS) -c -o $@ main.c
73
9ab15ebc9061 Observer for mouse events
Thinker K.F. Li <thinker@branda.to>
parents: 72
diff changeset
23
9ab15ebc9061 Observer for mouse events
Thinker K.F. Li <thinker@branda.to>
parents: 72
diff changeset
24 $(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
25 $(CC) -c $(CFLAGS) -o $@ $(SVG:C/.svg/.c/)
72
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
26
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
27 $(SVG:C/.svg/.mb/): $(SVG)
163
7d700e5f82ba * revert M4FLAGS
"Mat <MatLinuxer2@gmail.com>"
parents: 110
diff changeset
28 $(SVG2CODE) $(.ALLSRC) $@
78
3645e29e4986 Add runtime for Xlib.
Thinker K.F. Li <thinker@branda.to>
parents: 73
diff changeset
29
72
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
30 $(SVG:C/.svg/.c/): $(SVG:C/.svg/.mb/)
163
7d700e5f82ba * revert M4FLAGS
"Mat <MatLinuxer2@gmail.com>"
parents: 110
diff changeset
31 m4 -I $(TOOLSDIR) $(MB_C_SOURCE) $(.ALLSRC) > $@
72
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
32
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
33 $(SVG:C/.svg/.h/): $(SVG:C/.svg/.mb/)
163
7d700e5f82ba * revert M4FLAGS
"Mat <MatLinuxer2@gmail.com>"
parents: 110
diff changeset
34 m4 -I $(TOOLSDIR) $(MB_C_HEADER) $(.ALLSRC) > $@
72
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
35
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
36 clean:
91
a0d1ecdaa6a5 clean *.core in makefile.
Thinker K.F. Li <thinker@branda.to>
parents: 78
diff changeset
37 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
38 if [ -e "$$i" ]; then \
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
39 echo "delete $$i"; \
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
40 rm -f "$$i"; \
171a8cb7e4b5 Makefile for svg2code_ex
Thinker K.F. Li <thinker@branda.to>
parents:
diff changeset
41 fi; \
163
7d700e5f82ba * revert M4FLAGS
"Mat <MatLinuxer2@gmail.com>"
parents: 110
diff changeset
42 done