Mail Archives: djgpp-workers/2002/12/03/05:09:17
Hello.
Eli Zaretskii wrote:
>
> On Sun, 1 Dec 2002, Richard Dawe wrote:
>
> > BTW I'm not sure if this is repeatable, but recently I saw the following.
> > I had a .c and .S file with the same stem. I changed the makefile to
> > assemble .S file rather than compile a .c file, but it still compiled
> > the .c file rather than the .S file.
>
> Something to do with built-in rules of GNU Make, I'd guess. Try to play
> with .SUFFIXES or something.
We currently have this in src/makefile.inc:
.SUFFIXES: .o .i .c .cc .s
My test situation was this:
cd /path/to/djgpp/tree
cd src
mkdir foo
cd foo
touch foo.c foo.S
---Start src/foo/Makefile---
TOP=.
#SRC += foo.c
SRC += foo.S
include $(TOP)/../makefile.inc
---End src/foo/Makefile---
I tried: shifting .s to the front; adding .S to the end; adding .S to the
front. None of this made any difference: the .c file was always compiled and
the .S file was always ignored, when I did "make clean && make all" in
src/foo.
So it looks like we can't have a .c and .S file with the same stem. This makes
sense: where would the object file go? But it still troubles me that the
makefile builds the .c in preference to the .S.
BTW why isn't .S in .SUFFIXES?
Thanks, bye, Rich =]
--
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]
- Raw text -