From 982afa6bbcf48b2254e9fe532add5e57be36d237 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sat, 15 Jun 2019 16:29:40 +0800 Subject: [PATCH] Makefile: Require explicit target Explicit target (e.g., buildworld, buildkernel) is required, otherwise fail with an error. Obtained-from: FreeBSD Bug-report: #3158 --- Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 5d02dc434c..66773c1b7b 100644 --- a/Makefile +++ b/Makefile @@ -118,10 +118,17 @@ ${TGTS} ${BITGTS}: .PHONY @cd ${.CURDIR}; \ ${MAKE} ${.TARGET} -# Set a reasonable default -.MAIN: all +# Fail with an error when no target is given. +.MAIN: _guard + +_guard: .PHONY + @echo + @echo "Explicit target required. See build(7)." + @echo + @false STARTTIME!= LC_ALL=C date + # # world # -- 2.41.0