本文介绍了自动工具包含路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个类似
Makefile.am
Configure.ac
src/
hello.c
Makefile.am
include/
hello.h
如何在src的Makefile.am中指定包含路径,以使其包含来自include/dir的头文件以及c文件取决于头文件.因此,如果我修改任何.h文件,它将强制重新编译.cc文件.
How to specify the include path in Makefile.am of src so that it includes header files from include/ dir as well as c file depends on header file.So if I modify any .h file it force to recompile .cc file.
定义AM_CPPFLAGS'会发出警告
Defining AM_CPPFLAGS' is giving warning
configure.ac:5: warning: macro `AM_CPPFLAGS' not found in library
推荐答案
在 src/Makefile.am 中,输入:
AM_CPPFLAGS = -I$(top_srcdir)/include
bin_PROGRAMS = hello
hello_SOURCES = hello.c
无需标记 hello.c 和 hello.h 之间的依赖关系,.
There is no need to mark the dependency between hello.c and hello.h, it will be recorded automatically the first time you build your project.
这篇关于自动工具包含路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!