Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Oct 1997 12:44:26 -0600 (MDT)
From:      marcs@znep.com
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   bin/4697: make doesn't handle dependencies with forced target correctly
Message-ID:  <199710051844.MAA29710@valis.worldgate.com>
Resent-Message-ID: <199710051850.LAA04131@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         4697
>Category:       bin
>Synopsis:       make doesn't handle dependencies with forced target correctly
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct  5 11:50:01 PDT 1997
>Last-Modified:
>Originator:     Marc Slemko
>Organization:
>Release:        FreeBSD 2.2-STABLE i386
>Environment:

FreeBSD 2.2-stable as of a few weeks ago, source examination shows
it to be in -current as well.
	

>Description:

When you have forced dependencies in a makefile that have the same
name as a file or directory, they are not called if the mtime
on the file is the same as the current time.
	

>How-To-Repeat:

If I create the below Makefile:

#----------------------------------------------------------------------
default: proxy
	@echo "Done building module subdirectories"

proxy: ForceMe
	@echo making: $@

ForceMe:
#----------------------------------------------------------------------

then do:

marcs@alive:/tmp/tm$ touch proxy ; make
Done building module subdirectories
marcs@alive:/tmp/tm$ touch proxy ; sleep 1 ; make
making: proxy
Done building module subdirectories

It doesn't execute the proxy target unless I make it pause in
between.
>Fix:

Index: compat.c
===================================================================
RCS file: /mnt/misc1/cvs//src/usr.bin/make/compat.c,v
retrieving revision 1.8
diff -u -r1.8 compat.c
--- compat.c	1997/02/22 19:27:07	1.8
+++ compat.c	1997/09/06 17:37:23
@@ -486,7 +486,7 @@
 	     * check for gn->children being empty as well...
 	     */
 	    if (!Lst_IsEmpty(gn->commands) || Lst_IsEmpty(gn->children)) {
-		gn->mtime = now;
+		gn->mtime = now+1;
 	    }
 #else
 	    /*
@@ -508,7 +508,7 @@
 	     * -- ardeb 1/12/88
 	     */
 	    if (noExecute || Dir_MTime(gn) == 0) {
-		gn->mtime = now;
+		gn->mtime = now+1;
 	    }
 	    if (gn->cmtime > gn->mtime)
 		gn->mtime = gn->cmtime;
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199710051844.MAA29710>