Mercurial > MadButterfly
annotate examples/calculator/Makefile @ 163:7d700e5f82ba
* revert M4FLAGS
author | "Mat <MatLinuxer2@gmail.com>" |
---|---|
date | Mon, 20 Oct 2008 14:25:31 +0800 |
parents | 5535899513ce |
children | 67e13d694230 |
rev | line source |
---|---|
88 | 1 SVG=calculator_scr.svg |
110 | 2 TOOLSDIR=/usr/local/share/mb |
108 | 3 INCS=-I/usr/local/include |
162
5535899513ce
* patch for linux, and a trick symbol link to include <mb/mb.h>
"Mat <MatLinuxer2@gmail.com>"
parents:
137
diff
changeset
|
4 CFLAGS+=`pkg-config --cflags cairo` $(INCS) -Wall -I../../src |
5535899513ce
* patch for linux, and a trick symbol link to include <mb/mb.h>
"Mat <MatLinuxer2@gmail.com>"
parents:
137
diff
changeset
|
5 LDFLAGS=-L/usr/local/lib `pkg-config --libs cairo` -L../../src |
88 | 6 LIBS=-lmbfly |
7 BINS= calc | |
162
5535899513ce
* patch for linux, and a trick symbol link to include <mb/mb.h>
"Mat <MatLinuxer2@gmail.com>"
parents:
137
diff
changeset
|
8 SVG2CODE= ../../tools/svg2code.py |
5535899513ce
* patch for linux, and a trick symbol link to include <mb/mb.h>
"Mat <MatLinuxer2@gmail.com>"
parents:
137
diff
changeset
|
9 MB_C_HEADER= ../../tools/mb_c_header.m4 |
5535899513ce
* patch for linux, and a trick symbol link to include <mb/mb.h>
"Mat <MatLinuxer2@gmail.com>"
parents:
137
diff
changeset
|
10 MB_C_SOURCE= ../../tools/mb_c_source.m4 |
88 | 11 |
12 all: $(BINS) | |
13 | |
14 calc: main.o $(SVG:C/.svg/.o/) | |
15 $(CC) $(LDFLAGS) -o $@ $(.ALLSRC) $(LIBS) | |
16 | |
17 main.o: main.c $(SVG:C/.svg/.h/) | |
18 $(CC) $(CFLAGS) -c -o $@ main.c | |
19 | |
20 $(SVG:C/.svg/.o/): $(SVG:C/.svg/.c/) $(SVG:C/.svg/.h/) | |
21 $(CC) -c $(CFLAGS) -o $@ $(SVG:C/.svg/.c/) | |
22 | |
23 $(SVG:C/.svg/.mb/): $(SVG) | |
162
5535899513ce
* patch for linux, and a trick symbol link to include <mb/mb.h>
"Mat <MatLinuxer2@gmail.com>"
parents:
137
diff
changeset
|
24 $(SVG2CODE) $(.ALLSRC) $@ |
88 | 25 |
26 $(SVG:C/.svg/.c/): $(SVG:C/.svg/.mb/) | |
162
5535899513ce
* patch for linux, and a trick symbol link to include <mb/mb.h>
"Mat <MatLinuxer2@gmail.com>"
parents:
137
diff
changeset
|
27 m4 -I $(TOOLSDIR) $(MB_C_SOURCE) $(.ALLSRC) > $@ |
88 | 28 |
29 $(SVG:C/.svg/.h/): $(SVG:C/.svg/.mb/) | |
162
5535899513ce
* patch for linux, and a trick symbol link to include <mb/mb.h>
"Mat <MatLinuxer2@gmail.com>"
parents:
137
diff
changeset
|
30 m4 -I $(TOOLSDIR) $(MB_C_HEADER) $(.ALLSRC) > $@ |
88 | 31 |
32 clean: | |
90 | 33 for i in *.mb *.o *.core *~ $(SVG:C/.svg/.c/) $(SVG:C/.svg/.h/) $(BINS); do \ |
88 | 34 if [ -e "$$i" ]; then \ |
35 echo "delete $$i"; \ | |
36 rm -f "$$i"; \ | |
37 fi; \ | |
137 | 38 done |