[Midnightbsd-cvs] src [7046] trunk/Makefile: bring in a sanity check from CheriBSD to stop people from running make with no target

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Thu Jun 18 21:10:07 EDT 2015


Revision: 7046
          http://svnweb.midnightbsd.org/src/?rev=7046
Author:   laffer1
Date:     2015-06-18 21:10:07 -0400 (Thu, 18 Jun 2015)
Log Message:
-----------
bring in a sanity check from CheriBSD to stop people from running make with no target

Modified Paths:
--------------
    trunk/Makefile

Modified: trunk/Makefile
===================================================================
--- trunk/Makefile	2015-06-19 01:05:49 UTC (rev 7045)
+++ trunk/Makefile	2015-06-19 01:10:07 UTC (rev 7046)
@@ -195,9 +195,18 @@
 ${TGTS}:
 	${_+_}@cd ${.CURDIR}; ${_MAKE} ${.TARGET}
 
-# Set a reasonable default
-.MAIN:	all
+# The historic default "all" target creates files which may cause stale
+# or (in the cross build case) unlinkable results. Fail with an error
+# when no target is given. The users can explicitly specify "all"
+# if they want the historic behavior.
+.MAIN:	_guard
 
+_guard:
+	@echo
+	@echo "Explicit target required (use \"all\" for historic behavior)"
+	@echo
+	@false
+
 STARTTIME!= LC_ALL=C date
 CHECK_TIME!= find ${.CURDIR}/sys/sys/param.h -mtime -0s
 .if !empty(CHECK_TIME)



More information about the Midnightbsd-cvs mailing list