aboutsummaryrefslogtreecommitdiff
path: root/share/autoinclude/general-rules.bld
diff options
context:
space:
mode:
Diffstat (limited to 'share/autoinclude/general-rules.bld')
-rw-r--r--share/autoinclude/general-rules.bld64
1 files changed, 64 insertions, 0 deletions
diff --git a/share/autoinclude/general-rules.bld b/share/autoinclude/general-rules.bld
new file mode 100644
index 0000000..16217e0
--- /dev/null
+++ b/share/autoinclude/general-rules.bld
@@ -0,0 +1,64 @@
1
2rule "exe"
3{
4 input "*.o";
5 profile "build"
6 {
7 execute("g++ -o ${OUTPUT} ${INPUT} ${LDFLAGS}");
8 }
9}
10
11rule "lib"
12{
13 input "*.o";
14 profile "build"
15 {
16 execute("ar cr ${OUTPUT} ${INPUT}");
17 }
18}
19
20rule "cpp"
21{
22 input "*.cpp";
23 output replace(".cpp", ".o");
24 requires getMakeDeps("g++ ${CXXFLAGS} -M ${INPUT}");
25 profile "build"
26 {
27 execute("g++ ${CXXFLAGS} -c -o ${OUTPUT} ${INPUT}", "g++");
28 }
29}
30
31// Heh, we're not going to use this one.
32rule "c"
33{
34 input "*.c";
35 output replace(".c", ".o");
36 requires getMakeDeps("gcc ${CXXFLAGS} -M ${INPUT}");
37 profile "build"
38 {
39 execute("gcc ${CFLAGS} -c -o ${OUTPUT} ${INPUT}");
40 }
41}
42
43rule "bison"
44{
45 input "*.y";
46 output [INPUT.replace(".y", ".tab.c"), INPUT.replace(".y", ".tab.h")];
47 profile "build"
48 {
49 BASE = INPUT.replace(".y", "");
50 execute("bison -b${BASE} ${INPUT}");
51 // if you add a -v bison will produce a .output file
52 }
53}
54
55rule "flex"
56{
57 input "*.l";
58 output replace(".l", ".yy.c");
59 output replace(".l", ".yy.h");
60 profile "build"
61 {
62 execute("flex ${FLEXFLAGS} ${INPUT}");
63 }
64}