aboutsummaryrefslogtreecommitdiff
path: root/share/autoinclude/general-rules.bld
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2009-12-21 18:04:02 +0000
committerMike Buland <eichlan@xagasoft.com>2009-12-21 18:04:02 +0000
commitfb28f6800864176be2ffca29e8e664b641f33170 (patch)
treeba9180ac442939edc4eacbe1fdae93c5a7f87cee /share/autoinclude/general-rules.bld
parent51e21a316be6e052251b3dfc7d671061ebd67cee (diff)
downloadbuild-fb28f6800864176be2ffca29e8e664b641f33170.tar.gz
build-fb28f6800864176be2ffca29e8e664b641f33170.tar.bz2
build-fb28f6800864176be2ffca29e8e664b641f33170.tar.xz
build-fb28f6800864176be2ffca29e8e664b641f33170.zip
m3 is copied into trunk, we should be good to go, now.
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}