/** * 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++"); } }