From 98c0214d267c596eaa40d8904f15db24833e8b1f Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 29 Sep 2006 20:03:35 +0000 Subject: Setup the new makefile to auto-create tarballs, something build should do soon. It puts a slimmed down makefile into the tarball, along with all of the checked out libbu++ files, so you should just need to compile (if you have the right flex and bison). --- Makefile | 21 +++++++++++++++++++-- Makefile.slim | 24 ++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 Makefile.slim diff --git a/Makefile b/Makefile index a2366be..e2999e0 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,31 @@ LIBBU:=$(foreach f,paramproc.h paramproc.cpp staticstring.h staticstring.cpp exceptions.h exceptions.cpp serializable.h serializable.cpp exceptionbase.h exceptionbase.cpp plugger.h plugger.cpp singleton.h hashtable.cpp hashtable.h hashfunction.h hashfunction.cpp hashfunctionint.cpp hashfunctionint.h hashfunctionstring.cpp hashfunctionstring.h serializerbinary.cpp serializerbinary.h serializer.cpp serializer.h stringrep.h stringrep.cpp,src/$f) SRC:=$(sort $(wildcard src/*.cpp) $(filter %.cpp,$(LIBBU))) OBJ:=src/build.yy.o src/build.tab.o $(patsubst %.cpp,%.o,$(SRC)) +REV:=$(shell svn info | grep "Revision" | cut -d\ -f2) +VER:=r$(REV) +PKG:=build-$(VER).tar.bz2 -.PHONY: all extern clean +.PHONY: all extern clean depclean package # .SILENT: all: extern build +package: clean depclean extern $(PKG) + +$(PKG): + mkdir build-$(VER) + mkdir build-$(VER)/src + cp -a src/*.{cpp,h,y,l} build-$(VER)/src + cp -a build.conf build-$(VER) + cp -a Makefile.slim build-$(VER)/Makefile + tar -c build-$(VER) | bzip2 -9 > $(PKG) + rm -Rf build-$(VER) + clean: - -rm -Rf $(LIBBU) build $(OBJ) + -rm -Rf build $(OBJ) + +depclean: + -rm -Rf $(LIBBU) extern: $(LIBBU) diff --git a/Makefile.slim b/Makefile.slim new file mode 100644 index 0000000..c1da3e2 --- /dev/null +++ b/Makefile.slim @@ -0,0 +1,24 @@ +SRC:=$(sort $(wildcard src/*.cpp)) +OBJ:=src/build.yy.o src/build.tab.o $(patsubst %.cpp,%.o,$(SRC)) + +.PHONY: all clean + +all: build + +clean: + -rm -Rf build $(OBJ) + +build: src/build.yy.c src/build.tab.c $(OBJ) + g++ -ggdb -ldl -o build $(OBJ) + +%.o: %.cpp + g++ -ggdb -Isrc -c -o $@ $< + +%.o: %.c + g++ -ggdb -Isrc -c -o $@ $< + +%.yy.c: %.l + flex --bison-bridge --bison-locations -o $@ $< + +%.tab.c: %.y + bison -v -b$(patsubst %.tab.c,%,$@) $< -- cgit v1.2.3