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

Problem with implicit rule for .o files and overriding of CXXFLAGS.



Dear mentors,

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)

proda : $(OBJECTS)
        $(CXX) $(CXXFLAGS) -lm $(OBJECTS) -o proda

The Debian build system overrides CXXFLAGS and $(OTHERFLAGS) is never
passed to the compiler.

First of all, I would appreciate if somebody could give me a link to an
authoritative documentation that explains that CXXFLAGS (and others)
should be expected to be changed to local values by the user. It seems
to me that many upstream authors ignore this fact and write makefiles
that will not work well if CXXFLAGS is changed to the Debian standard
values. (In exchange for the link, I will update
http://wiki.debian.org/GettingPackaged accordingly).

For Proda, I would like to submit a change upstream, such as something
like:

OTHERFLAGS = -DVERSION="\"1.00\""
CXXFLAGS = -g -W -Wall -pedantic

proda : $(OBJECTS)
        $(CXX) $(CXXFLAGS) $(OTHERFLAGS) -lm $(OBJECTS) -o proda

Unfortunately, $(OBJECTS) is a long list of .o files, each built by
implicit rules like:

foo.o: bar.h baz.h
toto.o : tata.h
anotherone.o : baz.h tutu.h
etc...

My problem is that I do not know the contents of the implicit rule
building the .o files from the .h files, nor how I can tell to make to
add $(OTHERFLAGS) to this implicite rule.

Any idea ?

Have a nice day,

-- 
Charles Plessy
Debian-Med packaging team
Tsurumi, Kanagawa, Japan


Reply to: