1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
|
/*
* Copyright (C) 2007-2010 Xagasoft, All rights reserved.
*
* This file is part of the libbu++ library and is released under the
* terms of the license contained in the file LICENSE.
*/
/**
* This is the default.bld file for libbu++, it pretty much handles everything
* libbu++ related, kinda' cool, eh? It can completely replace the old build
* and actually does a better job with a number of things.
*/
CXXFLAGS += "-ggdb -W -Wall -I.";
action "default"
{
build: [targets("header-links"), "libbu++.a", targets("tools")];
}
action "pkg"
{
build: targets("pkg");
}
action "all"
{
build: [targets("header-links"), "libbu++.a", targets("tools"),
targets("tests")];
}
action "unit"
{
build: targets("unit tests");
}
target files("src/*.h").replace("src/", "bu/")
{
tag "header-links";
display "symlink";
input OUTPUT.replace("bu/","src/");
profile "build"
{
execute("mkdir -p $(dirname ${OUTPUT}); ln -s ../${INPUT} ${OUTPUT}");
}
}
target files("src/compat/*.h").replace("src/", "bu/")
{
tag "header-links";
display "symlink";
input OUTPUT.replace("bu/","src/");
profile "build"
{
execute("mkdir -p $(dirname ${OUTPUT}); ln -s ../../${INPUT} ${OUTPUT}");
}
}
target "libbu++.a"
{
input files("src/*.cpp", "src/compat/*.cpp");
rule "lib";
CXXFLAGS += "-I. -fPIC";
}
//
// Tools
//
target files("src/tools/*.cpp").replace("src/tools/","").replace(".cpp","")
{
input "src/tools/${OUTPUT}.cpp";
rule "exe";
requires "libbu++.a";
tag "tools";
CXXFLAGS += "-I.";
LDFLAGS += "-L. -lbu++";
}
//
// General Tests
//
target files("src/tests/*.cpp").replace("src/","").replace(".cpp","")
{
input "src/${OUTPUT}.cpp";
rule "exe";
requires "libbu++.a";
tag ["tests", "general tests"];
CXXFLAGS += "-I.";
LDFLAGS += "-L. -lbu++";
}
// Some tests need extra libs and whatnot, that goes here.
target "tests/bzip2"
{
LDFLAGS += "-lbz2";
}
target ["tests/itoserver", "tests/socketblock", "tests/itoheap",
"tests/itoqueue1", "tests/itoqueue2"]
{
LDFLAGS += "-lpthread";
}
//
// Unit tests
//
target files("src/unit/*.unit").replace("src/","").replace(".unit","")
{
input "src/${OUTPUT}.unit";
rule "exe";
requires "libbu++.a";
tag ["tests", "unit tests"];
CXXFLAGS += "-I.";
LDFLAGS += "-L. -lbu++";
}
target "libbu++-r$(svnversion "-n").tar.bz2"
{
input [
"LICENSE",
"build.conf",
"Doxyfile",
files("*.bld"),
"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"),
files("src/compat/*.cpp"),
files("src/compat/*.h")
];
rule "tarball";
tag "pkg";
}
rule "tarball"
{
input matches("LICENSE", "*.cpp", "*.h", "*.conf", "*.bld", "Doxyfile",
"*.vim", "*.sh", "*.unit");
profile "build"
{
OUTDIR = OUTPUT.replace(".tar.bz2","");
execute("tar --transform=\"s@^@${OUTDIR}/@\" -c ${INPUT} |"
" bzip2 -9 > ${OUTPUT}");
}
}
rule "unit"
{
input "*.unit";
output INPUT.replace(".unit", ".cpp");
profile "build"
{
execute("./mkunit \"${INPUT}\" \"${OUTPUT}\"");
}
}
|