From 811ab29d661266059abc28108d69c9a3e0b0fc88 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 20 Oct 2010 19:06:05 +0000 Subject: It builds on windows. --- mingw.bld | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 mingw.bld (limited to 'mingw.bld') diff --git a/mingw.bld b/mingw.bld new file mode 100644 index 0000000..dafb73d --- /dev/null +++ b/mingw.bld @@ -0,0 +1,73 @@ +/** + * This is the default.bld file for libgats, it pretty much handles everything + * libgats related, kinda' cool, eh? It can completely replace the old build + * and actually does a better job with a number of things. + */ + +CXXFLAGS += "-ggdb -W -Wall"; + +action "default" +{ + build: [targets("header-links"), "libgatswin.a"]; +} + +target files("src/*.h").replace("src/", "gats/") +{ + tag "header-links"; + display "symlink"; + input OUTPUT.replace("gats/","src/"); + profile "build" + { + execute("mkdir -p $(dirname ${OUTPUT}); ln -s ../${INPUT} ${OUTPUT}"); + } +} +target files("src/compat/*.h").replace("src/", "gats/") +{ + tag "header-links"; + display "symlink"; + input OUTPUT.replace("gats/","src/"); + profile "build" + { + execute("mkdir -p $(dirname ${OUTPUT}); ln -s ../../${INPUT} ${OUTPUT}"); + } +} + +target "libgatswin.a" +{ + input files("src/*.cpp"); + rule "lib"; + CXXFLAGS += "-I. -Ilibbu++"; +} + +function cppToWinObj() +{ + if OBJ_DIR == null then + { + return INPUT.regex("\\.cpp$", ".win_o"); + } + else + { + return OBJ_DIR + "/" + INPUT.fileName().regex("\\.cpp$", ".win_o"); + } + +} + +rule "lib" +{ + input "*.win_o"; + profile "build" + { + execute("wine C:/MinGW/bin/ar.exe cr ${OUTPUT} ${INPUT}"); + } +} + +rule "wincpp" +{ + input "*.cpp"; + output INPUT.cppToWinObj(); + //requires getMakeDeps("wine C:/MinGW/bin/g++.exe ${CXXFLAGS} -M ${INPUT}"); + profile "build" + { + execute("wine C:/MinGW/bin/g++.exe ${CXXFLAGS} -c -o ${OUTPUT} ${INPUT}", "g++"); + } +} -- cgit v1.2.3