summaryrefslogtreecommitdiff
path: root/default.bld
diff options
context:
space:
mode:
Diffstat (limited to 'default.bld')
-rw-r--r--default.bld93
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
3CXXFLAGS += "-ggdb -W -Wall";
4
5action "default"
6{
7 build: [targets("header-links"), "libbu++.a"];
8}
9
10action "pkg"
11{
12 build: targets("pkg");
13}
14
15action "all"
16{
17 build: [targets("header-links"), "libbu++.a", targets("tests")];
18}
19
20target 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
31target "libbu++.a"
32{
33 input files("src/*.cpp");
34 rule "lib";
35 CXXFLAGS += "-I. -fPIC";
36}
37
38//
39// Tests
40//
41
42target 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
53target "tests/bzip2"
54{
55 LDFLAGS += "-lbz2";
56}
57
58target "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
82rule "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