Autotools includes a path

I have a directory structure like

Makefile.am Configure.ac src/ hello.c Makefile.am include/ hello.h 

How to specify the inclusion path in Makefile.am src so that it includes header files from include / dir, and the c file depends on the header file. Therefore, if I modify any .h file, this forces me to recompile the .cc file.

The definition of AM_CPPFLAGS 'gives a warning

 configure.ac:5: warning: macro `AM_CPPFLAGS' not found in library 
+8
autotools
source share
1 answer

In src / Makefile.am write:

 AM_CPPFLAGS = -I$(top_srcdir)/include bin_PROGRAMS = hello hello_SOURCES = hello.c 

There is no need to note the relationship between hello.c and hello.h , it will be automatically written the first time you build your project .

+10
source share

All Articles