# HG changeset patch # User Thinker K.F. Li # Date 1225437344 -28800 # Node ID 67e13d69423010c40083354f83316522cb6ba797 # Parent 9008ac31efbda5f56ce705fd4c5946f74595cec3 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/. diff -r 9008ac31efbd -r 67e13d694230 examples/calculator/Makefile --- a/examples/calculator/Makefile Fri Oct 31 10:57:47 2008 +0800 +++ b/examples/calculator/Makefile Fri Oct 31 15:15:44 2008 +0800 @@ -1,13 +1,17 @@ SVG=calculator_scr.svg -TOOLSDIR=/usr/local/share/mb -INCS=-I/usr/local/include -CFLAGS+=`pkg-config --cflags cairo` $(INCS) -Wall -I../../src -LDFLAGS=-L/usr/local/lib `pkg-config --libs cairo` -L../../src +PREFIX?=/usr/local +INCDIR?=$(PREFIX)/include +LIBDIR?=$(PREFIX)/lib +TOOLSDIR?=$(PREFIX)/share/mb +BINDIR?=$(PREFIX)/bin +INCS=-I$(INCDIR) +CFLAGS+=$(INCS) `pkg-config --cflags cairo` -Wall +LDFLAGS=-L$(LIBDIR) `pkg-config --libs cairo` LIBS=-lmbfly BINS= calc -SVG2CODE= ../../tools/svg2code.py -MB_C_HEADER= ../../tools/mb_c_header.m4 -MB_C_SOURCE= ../../tools/mb_c_source.m4 +SVG2CODE= $(BINDIR)/svg2code.py +MB_C_HEADER= $(TOOLSDIR)/mb_c_header.m4 +MB_C_SOURCE= $(TOOLSDIR)/mb_c_source.m4 all: $(BINS) diff -r 9008ac31efbd -r 67e13d694230 examples/svg2code_ex/Makefile --- a/examples/svg2code_ex/Makefile Fri Oct 31 10:57:47 2008 +0800 +++ b/examples/svg2code_ex/Makefile Fri Oct 31 15:15:44 2008 +0800 @@ -1,13 +1,17 @@ SVG=svg2code_ex.svg -TOOLSDIR=/usr/local/share/mb -INCS=-I/usr/local/include -I../../src/mb +PREFIX?=/usr/local +TOOLSDIR?=$(PREFIX)/share/mb +INCDIR?=$(PREFIX)/include +LIBDIR?=$(PREFIX)/lib +BINDIR?=$(PREFIX)/bin +INCS=-I$(INCDIR) CFLAGS+=`pkg-config --cflags cairo` $(INCS) -Wall -LDFLAGS=-L/usr/local/lib `pkg-config --libs cairo` +LDFLAGS=-L$(LIBDIR) `pkg-config --libs cairo` LIBS=-lmbfly BINS= ex1 -SVG2CODE= ../../tools/svg2code.py -MB_C_HEADER= ../../tools/mb_c_header.m4 -MB_C_SOURCE= ../../tools/mb_c_source.m4 +SVG2CODE= $(BINDIR)/svg2code.py +MB_C_HEADER= $(TOOLSDIR)/mb_c_header.m4 +MB_C_SOURCE= $(TOOLSDIR)/mb_c_source.m4 all: $(BINS) diff -r 9008ac31efbd -r 67e13d694230 src/Makefile.am --- a/src/Makefile.am Fri Oct 31 10:57:47 2008 +0800 +++ b/src/Makefile.am Fri Oct 31 15:15:44 2008 +0800 @@ -1,3 +1,4 @@ +includedir = $(prefix)/include/mb include_HEADERS = animate.h mb.h mb_timer.h mb_types.h observer.h paint.h redraw_man.h shapes.h tools.h X_supp.h lib_LTLIBRARIES = libmbfly.la