What's the difference between CPPFLAGS and CXXFLAGS in GNU Make?
Difference between CPPFLAGS and CXXFLAGS in GNU Make
gnu-makemakefile
Related Question
- Using CMake with GNU Make: How to see the exact commands
- Passing additional variables from command line to make
- What do @, – and + do as prefixes to recipe lines in Make
- How to get the list of targets in a makefile
- What’s the difference between := and = in Makefile
- C++ – Difference between using Makefile and CMake to compile the code
- Windows – How to install and use “make” in Windows
Best Solution
CPPFLAGS
is supposed to be for flags for the C PreProcessor;CXXFLAGS
is for flags for the C++ compiler.The default rules in make (on my machine, at any rate) pass
CPPFLAGS
to just about everything,CFLAGS
is only passed when compiling and linking C, andCXXFLAGS
is only passed when compiling and linking C++.