You are not using it correctly CPPFLAGS. This is a variable. I would do something like this:
In the root directory of the source source, create a file with the name common.amand determine what you need:
AM_CPPFLAGS = -DFOO
I know that you said you did not want to use it AM_CPPFLAGS, but listen to me. In your individual subdirectories include $(top_srcdir)/common.amand extend or redefine AM_CPPFLAGSas necessary:
include $(top_srcdir)/common.am
AM_CPPFLAGS += -DBAR
If you want to override, use =instead +=:
include $(top_srcdir)/common.am
AM_CPPFLAGS = -DBAZ
source
share