aboutsummaryrefslogtreecommitdiff
path: root/build.conf
blob: bc186f973cf41ee069dac1703dc50987fde057b7 (plain)
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
# This is a build file for libbu++

default action: check "libbu++.a"
"clean" action: clean targets()
"tests" action: check targets() filter regexp("^tests/.*$")
"all" action: check targets()
"fstring" action: check "tests/fstring"

set "CXXFLAGS" += "-ggdb -Wall"

"libbu++.a":
	rule "lib",
	target file,
	set "CXXFLAGS" += "-Isrc -fPIC",
	input filesIn("src") filter regexp("^.*\\.cpp$")

directoriesIn("src/tests","tests/"):
	rule "exe",
	target file,
	requires "libbu++.a",
	set "CXXFLAGS" += "-Isrc",
	set "LDFLAGS" += "-L. -lbu++",
	input filesIn("{fulldir}") filter regexp("^.*\\.cpp$")

filesIn("src/tests") filter regexp("^src/tests/(.*)\\.cpp$", "tests/{re:1}"):
	rule "exe",
	target file,
	requires "libbu++.a",
	set "CXXFLAGS" += "-Isrc",
	set "LDFLAGS" += "-L. -lbu++",
	input "src/{target}.cpp"

directoriesIn("src/unit","unit/"):
	rule "exe",
	target file,
	requires "libbu++.a",
	set "CXXFLAGS" += "-Isrc",
	set "LDFLAGS" += "-L. -lbu++",
	input filesIn("{fulldir}") filter regexp("^.*\\.cpp$")

filesIn("src/unit") filter regexp("^src/unit/(.*)\\.cpp$", "unit/{re:1}"):
	rule "exe",
	target file,
	requires "libbu++.a",
	set "CXXFLAGS" += "-Isrc",
	set "LDFLAGS" += "-L. -lbu++",
	input "src/{target}.cpp"

"tests/plugin": set "LDFLAGS" += "-ldl"

rule "exe":
	matches regexp("(.*)\\.o$"),
	aggregate toString(" "),
	perform command("g++ -o {target} {match} {LDFLAGS}")

rule "lib":
	matches regexp("(.*)\\.o$"),
	aggregate toString(" "),
	perform command("ar cr {target} {match}")

rule "cpp":
	matches regexp("(.*)\\.cpp$"),
	produces "{re:1}.o",
	requires commandToList("g++ -M {CXXFLAGS} {match}", "make"),
	perform command("g++ {CXXFLAGS} -c -o {target} {match}")