tags:

views:

4436

answers:

3

What's the difference between CPPFLAGS and CXXFLAGS in GNU Make?

+4  A: 

By default, CPPFLAGS will be given to the C preprocessor, while CXXFLAGS will be given to the C++ compiler. You could have easily found this out yourself if you had taken a look at the manual (see Implicit Variables).

Christoph
I was staring right at the manual when I had this exact same question. I typed CPPFLAGS into stackoverflow and got the answer much quicker than searching the manual.
Dan Hook
+5  A: 

CPPFLAGS are for the C preprocessor, while CXXFLAGS are for the C++ compiler.

See here.

starblue
+13  A: 

CPPFLAGS is supposed to be for flags for the C Pre**P**rocessor; 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, and CXXFLAGS is only passed when compiling and linking C++.

Kieron