如何在不对其路径进行硬编码的情况下调用子makefile?

时间:2015-11-24 14:56:17

标签: makefile gnu-make makefile-project multiple-makefiles

我有一个像这样的文件夹结构:

./Makefile
./template
./template/Makefile
./template/html/
./template/html/Makefile
./template/latex/
./template/latex/Makefile
./template/latex/foo/
./template/latex/foo/Makefile
./template/latex/bar/
./template/latex/bar/Makefile
./... # a lot more

(文件夹结构可能更嵌套)。

如何在不对Makefile的路径进行硬编码的情况下调用./template/latex/bar/ Makefile(all目标)?

最好的情况是能够这样称呼它:

make latex/bar # for the latex/bar template
make latex     # for all latex templates
make html      # for all html templates
make           # for all templates

0 个答案:

没有答案
相关问题