action "default" { build: [targets("header-links"), "libgats.a"]; } action "all" { build: [targets("header-links"), "libgats.a", targets()]; } CXXFLAGS += "-ggdb -Wall"; target [files("src/*.h").replace("src/", "gats/"), "gats/version.h"] { tag "header-links"; display "symlink"; input OUTPUT.replace("gats/","src/"); profile "build" { execute("ln -s ../${INPUT} ${OUTPUT}"); } } target "src/version.h" { input ".svn"; display "svnver"; profile "build" { execute("echo Revision number: `svnversion`; echo \\#ifndef LIBGATS_VC_ID > ${OUTPUT}; echo \\#define LIBGATS_VC_ID \\\"`svnversion`\\\" >> ${OUTPUT}; echo \\#endif >> ${OUTPUT}"); } } target "libgats.a" { rule "lib"; input files("src/*.cpp"); CXXFLAGS += "-I. -Ilibbu++ -fPIC"; } target files("src/tests/*.cpp").replace("src/","").replace(".cpp","") { input "src/${OUTPUT}.cpp"; rule "exe"; tag ["tests", "general tests"]; CXXFLAGS += "-I. -Ilibbu++"; LDFLAGS += "-L. -lgats -Llibbu++ -lbu++"; } target files("src/unit/*.unit").replace("src/","").replace(".unit","") { input "src/${OUTPUT}.unit"; rule "exe"; requires "libbu++.a"; tag ["tests", "unit tests"]; CXXFLAGS += "-I."; LDFLAGS += "-L. -lgats -lbu++"; } rule "unit" { input "*.unit"; output INPUT.replace(".unit", ".cpp"); profile "build" { execute("../libbu++/mkunit \"${INPUT}\" \"${OUTPUT}\""); } }