Changeset View
Changeset View
Standalone View
Standalone View
head/share/mk/meta.subdir.mk
# $FreeBSD$ | # $FreeBSD$ | ||||
# $Id: meta.subdir.mk,v 1.11 2015/11/24 22:26:51 sjg Exp $ | # $Id: meta.subdir.mk,v 1.12 2020/08/19 17:51:53 sjg Exp $ | ||||
# | # | ||||
# @(#) Copyright (c) 2010, Simon J. Gerraty | # @(#) Copyright (c) 2010, Simon J. Gerraty | ||||
# | # | ||||
# This file is provided in the hope that it will | # This file is provided in the hope that it will | ||||
# be of use. There is absolutely NO WARRANTY. | # be of use. There is absolutely NO WARRANTY. | ||||
# Permission to copy, redistribute or otherwise | # Permission to copy, redistribute or otherwise | ||||
# use this file is hereby granted provided that | # use this file is hereby granted provided that | ||||
# the above copyright notice and this notice are | # the above copyright notice and this notice are | ||||
# left intact. | # left intact. | ||||
# | # | ||||
# Please send copies of changes and bug-fixes to: | # Please send copies of changes and bug-fixes to: | ||||
# sjg@crufty.net | # sjg@crufty.net | ||||
# | # | ||||
.if !defined(NO_SUBDIR) && !empty(SUBDIR) | .if !defined(NO_SUBDIR) && !empty(SUBDIR) | ||||
.if make(destroy*) || make(clean*) | .if make(destroy*) || make(clean*) | ||||
.MAKE.MODE = compat | .MAKE.MODE = compat | ||||
.if !commands(destroy) | .if !commands(destroy) | ||||
.-include <bsd.obj.mk> | .-include <bsd.obj.mk> | ||||
.endif | .endif | ||||
.elif ${.MAKE.LEVEL} == 0 | .elif ${.MAKE.LEVEL} == 0 | ||||
.MAIN: all | .MAIN: all | ||||
.if !exists(${.CURDIR}/${.MAKE.DEPENDFILE:T}) || make(gendirdeps) | .if !exists(${.CURDIR}/${.MAKE.DEPENDFILE:T}) || make(gendirdeps) | ||||
# start with this | # start with this | ||||
DIRDEPS = ${SUBDIR:N.WAIT:O:u:@d@${RELDIR}/$d@} | DIRDEPS = ${SUBDIR:N.WAIT:O:u:@d@${RELDIR}/$d@} | ||||
.if make(gendirdeps) | .if make(gendirdeps) | ||||
.include <meta.autodep.mk> | .include <meta.autodep.mk> | ||||
.else | .else | ||||
# this is the cunning bit | # this is the cunning bit | ||||
# actually it is probably a bit risky | # actually it is probably a bit risky | ||||
# since we may pickup subdirs which are not relevant | # since we may pickup subdirs which are not relevant | ||||
# the alternative is a walk through the tree though | # the alternative is a walk through the tree though | ||||
# which is difficult without a sub-make. | # which is difficult without a sub-make. | ||||
.if defined(BOOTSTRAP_DEPENDFILES) | .if defined(BOOTSTRAP_DEPENDFILES) | ||||
_find_name = ${.MAKE.MAKEFILE_PREFERENCE:@m@-o -name $m@:S,^-o,,1} | _find_name = ${.MAKE.MAKEFILE_PREFERENCE:@m@-o -name $m@:S,^-o,,1} | ||||
DIRDEPS = ${_subdeps:H:O:u:@d@${RELDIR}/$d@} | DIRDEPS = ${_subdeps:H:O:u:@d@${RELDIR}/$d@} | ||||
.elif ${.MAKE.DEPENDFILE:E} == ${MACHINE} && defined(ALL_MACHINES) | .elif ${.MAKE.DEPENDFILE:E} == ${MACHINE} && defined(ALL_MACHINES) | ||||
Show All 36 Lines |