diff options
| -rw-r--r-- | build.conf | 47 |
1 files changed, 21 insertions, 26 deletions
| @@ -1,29 +1,24 @@ | |||
| 1 | # This is a build file for libbu++ | 1 | # This is a build file for libbu++ |
| 2 | 2 | ||
| 3 | default action: check "libbu++.a" | 3 | default action: check "libbu++.a" |
| 4 | "tests" action: check /tests\/.*/ | 4 | "clean" action: clean "libbu++.a" |
| 5 | "clean" action: clean /.*/ | 5 | "all" action: check targets() |
| 6 | "all" action: check /.*/ | 6 | |
| 7 | 7 | set "CXXFLAGS" += "-ggdb" | |
| 8 | create file "libbu++.a" from files in src using rule lib | 8 | |
| 9 | 9 | "libbu++.a": | |
| 10 | for directories matching /src\/test\/(.*)/ in src/test ... | 10 | rule "lib", |
| 11 | create file "tests/{re:1}" from files in "{match}" using rule exe | 11 | target file, |
| 12 | 12 | set "CXXFLAGS" += "-Isrc -fPIC", | |
| 13 | set CXXFLAGS += "-ggdb" | 13 | input filesIn("src") filter regexp("^.*\\.cpp$") |
| 14 | set CXXFLAGS += "-Isrc -fPIC" | 14 | |
| 15 | 15 | rule "lib": | |
| 16 | for targets matching /tests\/.*/ set LDFLAGS += "-L. -lbu++" | 16 | matches regexp("(.*)\\.o$"), |
| 17 | for testes/plugin set LDFLAGS += "-ldl" | 17 | aggregate toString(" "), |
| 18 | 18 | perform command("ar cr {target} {match}") | |
| 19 | /(.*)\.o$/ requires from command "g++ {CXXFLAGS} -M {re:1}.c*" | 19 | |
| 20 | /tests\/.*/ requires "libbu++.a" | 20 | rule "cpp": |
| 21 | 21 | matches regexp("(.*)\\.cpp$"), | |
| 22 | rule lib matches all /(.*)\.o$/ perform command ... | 22 | produces "{re:1}.o", |
| 23 | "ar cr {target} {match}" | 23 | requires commandToList("g++ -M {CXXFLAGS} {match}", "make"), |
| 24 | 24 | perform command("g++ {CXXFLAGS} -c -o {target} {match}") | |
| 25 | rule cpp matches one /(.*)\.c(pp)?$/ produces "{re:1}.o" perform command ... | ||
| 26 | "g++ {CXXFLAGS} -c -o {target} {match}" | ||
| 27 | |||
| 28 | rule exe matches all /(.*)\.o$/ perform command ... | ||
| 29 | "g++ -o {target} {match} {LDFLAGS}" | ||
