aboutsummaryrefslogtreecommitdiff
path: root/mk/init.mk
diff options
context:
space:
mode:
Diffstat (limited to 'mk/init.mk')
-rw-r--r--mk/init.mk8
1 files changed, 6 insertions, 2 deletions
diff --git a/mk/init.mk b/mk/init.mk
index 356c8501367e..b740378cd69a 100644
--- a/mk/init.mk
+++ b/mk/init.mk
@@ -1,4 +1,4 @@
-# $Id: init.mk,v 1.26 2021/12/08 05:56:50 sjg Exp $
+# $Id: init.mk,v 1.27 2022/01/01 17:32:18 sjg Exp $
#
# @(#) Copyright (c) 2002, Simon J. Gerraty
#
@@ -66,13 +66,17 @@ CXX_PIC?= ${CC_PIC}
PROFFLAGS?= -DGPROF -DPROF
.if ${.MAKE.LEVEL:U1} == 0 && ${MK_DIRDEPS_BUILD:Uno} == "yes"
-# targets that are ok at level 0
+.if ${RELDIR} == "."
+# top-level targets that are ok at level 0
DIRDEPS_BUILD_LEVEL0_TARGETS += clean* destroy*
M_ListToSkip?= O:u:S,^,N,:ts:
.if ${.TARGETS:Uall:${DIRDEPS_BUILD_LEVEL0_TARGETS:${M_ListToSkip}}} != ""
# this tells lib.mk and prog.mk to not actually build anything
_SKIP_BUILD = not building at level 0
.endif
+.elif ${.TARGETS:U:Nall} == ""
+_SKIP_BUILD = not building at level 0
+.endif
.endif
.if !defined(.PARSEDIR)