# vim: syntax=build CXXFLAGS += "-ggdb -W -Wall"; action "default" { build: [targets("header-links"), "libbu++.a"]; } action "pkg" { build: targets("pkg"); } action "all" { build: [targets("header-links"), "libbu++.a", targets("tests")]; } target files("src/*.h").replace("src/", "bu/") { tag "header-links"; display "symlink"; input OUTPUT.replace("bu/","src/"); profile "build" { execute("ln -s ../${INPUT} ${OUTPUT}"); } } target "libbu++.a" { input files("src/*.cpp"); rule "lib"; CXXFLAGS += "-I. -fPIC"; } // // Tests // target files("src/tests/*.cpp").replace("src/","").replace(".cpp","") { input "src/${OUTPUT}.cpp"; rule "exe"; tag "tests"; CXXFLAGS += "-I."; LDFLAGS += "-L. -lbu++"; } // Some tests need extra libs and whatnot, that goes here. target "tests/bzip2" { LDFLAGS += "-lbz2"; } target "libbu++-r$(svnversion "-n").tar.bz2" { input [ "LICENSE", "build.conf", "Doxyfile", "buildm3.conf", "support/vim/syntax/taf.vim", "support/vim/ftdetect/taf.vim", "support/vim/ftplugin/taf.vim", files("*.sh"), files("src/*.cpp"), files("src/*.h"), files("src/tests/*.cpp"), files("src/tests*.h"), files("src/tools/*.cpp"), files("src/tools/*.h"), files("src/unit/*.unit"), files("src/doxy/*.dox") ]; rule "tarball"; tag "pkg"; } rule "tarball" { input matches("LICENSE", "*.cpp", "*.h", "*.conf", "Doxyfile", "*.vim", "*.sh"); profile "build" { OUTDIR = OUTPUT.replace(".tar.bz2",""); execute("tar --transform=\"s@^@${OUTDIR}/@\" -c ${INPUT} |" " bzip2 -9 > ${OUTPUT}"); } }