aboutsummaryrefslogtreecommitdiff
path: root/default.bld
blob: de34acf9746d4128547a773d93357ae685711cdc (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
66
67
68
69
70
71
72

action "default"
{
	build: [targets("header-links"), "libgats.a"];
}

action "all"
{
	build: [targets("header-links"), "libgats.a", targets()];
}


CXXFLAGS += "-ggdb -Wall";

target [files("src/*.h").replace("src/", "gats/"), "gats/version.h"]
{
	tag "header-links";
	display "symlink";
	input OUTPUT.replace("gats/","src/");
	profile "build"
	{
		execute("ln -s ../${INPUT} ${OUTPUT}");
	}
}

target "src/version.h"
{
	input ".svn";
	display "svnver";
	profile "build"
	{
		execute("echo Revision number:  `svnversion`; echo \\#ifndef LIBGATS_VC_ID > ${OUTPUT}; echo \\#define LIBGATS_VC_ID \\\"`svnversion`\\\" >> ${OUTPUT}; echo \\#endif >> ${OUTPUT}");
	}
}

target "libgats.a"
{
	rule "lib";
	input files("src/*.cpp");
	CXXFLAGS += "-I. -Ilibbu++ -fPIC";
}

target files("src/tests/*.cpp").replace("src/","").replace(".cpp","")
{
	input "src/${OUTPUT}.cpp";
	rule "exe";
	tag ["tests", "general tests"];
	CXXFLAGS += "-I. -Ilibbu++";
	LDFLAGS += "-L. -lgats -Llibbu++ -lbu++";
}

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. -lgats -lbu++";
}

rule "unit"
{
	input "*.unit";
	output INPUT.replace(".unit", ".cpp");

	profile "build"
	{
		execute("../libbu++/mkunit \"${INPUT}\" \"${OUTPUT}\"");
	}
}