> but I can not find the relationship between CXXFLAGS and > CPPFLAGS (for example, CXXFLAGS includes CPPFLAGS) -- > to my surprise, instead I found that CPPFLAGS is used > for C (not C++)? Here is the original text from GNU > make manual, > -------------------- > CXXFLAGS Extra flags to give to the C++ compiler. > CPPFLAGS Extra flags to give to the C preprocessor and > programs that use it (the C and Fortran compilers). > --------------------
Example of compile commands: To compile C++: $(CXX) $(CPPFLAGS) $(CXXFLAGS) etc. To compile C: $(CC) $(CPPFLAGS) $(CFLAGS) etc. CPPFLAGS contains include directories (-I) and defines (-D), which can be reused between C++ and C. When you need to call the preprocessor (for example to generate dependencies automagically), you only need to specify the $(CPPFLAGS) because you put them in the separate $(CPPFLAGS) variable. Otherwise you would have to strip them from the $(CFLAGS) because it also contains parameters that the preprocessor can't handle. Hope this helps. -- Joost Leeuwesteijn _______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
