From 56ced4bcccf3d361ff9768e78d8118faeb75269a Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sun, 20 Dec 2009 06:37:40 +0000 Subject: I'm really just working on build, but I found an interesting problem, when a target is specified more than once, the new ones should merely augment the old one, not replace it, this is necesarry, but I think easy as well, but I'm going to switch machines for a bit and so now I commit :) --- default.bld | 93 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 default.bld (limited to 'default.bld') diff --git a/default.bld b/default.bld new file mode 100644 index 0000000..8302fc6 --- /dev/null +++ b/default.bld @@ -0,0 +1,93 @@ +# vim: syntax=build + +CXXFLAGS += "-ggdb -W -Wall"; + +action "default" +{ + build: [targets("header-links"), "libbu++.a"]; +} + +action "pkg" +{ + build: targets("pkg"); +} + +action "all" +{ + build: [targets("header-links"), "libbu++.a", targets("tests")]; +} + +target files("src/*.h").replace("src/", "bu/") +{ + tag "header-links"; + display "symlink"; + input OUTPUT.replace("bu/","src/"); + profile "build" + { + execute("ln -s ../${INPUT} ${OUTPUT}"); + } +} + +target "libbu++.a" +{ + input files("src/*.cpp"); + rule "lib"; + CXXFLAGS += "-I. -fPIC"; +} + +// +// Tests +// + +target files("src/tests/*.cpp").replace("src/","").replace(".cpp","") +{ + input "src/${OUTPUT}.cpp"; + rule "exe"; + tag "tests"; + CXXFLAGS += "-I."; + LDFLAGS += "-L. -lbu++"; +} + +// Some tests need extra libs and whatnot, that goes here. + +target "tests/bzip2" +{ + LDFLAGS += "-lbz2"; +} + +target "libbu++-r$(svnversion "-n").tar.bz2" +{ + input [ + "LICENSE", + "build.conf", + "Doxyfile", + "buildm3.conf", + "support/vim/syntax/taf.vim", + "support/vim/ftdetect/taf.vim", + "support/vim/ftplugin/taf.vim", + files("*.sh"), + files("src/*.cpp"), + files("src/*.h"), + files("src/tests/*.cpp"), + files("src/tests*.h"), + files("src/tools/*.cpp"), + files("src/tools/*.h"), + files("src/unit/*.unit"), + files("src/doxy/*.dox") + ]; + rule "tarball"; + tag "pkg"; +} + +rule "tarball" +{ + input matches("LICENSE", "*.cpp", "*.h", "*.conf", "Doxyfile", "*.vim", + "*.sh"); + profile "build" + { + OUTDIR = OUTPUT.replace(".tar.bz2",""); + execute("tar --transform=\"s@^@${OUTDIR}/@\" -c ${INPUT} |" + " bzip2 -9 > ${OUTPUT}"); + } +} + -- cgit v1.2.3