我宁愿避免make
的递归调用。除非有人推荐这个,否则看起来效率低下。 (如果有人推荐它,我们可以标记为How can I call a specific target from my makefile?)的副本
我找到了相关的线程,但大多数解决方案都涉及重构make命令,例如: makefile execute another target
或取决于您要运行的目标,例如 How do I make a target in a makefile invoke another target in the makefile
事实上,我会对如何重构我的makefile感兴趣。我是makefile的新手,所以如果我让事情变得比他们需要的更复杂,我不会感到惊讶。
# depend on all files in folder abc
myTarget1: $(shell find abc -type f)
make otherTarget
some commands...
# I have various targets that need to do the following:
.PHONY : otherTarget
otherTarget:
common commands...