From fb28f6800864176be2ffca29e8e664b641f33170 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 21 Dec 2009 18:04:02 +0000 Subject: m3 is copied into trunk, we should be good to go, now. --- share/autoinclude/general-rules.bld | 64 +++++++++++++++++++++++++ share/include/qt4.bld | 96 +++++++++++++++++++++++++++++++++++++ 2 files changed, 160 insertions(+) create mode 100644 share/autoinclude/general-rules.bld create mode 100644 share/include/qt4.bld (limited to 'share') 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 @@ + +rule "exe" +{ + input "*.o"; + profile "build" + { + execute("g++ -o ${OUTPUT} ${INPUT} ${LDFLAGS}"); + } +} + +rule "lib" +{ + input "*.o"; + profile "build" + { + execute("ar cr ${OUTPUT} ${INPUT}"); + } +} + +rule "cpp" +{ + input "*.cpp"; + output replace(".cpp", ".o"); + requires getMakeDeps("g++ ${CXXFLAGS} -M ${INPUT}"); + profile "build" + { + execute("g++ ${CXXFLAGS} -c -o ${OUTPUT} ${INPUT}", "g++"); + } +} + +// Heh, we're not going to use this one. +rule "c" +{ + input "*.c"; + output replace(".c", ".o"); + requires getMakeDeps("gcc ${CXXFLAGS} -M ${INPUT}"); + profile "build" + { + execute("gcc ${CFLAGS} -c -o ${OUTPUT} ${INPUT}"); + } +} + +rule "bison" +{ + input "*.y"; + output [INPUT.replace(".y", ".tab.c"), INPUT.replace(".y", ".tab.h")]; + profile "build" + { + BASE = INPUT.replace(".y", ""); + execute("bison -b${BASE} ${INPUT}"); + // if you add a -v bison will produce a .output file + } +} + +rule "flex" +{ + input "*.l"; + output replace(".l", ".yy.c"); + output replace(".l", ".yy.h"); + profile "build" + { + execute("flex ${FLEXFLAGS} ${INPUT}"); + } +} 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 @@ + +function qt_uiToH() +{ + if "${UI_DIR}" == "" then + { + DIR = INPUT.dirName(); + } + else + { + DIR = UI_DIR; + } + FILE = INPUT.fileName(); + OUTFILE = FILE.replace(".ui",".h"); + return "${DIR}/ui_${OUTFILE}"; +} + +rule "qt_ui" +{ + display "ui"; + input "*.ui"; + output INPUT.qt_uiToH(); + tag "headers"; + profile "build" + { + execute("${QTDIR}/bin/uic -o ${OUTPUT} ${INPUT}"); + } +} + +function qt_qrcToCpp() +{ + if "${RCC_DIR}" == "" then + { + DIR = INPUT.dirName(); + } + else + { + DIR = RCC_DIR; + } + FILE = INPUT.fileName(); + OUTFILE = FILE.replace(".qrc",".cpp"); + return "${DIR}/qrc_${OUTFILE}"; +} + +rule "qt_rcc" +{ + display "rcc"; + input "*.qrc"; + output INPUT.qt_qrcToCpp(); + profile "build" + { + NAME = INPUT.fileName().replace(".qrc",""); + execute("${QTDIR}/bin/rcc -name ${NAME} -o ${OUTPUT} ${INPUT}"); + } +} + +function qt_isMocable() +{ + if INPUT.matches("*.h") then + { + if exists( INPUT ) then + { + if "$(grep Q_OBJECT ${INPUT})" != "" then + { + return true; + } + } + } + return false; +} + +function qt_hToMocCpp() +{ + if "${MOC_DIR}" == "" then + { + DIR = INPUT.dirName(); + } + else + { + DIR = MOC_DIR; + } + FILE = INPUT.fileName(); + OUTFILE = FILE.replace(".h",".cpp"); + return "${DIR}/moc_${OUTFILE}"; +} + +rule "qt_moc" +{ + display "moc"; + input qt_isMocable(); + output INPUT.qt_hToMocCpp(); + profile "build" + { + execute("${QTDIR}/bin/moc -o${OUTPUT} ${INPUT}"); + } +} + -- cgit v1.2.3