I want to conditionally include makefiles depending on the contents of a xml file and product.
My xml file (myxml.xml):
<product1>
<component1 dirname=dir1 />
<component2 dirname=dir2 />
</product1>
<product2>
<component1 dirname=dir1 />
<component3 dirname=dir3 />
</product2>
In dir1 I have a config.mk file which looks like this:
SRC_JS+=dir1/file1.js
SRC_JS+=dir1/file2.js
SRC_HTML+=dir1/file3.html
Same for dir2 and dir3 which are all subdirs of the makefile dir.
Now I want depending on the specified product include certain config.mk files according to what is in the xml file.
So my makefile:
myjscode.js: myxml.xml
read_dirs.py -p $PRODUCT $< > mydirs.txt
while read mydir; do \
include $$mydir/config.mk ; \
done < mydirs.txt;
js-compiler $(addprexis --js ,$SRC_JS) -output $@
Can this be done? FYI: I'm using bash and the read_dirs.py script outputs a 'one-line-per-directory' list.