Mail Archives: djgpp/2003/08/16/13:13:20
Martin Str|mberg <ams AT speedy DOT ludd DOT luth DOT se> wrote:
> source then? E. g. DEBUG in my example.
> :> 1. What should I do to make this work nicely with prototypes and
> :> structs in header files?
> : Enclose the C-only parts in some #ifdef, e.g. #ifdef __GNUC__ or
> : whatever.
> Which define makes a good C<->assembly discriminator? __GNUC__?
I should think so. 'gcc -v' on both a .c and a .S file should
enlighten this further.
> :> 2. Why is CFLAGS missing while compiling y.S
> : Because, obviously, y.S is not a C source file! You wouldn't expect
> : the C++, Fortran or lex flags to be applied to assembler either, would
> : you?
> No. But for those I'd expect gpp, g77 or flex be called not gcc. In
> this case gcc _was_ called, hence I thought CFLAGS should apply.
gcc.exe is a generic compiler driver. The fact that it was called
means essentially nothing. Make does have separate rules for assembly
and C source files, which use separate *FLAGS variables. For
assembler sources, it's ASFLAGS. A look through a 'make -d' or 'make
-p' dump should help to clarify things.
> If you make make compile C++, Fortran or lex code with gcc (weird,
> but...) I'd expect CFLAGS to be used.
That expectation would be quite wrong, though. The choice of flags
depends on the source language (via the file extension), not the
program being called to translate them.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -