Mail Archives: djgpp-workers/1999/11/04/13:59:28
Eli Zaretskii wrote:
>
> On Wed, 1 Jan 1997, Nate Eldredge wrote:
>
> > > Most Makefile's I saw put -g into CFLAGS, so linking is done with -g as
> > > well.
> >
> > Except that in my experience, Makefiles don't use CFLAGS when
> > linking, they use LDFLAGS instead.
>
> Examples, please.
>
> Most GNU packages (at least their latest releases) use CFLAGS in
> linking. Automake generates these Makefiles automatically, so any
> package that uses Automake will have that. Including Cdecl, for
> example ;-).
>
> I understand that one reason for this is that people are used to say
> "make CFLAGS=-pg" and expect it to DTRT.
Okay, perhaps you are right. This seems to be a somewhat recent
addition. I suspect most home-grown Makefiles don't, however, and FWIW
make's implicit rules don't either.
But in any case, I don't think this is worth it. I've never been a fan
of changing legitimate behavior for the sake of people who won't RTFM,
and this is a fairly well ingrained behavior of GCC-- unless you specify
otherwise, the link stage just puts all the object files together. For
instance, -g is documented as a compilation option and not a link
option, so our behavior would then not match the GCC manual, leading to
further confusion. Besides, for anyone who has preconceptions of
executable size (most likely from Borland or similar), 30K for Hello
World will seem just as excessive as 60K, so I don't think it will
forestall that many questions.
Just IMHO.
--
Nate Eldredge
neldredge AT hmc DOT edu
- Raw text -