Reputation: 33
If I tell the C preprocessor to #include a file and use CPPFLAGS to help find the needed file, then the file is included already, right? What, if any, use is telling the C compiler about the same include directory with CFLAGS?
Upvotes: 3
Views: 470
Reputation: 181705
I don't think there is any use.
The implicit make rules indicates that CFLAGS
is only used when compiling C programs (from .c to .o). The value of CPPFLAGS
is also added to the compiler command line.
CPPFLAGS
is also used in the following rules:
Since CPPFLAGS
is used in every case where CFLAGS
is used, there seems to be no point in adding -I
directives to CFLAGS
that are already in CPPFLAGS
.
Of course, if your Makefile has custom rules that pass CFLAGS
to the compiler, but omit CPPFLAGS
, it's a different story.
Upvotes: 2