aboutsummaryrefslogtreecommitdiff
path: root/share
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
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')
-rw-r--r--share/autoinclude/general-rules.bld64
-rw-r--r--share/include/qt4.bld96
2 files changed, 160 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}
diff --git a/share/include/qt4.bld b/share/include/qt4.bld
new file mode 100644
index 0000000..749cc52
--- /dev/null
+++ b/share/include/qt4.bld
@@ -0,0 +1,96 @@
1
2function qt_uiToH()
3{
4 if "${UI_DIR}" == "" then
5 {
6 DIR = INPUT.dirName();
7 }
8 else
9 {
10 DIR = UI_DIR;
11 }
12 FILE = INPUT.fileName();
13 OUTFILE = FILE.replace(".ui",".h");
14 return "${DIR}/ui_${OUTFILE}";
15}
16
17rule "qt_ui"
18{
19 display "ui";
20 input "*.ui";
21 output INPUT.qt_uiToH();
22 tag "headers";
23 profile "build"
24 {
25 execute("${QTDIR}/bin/uic -o ${OUTPUT} ${INPUT}");
26 }
27}
28
29function qt_qrcToCpp()
30{
31 if "${RCC_DIR}" == "" then
32 {
33 DIR = INPUT.dirName();
34 }
35 else
36 {
37 DIR = RCC_DIR;
38 }
39 FILE = INPUT.fileName();
40 OUTFILE = FILE.replace(".qrc",".cpp");
41 return "${DIR}/qrc_${OUTFILE}";
42}
43
44rule "qt_rcc"
45{
46 display "rcc";
47 input "*.qrc";
48 output INPUT.qt_qrcToCpp();
49 profile "build"
50 {
51 NAME = INPUT.fileName().replace(".qrc","");
52 execute("${QTDIR}/bin/rcc -name ${NAME} -o ${OUTPUT} ${INPUT}");
53 }
54}
55
56function qt_isMocable()
57{
58 if INPUT.matches("*.h") then
59 {
60 if exists( INPUT ) then
61 {
62 if "$(grep Q_OBJECT ${INPUT})" != "" then
63 {
64 return true;
65 }
66 }
67 }
68 return false;
69}
70
71function qt_hToMocCpp()
72{
73 if "${MOC_DIR}" == "" then
74 {
75 DIR = INPUT.dirName();
76 }
77 else
78 {
79 DIR = MOC_DIR;
80 }
81 FILE = INPUT.fileName();
82 OUTFILE = FILE.replace(".h",".cpp");
83 return "${DIR}/moc_${OUTFILE}";
84}
85
86rule "qt_moc"
87{
88 display "moc";
89 input qt_isMocable();
90 output INPUT.qt_hToMocCpp();
91 profile "build"
92 {
93 execute("${QTDIR}/bin/moc -o${OUTPUT} ${INPUT}");
94 }
95}
96