Mail Archives: djgpp/1999/07/11/18:10:25
George Ryot (ryot AT bigfoot DOT com) wrote:
: ams AT ludd DOT luth DOT se (Martin Str|mberg) wrote:
:
: >CPPFLAGS is the preprocessor's flags. For C++ use CXXFLAGS.
:
: Thanks, that makes more sense. Make's info pages show how standard
: macros are used to make up a compile/link command line, but I can't
: find a summary of each macro and its conventional use.
:
: What I am trying to acheive is a makefile that has a reasonable chance
: of working on different platforms, is it safe to assume that CXXFLAGS
: will work or should I set CFLAGS as normal then do CXXFLAGS=$(CFLAGS)?
If you are using GNU make, then I think it's safe. My make on my Linux
box has the same rule as DJGPP port for C++ files.
: >If you still have a problem, use "make -pn" and analyse its output.
:
: I did that and now it is clearer what is required to force linking
: with the standard c++ library, I have a choice:
:
: LDLIBS = -lstdcxx
:
: This works with DJGPP but on other platforms may fail because the
: library is named differently.
:
: CC = gxx
:
: This seems cleaner. Although it is still platform specific, it's not
: unreasonable to have to set the compiler name and probably not beyond
: most users to figure this one out. If the target is not explicitly
: made dependent upon object files(s) then 'CXX = gxx' is also required.
:
: Thanks for the help, I still don't understand why the default
: behaviour of make doesn't cater for building c++ projects, but at
: least I now have a working makefile.
Yes, then we are two. Because if you do you use CXX (which should be
g++ or gpp or gxx, the C++ compiler) then it should append the C++
runtime library.
Personaly, I wouldn't do "CC=gxx" because you just remove the symptom,
not the cause of your problem.
Right,
MartinS
- Raw text -