automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Best means to override CXXFLAGS locally


From: Akim Demaille
Subject: Best means to override CXXFLAGS locally
Date: Sun, 22 Oct 2006 11:12:27 +0200

I have this cross-compiler at hand that cannot compile some of my
big files (a Bison parser) with -O2.  Stacking -O0 on top of -O2
does the trick.  But I don't know the recommended way to do that.

Since I'd like to the keep the good old -g -O2 for the rest of
the compilation, since I don't want to forbid the user from
passing -O2 in her flags, I'd really like to override this just
for this file.  Compiling it as a library with specific CXXFLAGS
won't do the trick, since CXXFLAGS, of course, appear after
$(libparser_la_CXXFLAGS):

libparser_la-ugrammar.lo: ugrammar.cc
if $(LIBTOOL) --tag=CXX --mode=compile $(CXX) $(DEFS) $ (DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $ (libparser_la_CXXFLAGS) $(CXXFLAGS) -MT libparser_la-ugrammar.lo -MD - MP -MF "$(DEPDIR)/libparser_la-ugrammar.Tpo" -c -o libparser_la- ugrammar.lo `test -f 'ugrammar.cc' || echo '$(srcdir)/'`ugrammar.cc; \ then mv -f "$(DEPDIR)/libparser_la-ugrammar.Tpo" "$(DEPDIR)/ libparser_la-ugrammar.Plo"; else rm -f "$(DEPDIR)/libparser_la- ugrammar.Tpo"; exit 1; fi

What would be the cleanest means to handle this exception?

Thanks!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]