Hi,
Here is what currently I have:
http://pastebin.com/VCTNVWSmIt is not so simple and clean and yep it may contain many mistakes, sorry.
I guess you should read it from bottom to top.
task_main() creates target "All" which depends on 2 executables: "release.bin" and "debug.bin".
task_link() creates tasks for "release.bin" and "debug.bin" targets, these have calculated dependencies: "generatedDep:release" and "generatedDep:debug".
"generatedDep:release" and "generatedDep:debug" tasks are made by task_generatedDep(). Both "generatedDep:" tasks are depending on the "generator" task which is created by task_generator().
There is a delayed task creator: task_generatedObjs(), this should be executed just after the execution of the "generator" task. This task generator creates task for building .o files from the generated .cpp files.
When I run this, the output looks like:
$ ./build.py
-- obj/debug/Main.o
-- obj/release/Main.o
. generator
generator running
. generatedDep:debug
getDep(debug)
. generatedDep:release
getDep(release)
. debug.bin
obj/debug/Main.o: In function `main':
/home/endre/Prg/Repos/doit/src/Main.cpp:16: undefined reference to `str2'
/home/endre/Prg/Repos/doit/src/Main.cpp:16: undefined reference to `str1'
/home/endre/Prg/Repos/doit/src/Main.cpp:16: undefined reference to `str0'
collect2: error: ld returned 1 exit status
I'd expect to see the
"task_generatedObjs() started" message just after the "generator running" message, since task_generatedObjs
() is a delayed task creator, which should be executed when the "generator" task has been finished.