Article View: gnu.utils.bug
Article #139Bug in GNU make 3.62?
From: Paul D. Smith
Date: Mon, 13 Apr 1992 06:09
Date: Mon, 13 Apr 1992 06:09
55 lines
2607 bytes
2607 bytes
I think I've found a bug in GNU make 3.62 (I'm running on a DG AViiON
running DG/UX 5.4.1).
Problem:
When using pattern rules with multiple targets, if the first
examined target is found via the VPATH variable then that target
name is modified to use VPATH but the other targets are not.
However, the other targets *are* marked as updated, so they aren't
looked for via VPATH and so they are not found and the make fails.
I.e., suppose you have something like:
VPATH mydir
%.c %.h : %.fo
$(FOO) $^
all: blah.o foo.o
blah.o: blah.c foo.h
foo.o: foo.c foo.h
and you have a blah.c in the cwd, and foo.{fo,c,h} in `mydir' (where
foo.{c,h} have already been successfully built by the above rule).
What happens in this case is that foo.h is looked for first and found
in `mydir'. The entry for foo.h is changed to be `mydir/foo.h' and is
set to be "updated". Then all the "also_make" file entries (in this
case, foo.c) are set to be "updated" as well (remake.c:207:), but
their names are not modified with VPATH, so when the compile line is
executed it turns out to be:
cc -I mydir -c foo.c -o foo.o
(which fails) instead of the correct line:
cc -I mydir -c mydir/foo.c -o foo.o
I hacked a quick fix by changing the "also_make" update loop (again,
remake.c:207) to call file_mtime() and set the filename accordingly.
Another possible solution might be to not store the "updated" status
into the "also_make" files so they will be updated themselves
seperately, but I'm not sure if that will cause multiple executions of
the multiple-target rule. I leave it for Roland to find the "right"
solution! :-)
paul
-----
------------------------------------------------------------------
| Paul D. Smith | paul_smith@dg.com |
| Data General Corp. | pds@lemming.webo.dg.com |
| Network Systems Development Division | |
| Open Network Systems Development | "Pretty Damn S..." |
------------------------------------------------------------------
Technical Details
Message-ID:
<9204131409.AA04561@lemming.webo.dg.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!lemming.webo.dg.com!pdsShow Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!lemming.webo.dg.com!pds From: pds@lemming.webo.dg.com (Paul D. Smith) Subject: Bug in GNU make 3.62? Message-ID: <9204131409.AA04561@lemming.webo.dg.com> Sender: gnulists@ai.mit.edu Organization: GNUs Not Usenet Distribution: gnu Date: Mon, 13 Apr 1992 06:09:47 GMT Approved: bug-gnu-utils@prep.ai.mit.edu Lines: 56