Mercurial > MadButterfly
annotate examples/svg2code_ex/Makefile.pmake @ 1081:14c2bdcbbcca openvg
Make an association between mbe and surface for OpenVG
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Fri, 03 Dec 2010 01:11:14 +0800 |
parents | d0646a6df46f |
children |
rev | line source |
---|---|
72 | 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 | 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 | 10 LIBS=-lmbfly |
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 | 15 |
78 | 16 all: $(BINS) |
17 | |
18 ex1: main.o $(SVG:C/.svg/.o/) | |
19 $(CC) $(LDFLAGS) -o $@ $(.ALLSRC) $(LIBS) | |
20 | |
21 main.o: main.c $(SVG:C/.svg/.h/) | |
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 | 26 |
27 $(SVG:C/.svg/.mb/): $(SVG) | |
163 | 28 $(SVG2CODE) $(.ALLSRC) $@ |
78 | 29 |
72 | 30 $(SVG:C/.svg/.c/): $(SVG:C/.svg/.mb/) |
163 | 31 m4 -I $(TOOLSDIR) $(MB_C_SOURCE) $(.ALLSRC) > $@ |
72 | 32 |
33 $(SVG:C/.svg/.h/): $(SVG:C/.svg/.mb/) | |
163 | 34 m4 -I $(TOOLSDIR) $(MB_C_HEADER) $(.ALLSRC) > $@ |
72 | 35 |
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 | 38 if [ -e "$$i" ]; then \ |
39 echo "delete $$i"; \ | |
40 rm -f "$$i"; \ | |
41 fi; \ | |
163 | 42 done |