CFLAGS vs CPPFLAGS

Posted by EB on Stack Overflow See other posts from Stack Overflow or by EB
Published on 2010-05-02T21:02:09Z Indexed on 2010/05/02 21:07 UTC
Read the original article Hit count: 312

Filed under:
|
|
|

I understand that CFLAGS (or CXXFLAGS for C++) are for the compiler, whereas CPPFLAGS is used by the preprocessor.

But I still don't understand the difference.

I need to specify an include path for a header file that is included with #include -- because #include is a preprocessor directive, is the preprocessor (CPPFLAGS) the only thing I care about?

Under what circumstances do I need to give the compiler an extra include path?

In general, if the preprocessor finds and includes needed header files, why does it ever need to be told about extra include directories? What use is CFLAGS at all?

(In my case, I actually found that BOTH of these allow me to compile my program, which adds to the confusion... I can use CFLAGS OR CPPFLAGS to accomplish my goal (in autoconf context at least). What gives?)

© Stack Overflow or respective owner

Related posts about autoconf

Related posts about autotools