我现在有一个 Makefile.am 文件,看起来像这样:
lib_LIBRARIES = foo.a
foo_a_SOURCES = bar.F90 baz.F90
编译时,bar.F90 给出 bar.o。但是,bar.F90 依赖于其他几个 Fortran 文件(cat.F90、dog.F90、pig.F90)。如果这些依赖项之一的源发生变化,我想设置 Automake 来重建 bar.o。
我一直在阅读 automake/autoconf 的 GNU 手册,但找不到解决方法。感谢阅读。
最佳答案
Automake 会自动跟踪大多数源代码级依赖项,如 the Dependencies section 中所述的 its manual .如果您已经知道这一点并且实验表明它不起作用,您可能必须重写 bar.o
目标以添加依赖项,如 the Extending section 中所述。 .
关于makefile - 如何在 automake 中创建依赖项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3050629/