aboutsummaryrefslogtreecommitdiff
path: root/build.conf
blob: 32ce750d9b957c47130dfd8f016885346d7d6672 (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
# build.conf for build, kind of whacky, eh?

default action: check "build"
"clean" action: clean "build"
"rebuild" action: clean "build", check "build"

set "CXXFLAGS" += "-ggdb"

"build":
	rule "exe",
	target file,
	requires "libbu++/libbu++.a",
	set "CXXFLAGS" += "-Ilibbu++/src",
	input filesIn("src") filter regexp(".*\\.(cpp|y|l)$")

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

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

rule "bison":
	matches regexp("(.*)\\.y$"),
	produces ["{re:1}.tab.c", "{re:1}.tab.h", "{re:1}.output"],
	perform command("bison -v -b{re:1} {match}")

rule "flex":
	matches regexp("(.*)\\.l$"),
	produces "{re:1}.yy.c",
	perform command("flex --bison-bridge --bison-locations -o {target} {match}")