diff options
| author | Mike Buland <eichlan@xagasoft.com> | 2009-12-20 06:37:40 +0000 |
|---|---|---|
| committer | Mike Buland <eichlan@xagasoft.com> | 2009-12-20 06:37:40 +0000 |
| commit | 56ced4bcccf3d361ff9768e78d8118faeb75269a (patch) | |
| tree | 22b40384d6fb7f3ee3c0ff41de488a46591c96e5 /default.bld | |
| parent | 8f5a78eabbbe94e5480078f4fdd29523be17398e (diff) | |
| download | libbu++-56ced4bcccf3d361ff9768e78d8118faeb75269a.tar.gz libbu++-56ced4bcccf3d361ff9768e78d8118faeb75269a.tar.bz2 libbu++-56ced4bcccf3d361ff9768e78d8118faeb75269a.tar.xz libbu++-56ced4bcccf3d361ff9768e78d8118faeb75269a.zip | |
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 :)
Diffstat (limited to 'default.bld')
| -rw-r--r-- | default.bld | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/default.bld b/default.bld new file mode 100644 index 0000000..8302fc6 --- /dev/null +++ b/default.bld | |||
| @@ -0,0 +1,93 @@ | |||
| 1 | # vim: syntax=build | ||
| 2 | |||
| 3 | CXXFLAGS += "-ggdb -W -Wall"; | ||
| 4 | |||
| 5 | action "default" | ||
| 6 | { | ||
| 7 | build: [targets("header-links"), "libbu++.a"]; | ||
| 8 | } | ||
| 9 | |||
| 10 | action "pkg" | ||
| 11 | { | ||
| 12 | build: targets("pkg"); | ||
| 13 | } | ||
| 14 | |||
| 15 | action "all" | ||
| 16 | { | ||
| 17 | build: [targets("header-links"), "libbu++.a", targets("tests")]; | ||
| 18 | } | ||
| 19 | |||
| 20 | target files("src/*.h").replace("src/", "bu/") | ||
| 21 | { | ||
| 22 | tag "header-links"; | ||
| 23 | display "symlink"; | ||
| 24 | input OUTPUT.replace("bu/","src/"); | ||
| 25 | profile "build" | ||
| 26 | { | ||
| 27 | execute("ln -s ../${INPUT} ${OUTPUT}"); | ||
| 28 | } | ||
| 29 | } | ||
| 30 | |||
| 31 | target "libbu++.a" | ||
| 32 | { | ||
| 33 | input files("src/*.cpp"); | ||
| 34 | rule "lib"; | ||
| 35 | CXXFLAGS += "-I. -fPIC"; | ||
| 36 | } | ||
| 37 | |||
| 38 | // | ||
| 39 | // Tests | ||
| 40 | // | ||
| 41 | |||
| 42 | target files("src/tests/*.cpp").replace("src/","").replace(".cpp","") | ||
| 43 | { | ||
| 44 | input "src/${OUTPUT}.cpp"; | ||
| 45 | rule "exe"; | ||
| 46 | tag "tests"; | ||
| 47 | CXXFLAGS += "-I."; | ||
| 48 | LDFLAGS += "-L. -lbu++"; | ||
| 49 | } | ||
| 50 | |||
| 51 | // Some tests need extra libs and whatnot, that goes here. | ||
| 52 | |||
| 53 | target "tests/bzip2" | ||
| 54 | { | ||
| 55 | LDFLAGS += "-lbz2"; | ||
| 56 | } | ||
| 57 | |||
| 58 | target "libbu++-r$(svnversion "-n").tar.bz2" | ||
| 59 | { | ||
| 60 | input [ | ||
| 61 | "LICENSE", | ||
| 62 | "build.conf", | ||
| 63 | "Doxyfile", | ||
| 64 | "buildm3.conf", | ||
| 65 | "support/vim/syntax/taf.vim", | ||
| 66 | "support/vim/ftdetect/taf.vim", | ||
| 67 | "support/vim/ftplugin/taf.vim", | ||
| 68 | files("*.sh"), | ||
| 69 | files("src/*.cpp"), | ||
| 70 | files("src/*.h"), | ||
| 71 | files("src/tests/*.cpp"), | ||
| 72 | files("src/tests*.h"), | ||
| 73 | files("src/tools/*.cpp"), | ||
| 74 | files("src/tools/*.h"), | ||
| 75 | files("src/unit/*.unit"), | ||
| 76 | files("src/doxy/*.dox") | ||
| 77 | ]; | ||
| 78 | rule "tarball"; | ||
| 79 | tag "pkg"; | ||
| 80 | } | ||
| 81 | |||
| 82 | rule "tarball" | ||
| 83 | { | ||
| 84 | input matches("LICENSE", "*.cpp", "*.h", "*.conf", "Doxyfile", "*.vim", | ||
| 85 | "*.sh"); | ||
| 86 | profile "build" | ||
| 87 | { | ||
| 88 | OUTDIR = OUTPUT.replace(".tar.bz2",""); | ||
| 89 | execute("tar --transform=\"s@^@${OUTDIR}/@\" -c ${INPUT} |" | ||
| 90 | " bzip2 -9 > ${OUTPUT}"); | ||
| 91 | } | ||
| 92 | } | ||
| 93 | |||
