www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/19/05:41:30

Date: Wed, 19 Jan 2000 10:02:57 +0200 (WET)
From: Andris Pavenis <pavenis AT lanet DOT lv>
To: Gisle Vanem <gvanem AT eunet DOT no>
cc: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>, djgpp AT delorie DOT com
Subject: Re: make depend
In-Reply-To: <01a701bf6198$9fa72d80$293f8589@gv015029.bgo.nera.no>
Message-ID: <Pine.A41.4.05.10001190953540.32442-100000@ieva01.lanet.lv>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: dj-admin AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com


On Tue, 18 Jan 2000, Gisle Vanem wrote:

> I  got another idea; force gcc (and the cpp stage) to use a 
> specific 'specs' file. I tried this hack:
> 
>   $(TMPDIR)/specs::
>           echo "*cpp: %(cpp_cpu) %{posix:-D_POSIX_SOURCE} -remap" > $@

Currently for DJGPP port of gcc-2.95.2 specs file is generated at build 
time by dumping builtin specs (gcc -dump-specs). So such way should work.
However You can also make a copy of actual specs file and remove -imacros
... with sed (untested)

$TMPDIR/specs::
	cat $(shell gcc -print-file-name=specs) |\
	sed -e 's|-imacros %s../include/sys/version.h||g' >$(TMPDIR)/specs

> 
>   depend: $(TMPDIR)/specs
>         @copy Makefile.dj Makefile.bak
>         sed -e "/^# DO NOT DELETE THIS LINE/,$$d" < Makefile.bak > Makefile.dj
>         echo "# DO NOT DELETE THIS LINE" >> Makefile.dj
>         $(CC) -specs=$(TMPDIR)/specs -MM $(CFLAGS) $(SRC)   >> Makefile.dj
> 
> Which works!
> 


Andris

- Raw text -


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