我试着写这种形式的make
规则:在切换到目录之前,在目录中寻找依赖关系?
lib%.so: computations/%.h
make -C computations/ -f makefile $<
输出:
make -C computations/ -f makefile computations/test.h
make[1]: Entering directory `/home/shai/csm/csm2/src/computations'
make[1]: *** No rule to make target `computations/test.h'. Stop.
make[1]: Leaving directory `/home/shai/csm/csm2/src/computations'
make: *** [libtest.so] Error 2
好,似乎它看起来%.h
切换后库。没有biggie,我只是尝试删除
lib%.so: %.h
make -C computations/ -f makefile $<
但现在它根本不承认规则!
输出:
[email protected]:~/csm/csm2/src$ make libtest.so
`make: *** No rule to make target `libtest.so'. Stop.
是make
用脑子玩?如何改变依赖关系使其停止识别目标?
顺便说一下,我只是注意到这是一个奇怪的规则。它更新依赖项,而不是目标。这不是“make”应该如何使用的。 – eriktous 2011-04-06 14:19:38