These variables are most commonly used to specify optimization or debugging switches to a compiler, as for example -g, -O2 or (GCC-specific) -march=athlon.
•
CFLAGS allows to add switches for the C compiler, while CXXFLAGS is meant to be used when invoking a C++ compiler.
see also