If your sources files have a specific extension like .c, the most simple way is to add a hook to this extension:
@extension('.c')
def process_my_extension(self, node):
task1 = self.create_task("task1", node, node.change_ext(".p1"))
task2 = self.create_task("task2", node, node.change_ext(".p2"))
task2.set_run_after(task1)
class task1_task(Task.Task):
run_str = "Proc1.exe ${SRC} > ${TGT}"
ext_in = ['.c']
ext_out = ['.p1']
class task2_task(Task.Task):
run_str = "Proc2.exe ${SRC} > ${TGT}"
ext_in = ['.c']
ext_out = ['.p2']
The best is to do it in a specific file (mytool.py) which you load in your main wscript:
def configure(conf):
conf.load("mytool", tooldir = ".") # load your mytool.py
def build(bld):
bld(
source = ["src1.c", "src2.c", ],
)