/* * Copyright (C) 2007-2011 Xagasoft, All rights reserved. * * This file is part of the libbu++ library and is released under the * terms of the license contained in the file LICENSE. */ /** * This is just like default.bld, but for mingw...crazy, eh? */ CXXFLAGS += "-ggdb -W -Wall"; action "default" { build: [targets("header-links"), "libbu++win.a"]; } target files("src/*.h").replace("src/", "bu/") { tag "header-links"; display "symlink"; input OUTPUT.replace("bu/","src/"); profile "build" { execute("mkdir -p $(dirname ${OUTPUT}); ln -s ../${INPUT} ${OUTPUT}"); } } target files("src/compat/*.h").replace("src/", "bu/") { tag "header-links"; display "symlink"; input OUTPUT.replace("bu/","src/"); profile "build" { execute("mkdir -p $(dirname ${OUTPUT}); ln -s ../../${INPUT} ${OUTPUT}"); } } target "libbu++win.a" { input files("src/*.cpp", "src/compat/*.cpp"); rule "lib"; CXXFLAGS += "-I. -Isupport/windows"; } target ["src/process.win_o", "src/deflate.win_o", "src/lzma.win_o"] { profile "build" { execute("rm -f src/process.win_o && touch src/process.win_o && echo NOT BUILDING PROCESS RIGHT NOW!!!"); } } target "src/regex.win_o" { profile "build" { execute("rm -f src/regex.win_o && touch src/regex.win_o && echo NOT BUILDING REGEX RIGHT NOW!!!"); } } target "src/cachestorefiles.win_o" { profile "build" { execute("rm -f src/cachestorefiles.win_o && touch src/cachestorefiles.win_o && echo NOT BUILDING REGEX RIGHT NOW!!!"); } } 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++"); } }