Article View: gnu.utils.bug
Article #466make-3.56 problem re-exec'ing when invoked with -f (w/ fix)
From: Dale Nielsen
Date: Tue, 03 Oct 1989 18:40
Date: Tue, 03 Oct 1989 18:40
60 lines
2502 bytes
2502 bytes
There is a problem with make-3.56 when it is invoked with
the -f option to specify the filename of the makefile which
includes other makefiles for which rules exist. It saves
the name of the makefile on a list called read_makefiles.
Unfortunately, with the current version this name goes to
the end of the list (which can potentially contain included
makefiles not mentioned with the -f option). The list of
makefiles included with the -f option (called makefiles) is
is then added to using the first makefile on this list (when
the correct makefile is actually the last one).
I changed the routine read_makefile in read.c to add these
makefiles to the end of read_makefiles rather than the
beginning, so that when the makefile name is saved in
makefiles from the beginning of the read_makefiles list, it
is correct.
Here are the context diffs of the changes I made. I didn't
see anything else that depended on the order of links in the
read_makefiles list, but if anyone knows of something that
does, please let me know.
*** read.c Tue Oct 3 13:37:51 1989
--- read.c.orig Mon Sep 18 20:18:56 1989
***************
*** 248,263 ****
/* Add FILENAME to the chain of read makefiles. */
deps = (struct dep *) xmalloc (sizeof (struct dep));
! if (read_makefiles == 0)
! read_makefiles = deps;
! else
! {
! register struct dep *p = read_makefiles;
! while (p->next)
! p = p->next;
! p->next = deps;
! }
! deps->next = 0;
deps->name = 0;
deps->file = lookup_file (filename);
if (deps->file == 0)
--- 248,255 ----
/* Add FILENAME to the chain of read makefiles. */
deps = (struct dep *) xmalloc (sizeof (struct dep));
! deps->next = read_makefiles;
! read_makefiles = deps;
deps->name = 0;
deps->file = lookup_file (filename);
if (deps->file == 0)
--
--Dale Nielsen ARPA: dale@vicorp.UU.NET
V. I. Corporation UUCP: uunet!vicorp!dale
Amherst Research Park PHONE: (413) 253-3482
Amherst, Massachusetts 01002 FAX: (413) 256-0574
Technical Details
Message-ID:
<8382@vicorp.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!ginosko!uunet!vicorp!daleShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!ginosko!uunet!vicorp!dale From: dale@vicorp.UUCP (Dale Nielsen) Newsgroups: gnu.utils.bug Subject: make-3.56 problem re-exec'ing when invoked with -f (w/ fix) Keywords: make bug fix Message-ID: <8382@vicorp.UUCP> Date: 3 Oct 89 18:40:23 GMT Organization: V. I. Corporation, Amherst, Massachusetts Lines: 60