Re: Problem with implicit rule for .o files and overriding of CXXFLAGS.
Am Donnerstag, den 26.06.2008, 09:18 +1000 schrieb Trent W. Buck:
> Charles Plessy <firstname.lastname@example.org> writes:
> > while working on an update to the `proda' package, I realised that a
> > compilation option, DVERSION="\"1.00\"", was discarded during the build
> > of the Debian binary package. The reason is very simple:
> > OTHERFLAGS = -DVERSION="\"1.00\""
> > CXXFLAGS = -g -W -Wall -pedantic $(OTHERFLAGS)
> Why can't you simply change = to +=, thereby appending these flags to
> whatever is supplied by the user?
Overriding CXXFLAGS makes all '=', '+=' etc. useless. You will need the
override CXXFLAGS += $(OTHERFLAGS)
However, there are better (and non-GNU-make specific) solutions: DEFS,
CPPFLAGS, _CPPFLAGS, ...