[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: CPPASCOMPILE doesn't use $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)
From: |
Ralf Corsepius |
Subject: |
Re: CPPASCOMPILE doesn't use $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) |
Date: |
Thu, 12 Oct 2006 06:36:12 +0200 |
On Wed, 2006-10-11 at 22:02 +0200, Thomas Schwinge wrote:
> Hello!
>
> On Wed, Oct 11, 2006 at 10:12:33AM +0200, Ralf Corsepius wrote:
> > with automake-cvs/HEAD, and using *.S, CPPASCOMPILE doesn't apply
> > $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) to its compilation rules.
>
> It also doesn't for 1.9.6, by the way.
>
> > From a Makefile.in:
> > CPPASCOMPILE = $(CCAS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CCASFLAGS) \
> > $(CCASFLAGS)
> >
> > IMO, as *.S sources are supposed to be preprocessed, it would be better
> > to let CPPASCOMPILE be processed the same way *.c sources are, i.e. to
> > apply "$(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)":
> >
> > C-COMPILE from a Makefile.in:
> > COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
> > $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
>
> Like you suggest, I would also expect for `COMPILE' and `CPPASCOMPILE' to
> behave the same apart from the obvious differences. But those
> differences should not include what `COMPILE' and `CPPASCOMPILE' have in
> common: the preprocessing. And all of the missing bits are pre processor
> flags.
>
> > IMO, though this would introduce an inconsistency to *.s
> > (non-preprocessed asm sources) this probably would help users to be
> > facing inconsistencies between *.S and *.c/*.cc/*.f etc. languages
> > (which use $(DEFS) etc.).
>
> I think I don't understand that part.
Older automakes did not distinguish "*.S" (Preprocessed asm) from
"*.s" (mere asm) and processed both of them the same way (Hence the name
CCAS - "Calling the assembler through CC").
The old rules (*.s->*.o; CCAS) have been rarely been used, because they
are largely non portable and toolchain specific. They work w/ GCC, but
them working with non-GCC toolchains is more or less a random accident.
Therefore, the *.s->*.o/CCAS rules could not be generalized to apply
CPPFLAGS (-D, -I etc.), because they can't rely on CCAS to accept them.
Processing *.S's is much more portable. They can assume the compiler to
reliably accept CPPFLAGS. Hence the new "CPPASCOMPILE" instead of
"CCASCOMPILE". Them using CCAS and CCAS_FLAGS internally, is a relic of
the past, because most users of the old CCAS rules actually were
applying them on "*.S"'s and were using GCC. In many cases these users
were manually appending "$(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES)"
somewhere to their code.
These users will see duplicated CPPFLAGS during compilation of *.S's
with automake-CVS - I.e. an incompatibility.
Ralf