diff options
Diffstat (limited to 'share/autoinclude')
-rw-r--r-- | share/autoinclude/general-rules.bld | 64 |
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 | |||
2 | rule "exe" | ||
3 | { | ||
4 | input "*.o"; | ||
5 | profile "build" | ||
6 | { | ||
7 | execute("g++ -o ${OUTPUT} ${INPUT} ${LDFLAGS}"); | ||
8 | } | ||
9 | } | ||
10 | |||
11 | rule "lib" | ||
12 | { | ||
13 | input "*.o"; | ||
14 | profile "build" | ||
15 | { | ||
16 | execute("ar cr ${OUTPUT} ${INPUT}"); | ||
17 | } | ||
18 | } | ||
19 | |||
20 | rule "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. | ||
32 | rule "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 | |||
43 | rule "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 | |||
55 | rule "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 | } | ||