Mercurial > MadButterfly
comparison examples/calculator/Makefile @ 88:dd813dcc232c
New example, calculator.
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Sat, 23 Aug 2008 15:26:47 +0800 |
parents | |
children | bd29780bf266 |
comparison
equal
deleted
inserted
replaced
87:8dfebf76cb59 | 88:dd813dcc232c |
---|---|
1 SVG=calculator_scr.svg | |
2 TOOLSDIR=../../tools | |
3 INCS=-I../../src | |
4 CFLAGS+=`pkg-config --cflags cairo` $(INCS) -Wall | |
5 LDFLAGS=-L../../src/ `pkg-config --libs cairo` | |
6 LIBS=-lmbfly | |
7 BINS= calc | |
8 | |
9 all: $(BINS) | |
10 | |
11 calc: main.o $(SVG:C/.svg/.o/) | |
12 $(CC) $(LDFLAGS) -o $@ $(.ALLSRC) $(LIBS) | |
13 | |
14 main.o: main.c $(SVG:C/.svg/.h/) | |
15 $(CC) $(CFLAGS) -c -o $@ main.c | |
16 | |
17 $(SVG:C/.svg/.o/): $(SVG:C/.svg/.c/) $(SVG:C/.svg/.h/) | |
18 $(CC) -c $(CFLAGS) -o $@ $(SVG:C/.svg/.c/) | |
19 | |
20 $(SVG:C/.svg/.mb/): $(SVG) | |
21 $(TOOLSDIR)/svg2code.py $(.ALLSRC) $@ | |
22 | |
23 $(SVG:C/.svg/.c/): $(SVG:C/.svg/.mb/) | |
24 m4 -I $(TOOLSDIR) mb_c_source.m4 $(.ALLSRC) > $@ | |
25 | |
26 $(SVG:C/.svg/.h/): $(SVG:C/.svg/.mb/) | |
27 m4 -I $(TOOLSDIR) mb_c_header.m4 $(.ALLSRC) > $@ | |
28 | |
29 clean: | |
30 for i in *.mb *.o *~ $(SVG:C/.svg/.c/) $(SVG:C/.svg/.h/) $(BINS); do \ | |
31 if [ -e "$$i" ]; then \ | |
32 echo "delete $$i"; \ | |
33 rm -f "$$i"; \ | |
34 fi; \ | |
35 done |