diff options
Diffstat (limited to '')
| -rw-r--r-- | share/autoinclude/general-rules.bld | 64 | ||||
| -rw-r--r-- | share/include/qt4.bld | 96 |
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 | |||
| 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 | } | ||
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 | |||
| 2 | function 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 | |||
| 17 | rule "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 | |||
| 29 | function 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 | |||
| 44 | rule "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 | |||
| 56 | function 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 | |||
| 71 | function 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 | |||
| 86 | rule "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 | |||
