delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/12/03/05:09:17

Sender: rich AT phekda DOT freeserve DOT co DOT uk
Message-ID: <3DEC8110.FF2D211B@phekda.freeserve.co.uk>
Date: Tue, 03 Dec 2002 10:01:52 +0000
From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.23 i586)
X-Accept-Language: de,fr
MIME-Version: 1.0
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
CC: djgpp-workers AT delorie DOT com
Subject: Re: strtold is now a standard function (C99) [PATCH]
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1021202075345 DOT 29205C-100000 AT is>
Reply-To: djgpp-workers AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019