Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Oct 2002 06:37:48 -0700 (PDT)
From:      Liu Kang <lazykang@hotmail.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/44053: make clean and make world or kernel should not be performanced concurrently.
Message-ID:  <200210141337.g9EDbmwM048851@www.freebsd.org>

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

>Number:         44053
>Category:       misc
>Synopsis:       make clean and make world or kernel should not be performanced concurrently.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 14 06:40:02 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Liu Kang
>Release:        4.7
>Organization:
Beijing Polytechnic University
>Environment:
FreeBSD ftp.bjpu.edu.cn 4.7-STABLE FreeBSD 4.7-STABLE #13: Thu Oct 10 02:24:10 CST 2002     lazy@ftp.bjpu.edu.cn:/usr/obj/usr/src/sys/FTP  i386
>Description:
      make clean and make world(kernel) should not be performanced at the same time. if so , make world would stop immediately.
>How-To-Repeat:
      just run "make world" and "make clean" at the same time.
>Fix:
I changed the Makefile in /usr/src as follow:


--- Makefile.orig       Mon Oct 14 21:04:12 2002
+++ Makefile    Mon Oct 14 21:05:37 2002
@@ -116,7 +116,7 @@
 #
 # Handle the user-driven targets, using the source relative mk files.
 #
-${TGTS} ${BITGTS}: upgrade_checks
+${TGTS} ${BITGTS}: ifmaking upgrade_checks
        @cd ${.CURDIR}; \
                ${MAKE} ${.TARGET}
 
@@ -130,7 +130,7 @@
 # Attempt to rebuild and reinstall *everything*, with reasonable chance of
 # success, regardless of how old your existing system is.
 #
-world: upgrade_checks
+world:  ifmaking upgrade_checks
        @echo "--------------------------------------------------------------"
        @echo ">>> ${OBJFORMAT} make world started on ${STARTTIME}"
        @echo "--------------------------------------------------------------"
@@ -154,6 +154,7 @@
        @echo "--------------------------------------------------------------"
        @printf ">>> ${OBJFORMAT} make world completed on `LC_ALL=C date`\n                        (started ${STARTTIME})\n"
        @echo "--------------------------------------------------------------"
+       @rm /var/spool/lock/makeworld.lock
 
 #
 # kernel
@@ -180,6 +181,20 @@
            grep -q "Unknown modifier 'C'"; then \
                make make; \
        fi
+#
+# Perform a test to determine whether someone is running "make" in the source directory
+# in order to prevent run "make " and "make clean" at the same time.
+#
+ifmaking:
+        @ if [ -f /var/spool/lock/makeworld.lock ]; then \
+        echo "Please make sure you are the only one who run make at the time!"; \
+        echo "If you think you get this message by mistake , delete /var/spool/lock/makeworld.lock manualy and run make again."; \
+        kill $$PPID ;\
+ else\
+        touch /var/spool/lock/makeworld.lock;\
+ fi
+
+
 
 #
 # A simple test target used as part of the test to see if make supports
@@ -219,6 +234,6 @@
 
 upgrade:       aout-to-elf
 
-${UPGRADE} : upgrade_checks
+${UPGRADE} : ifmaking upgrade_checks
        @cd ${.CURDIR}; \
                ${MAKE} -f Makefile.upgrade -m ${.CURDIR}/share/mk ${.TARGET}
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




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