Changeset View
Changeset View
Standalone View
Standalone View
targets/Makefile
Show All 32 Lines | |||||
.if ${.MAKE.LEVEL} == 0 | .if ${.MAKE.LEVEL} == 0 | ||||
# this is our top-level makefile | # this is our top-level makefile | ||||
.if make(pkg-*) | .if make(pkg-*) | ||||
DIRDEPS_FILTER = Mtargets/* | DIRDEPS_FILTER = Mtargets/* | ||||
.endif | .endif | ||||
# in theory, this is what we want | |||||
target_dirs = targets targets/pseudo | |||||
# these tweak how we do it | |||||
target_prefix = pkg- build- | |||||
DIRDEPS := ${.TARGETS:Nall:${target_prefix:@p@S,^$p,,@:ts:}:@t@${target_dirs:@d@$d/$t@}@:@d@${exists(${SRCTOP}/$d):?$d:}@} | |||||
all_machine_list = ${ALL_MACHINE_LIST} host common | |||||
.if ${DIRDEPS:Mtargets/pseudo/*} != "" | |||||
# all bets are off | |||||
PKG_MACHINE_LIST = ${all_machine_list} | |||||
.endif | |||||
.if make(check-commit) | |||||
# a special case | |||||
DIRDEPS = targets/pseudo/check-commit | |||||
.if defined(ALL_MACHINES) | |||||
CHECK_MACHINE_LIST = all | |||||
.undef ALL_MACHINES | |||||
.endif | |||||
SHIPDIR = no | |||||
.else | |||||
.if defined(ALL_MACHINES) | |||||
DIRDEPS := ${DIRDEPS:O:u:@d@${all_machine_list:O:u:@m@${exists(${SRCTOP}/$d/${.MAKE.DEPENDFILE_PREFIX:T}.$m):?$d.$m:}@}@} | |||||
.undef ALL_MACHINES | |||||
PKG_MACHINE_LIST ?= ${DIRDEPS:E:O:u} | |||||
.elif empty(REQUESTED_MACHINE) | |||||
# the above may be insufficient. | |||||
# some packages only support one machine which may not be ${MACHINE} | |||||
# some support multiple, in which case unless ALL_MACHINES is defined | |||||
# we only want ${MACHINE} | |||||
plain := ${DIRDEPS:@d@${exists(${SRCTOP}/$d/${.MAKE.DEPENDFILE_PREFIX:T}):?$d:}@} | |||||
.if ${plain} != ${DIRDEPS} | |||||
qual := ${DIRDEPS:${plain:${M_ListToSkip}}:@d@${all_machine_list:O:u:@m@${exists(${SRCTOP}/$d/${.MAKE.DEPENDFILE_PREFIX:T}.$m):?$d.$m:}@}@} | |||||
DIRDEPS := ${plain} ${qual} | |||||
PKG_MACHINE_LIST ?= ${MACHINE} ${qual:E:O:u} | |||||
.endif | |||||
.else | |||||
# check that a .MAKE.DEPENDFILE exists | |||||
DIRDEPS := ${.MAKE.DEPENDFILE_PREFERENCE:T:@m@${DIRDEPS:@d@${exists(${SRCTOP}/$d/$m):?$d:}@}@:O:u} | |||||
.endif | |||||
.if !empty(PKG_MACHINE_LIST) | |||||
.if ${PKG_MACHINE_LIST:Mdepend} != "" | |||||
PKG_MACHINE_LIST = ${ALL_MACHINE_LIST} | |||||
.endif | |||||
PKG_MACHINE_LIST := ${PKG_MACHINE_LIST} | |||||
.endif | |||||
.endif | |||||
# we don't use DIRDEPS_FILTER, since we only want it to | |||||
# apply to this initial list | |||||
.if !empty(REQUESTED_MACHINE) && !empty(DIRDEPS) | |||||
# this is a variant of the logic above, we want plain | |||||
# but need to filter the qualified DIRDEPS to REQUESTED_MACHINE | |||||
plain := ${DIRDEPS:@d@${exists(${SRCTOP}/$d/${.MAKE.DEPENDFILE_PREFIX:T}):?$d:}@} | |||||
.if !empty(plain) && ${plain} != ${DIRDEPS} | |||||
qual := ${DIRDEPS:${plain:${M_ListToSkip}}:M*.${REQUESTED_MACHINE}} | |||||
.if empty(qual) | |||||
qual := ${DIRDEPS:@d@${exists(${SRCTOP}/$d/${.MAKE.DEPENDFILE:T}):?$d.${.MAKE.DEPENDFILE:E}:}@} | |||||
.endif | |||||
DIRDEPS := ${plain} ${qual} | |||||
.endif | |||||
.if empty(DIRDEPS) | |||||
.error ${REQUESTED_MACHINE} is not appropriate for ${.TARGETS} | |||||
.endif | |||||
.endif | |||||
.if !empty(build_options) | .if !empty(build_options) | ||||
build_options := ${build_options:O:u} | build_options := ${build_options:O:u} | ||||
.for v in ${build_options} | .for v in ${build_options} | ||||
$v = yes | $v = yes | ||||
.endfor | .endfor | ||||
.export ${build_options} | .export ${build_options} | ||||
.endif | .endif | ||||
# this does the work | |||||
.include <dirdeps-targets.mk> | |||||
.if !empty(DIRDEPS) | .if !empty(DIRDEPS) | ||||
# This is printed as we read the makefile | # This is printed as we read the makefile | ||||
# so provides a useful clue as to when we really started. | # so provides a useful clue as to when we really started. | ||||
# This allows us to work out how long reading | # This allows us to work out how long reading | ||||
# Makefile.depend* takes. | # Makefile.depend* takes. | ||||
.if ${.MAKEFLAGS:M-V} == "" | .if ${.MAKEFLAGS:M-V} == "" | ||||
.if ${BUILD_DIRDEPS_CACHE:Uno} == "no" | .if ${BUILD_DIRDEPS_CACHE:Uno} == "no" | ||||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |