comparison examples/calculator/Makefile @ 162:5535899513ce

* patch for linux, and a trick symbol link to include <mb/mb.h>
author "Mat <MatLinuxer2@gmail.com>"
date Sun, 19 Oct 2008 00:33:24 +0800
parents 5dcfaafd1a9c
children 67e13d694230
comparison
equal deleted inserted replaced
161:0299cdb004a1 162:5535899513ce
1 SVG=calculator_scr.svg 1 SVG=calculator_scr.svg
2 TOOLSDIR=/usr/local/share/mb 2 TOOLSDIR=/usr/local/share/mb
3 INCS=-I/usr/local/include 3 INCS=-I/usr/local/include
4 CFLAGS+=`pkg-config --cflags cairo` $(INCS) -Wall 4 CFLAGS+=`pkg-config --cflags cairo` $(INCS) -Wall -I../../src
5 LDFLAGS=-L/usr/local/lib `pkg-config --libs cairo` 5 LDFLAGS=-L/usr/local/lib `pkg-config --libs cairo` -L../../src
6 LIBS=-lmbfly 6 LIBS=-lmbfly
7 BINS= calc 7 BINS= calc
8 SVG2CODE= ../../tools/svg2code.py
9 MB_C_HEADER= ../../tools/mb_c_header.m4
10 MB_C_SOURCE= ../../tools/mb_c_source.m4
8 11
9 all: $(BINS) 12 all: $(BINS)
10 13
11 calc: main.o $(SVG:C/.svg/.o/) 14 calc: main.o $(SVG:C/.svg/.o/)
12 $(CC) $(LDFLAGS) -o $@ $(.ALLSRC) $(LIBS) 15 $(CC) $(LDFLAGS) -o $@ $(.ALLSRC) $(LIBS)
16 19
17 $(SVG:C/.svg/.o/): $(SVG:C/.svg/.c/) $(SVG:C/.svg/.h/) 20 $(SVG:C/.svg/.o/): $(SVG:C/.svg/.c/) $(SVG:C/.svg/.h/)
18 $(CC) -c $(CFLAGS) -o $@ $(SVG:C/.svg/.c/) 21 $(CC) -c $(CFLAGS) -o $@ $(SVG:C/.svg/.c/)
19 22
20 $(SVG:C/.svg/.mb/): $(SVG) 23 $(SVG:C/.svg/.mb/): $(SVG)
21 /usr/local/bin/svg2code.py $(.ALLSRC) $@ 24 $(SVG2CODE) $(.ALLSRC) $@
22 25
23 $(SVG:C/.svg/.c/): $(SVG:C/.svg/.mb/) 26 $(SVG:C/.svg/.c/): $(SVG:C/.svg/.mb/)
24 m4 -I $(TOOLSDIR) mb_c_source.m4 $(.ALLSRC) > $@ 27 m4 -I $(TOOLSDIR) $(MB_C_SOURCE) $(.ALLSRC) > $@
25 28
26 $(SVG:C/.svg/.h/): $(SVG:C/.svg/.mb/) 29 $(SVG:C/.svg/.h/): $(SVG:C/.svg/.mb/)
27 m4 -I $(TOOLSDIR) mb_c_header.m4 $(.ALLSRC) > $@ 30 m4 -I $(TOOLSDIR) $(MB_C_HEADER) $(.ALLSRC) > $@
28 31
29 clean: 32 clean:
30 for i in *.mb *.o *.core *~ $(SVG:C/.svg/.c/) $(SVG:C/.svg/.h/) $(BINS); do \ 33 for i in *.mb *.o *.core *~ $(SVG:C/.svg/.c/) $(SVG:C/.svg/.h/) $(BINS); do \
31 if [ -e "$$i" ]; then \ 34 if [ -e "$$i" ]; then \
32 echo "delete $$i"; \ 35 echo "delete $$i"; \