Reputation: 1578
I read documents about CPPFLAGS. Shortly, I understand that CPPFLAGS used for pass parameter to compiler. Sample usage CPPFLAGS in makefile is below.
gcc $(CPPFLAGS) main.c -o main.o
Execute make
make CPPFLAGS=-I../header
What is special CPPFLAGS text? It can be interchangable any other text like "FOO". What is the differences between FOO variable and CPPFLAGS variable? Replace all CPPFLAGS text with FOO text build is success again, nothing changes.
Main problem that actually need to solve. There are lots of makefiles. There is no include CPPFLAGS variable in these makefiles. Is there a way to pass compiler options without change makefiles.
Thanks.
Upvotes: 0
Views: 525
Reputation: 136208
What is special CPPFLAGS text? It can be interchangable any other text like "FOO"
Three things are special about CPPFLAGS
:
CPPFLAGS
variable when compiling .o
from C and C++ sources. These rules can be replaced with one's own rules if necessary.CPPFLAGS
for preprocessor flags you follow the principle of least astonishment.There is no include CPPFLAGS variable in these makefiles
If you meant that there are no occurrences of CPPFLAGS
in the makefiles that may be because the implicit rules are used which I mentioned above.
Upvotes: 1