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 +++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 share/autoinclude/general-rules.bld (limited to 'share/autoinclude') 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}"); + } +} -- cgit v1.2.3