From: Hans-Bernhard Broeker Newsgroups: comp.os.msdos.djgpp Subject: Re: as and structs Date: 16 Aug 2003 15:54:58 GMT Organization: Aachen University of Technology (RWTH) Lines: 38 Message-ID: References: <3f3e2079$0$168$cc7c7865 AT news DOT luth DOT se> <3f3e4fcf$0$172$cc7c7865 AT news DOT luth DOT se> NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de X-Trace: nets3.rz.RWTH-Aachen.DE 1061049298 11131 137.226.32.75 (16 Aug 2003 15:54:58 GMT) X-Complaints-To: abuse AT rwth-aachen DOT de NNTP-Posting-Date: 16 Aug 2003 15:54:58 GMT Originator: broeker@ To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Martin Str|mberg 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.