Mercurial > MadButterfly
comparison examples/calculator/Makefile @ 175:67e13d694230
Fix bug of src/Makefile.am & examples accept PREFIX variable.
- src/Makefile.am install header files into $(prefix)/include/mb instead of
$(prefix)/include original.
- examples find headers, M4 macro files, and tools with PREFIX varaible.
- default value of PREFIX is /usr/local.
- user can change PREFIX with paramter of make command, for example
'make PREFIX=../../build/dest', if MadButterfly was installed there.
- Users can install MadButterfly in their specified directory, for example,
'./configure --prefix=${PWD}/dest', the binary will installed in dest/.
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Fri, 31 Oct 2008 15:15:44 +0800 |
parents | 5535899513ce |
children |
comparison
equal
deleted
inserted
replaced
174:9008ac31efbd | 175:67e13d694230 |
---|---|
1 SVG=calculator_scr.svg | 1 SVG=calculator_scr.svg |
2 TOOLSDIR=/usr/local/share/mb | 2 PREFIX?=/usr/local |
3 INCS=-I/usr/local/include | 3 INCDIR?=$(PREFIX)/include |
4 CFLAGS+=`pkg-config --cflags cairo` $(INCS) -Wall -I../../src | 4 LIBDIR?=$(PREFIX)/lib |
5 LDFLAGS=-L/usr/local/lib `pkg-config --libs cairo` -L../../src | 5 TOOLSDIR?=$(PREFIX)/share/mb |
6 BINDIR?=$(PREFIX)/bin | |
7 INCS=-I$(INCDIR) | |
8 CFLAGS+=$(INCS) `pkg-config --cflags cairo` -Wall | |
9 LDFLAGS=-L$(LIBDIR) `pkg-config --libs cairo` | |
6 LIBS=-lmbfly | 10 LIBS=-lmbfly |
7 BINS= calc | 11 BINS= calc |
8 SVG2CODE= ../../tools/svg2code.py | 12 SVG2CODE= $(BINDIR)/svg2code.py |
9 MB_C_HEADER= ../../tools/mb_c_header.m4 | 13 MB_C_HEADER= $(TOOLSDIR)/mb_c_header.m4 |
10 MB_C_SOURCE= ../../tools/mb_c_source.m4 | 14 MB_C_SOURCE= $(TOOLSDIR)/mb_c_source.m4 |
11 | 15 |
12 all: $(BINS) | 16 all: $(BINS) |
13 | 17 |
14 calc: main.o $(SVG:C/.svg/.o/) | 18 calc: main.o $(SVG:C/.svg/.o/) |
15 $(CC) $(LDFLAGS) -o $@ $(.ALLSRC) $(LIBS) | 19 $(CC) $(LDFLAGS) -o $@ $(.ALLSRC) $(LIBS) |