From e0be2e9bc81c42bbe68705f17f90f4cbf83b0ad9 Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Thu, 27 Aug 2015 01:55:00 +0000 Subject: [PATCH] Automatically append SUBDIR.yes to the SUBDIR variable, and remove duplicates. We cannot sort SUBDIR because many Makefiles have .WAIT in the list which is strongly ordering. Rather than try to second guess when to sort and when to not sort depending on .WAIT being in the list, just remove duplicates. --- share/mk/bsd.subdir.mk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/share/mk/bsd.subdir.mk b/share/mk/bsd.subdir.mk index e1b12768c9e9..8fab6560421f 100644 --- a/share/mk/bsd.subdir.mk +++ b/share/mk/bsd.subdir.mk @@ -16,7 +16,8 @@ # # SUBDIR A list of subdirectories that should be built as well. # Each of the targets will execute the same target in the -# subdirectories. +# subdirectories. SUBDIR.yes is automatically appeneded +# to this list. # # +++ targets +++ # @@ -43,6 +44,11 @@ _SUBDIR: .endif .if !target(_SUBDIR) +.if defined(SUBDIR) +SUBDIR:=${SUBDIR} ${SUBDIR.yes} +SUBDIR:=${SUBDIR:u} +.endif + DISTRIBUTION?= base .if !target(distribute) distribute: .MAKE