make - Get dependencies from another Makefile -
make - Get dependencies from another Makefile -
i'm trying utilize multiple makefiles this:
in ~/generator/makefile
:
foo.xml: foo-part1.xml foo-part2.xml foo-part3.xml ./generate $^ > $@
and in ~/some/other/dir/makefile
:
foo.xml: $(make) -c ~/generator $@ mv ~/generator/$@ $@
the problem is: when go ~/some/other/dir/
, run make foo.xml
, there no dependency list foo.xml
, , make -c ~/generator foo.xml
isn't called if (for instance) ~/generator/foo-part1.xml
newer target.
the solution thought of copying dependency list absolute paths ~/some/other/dir/makefile
, quite awful:
foo.xml: ~/generator/foo-part1.xml ~/generator/foo-part2.xml ~/generator/foo-part3.xml
then, question is: there way in makefile inquire another makefile dependencies of target? or forwards request foo.xml
makefile , collect result? want sec makefile rely on first 1 when comes decide if target should rebuilt, , when comes build it.
i solved having 2 rules in sec makefile:
and in ~/some/other/dir/makefile
:
.phony: ~/generator/foo.xml ~/generator/foo.xml: $(make) -c ~/generator $(notdir $@) foo.xml: ~/generator/foo.xml cp $< $@
makefile make
Comments
Post a Comment