2012-11-09 05:44:34 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
# Makefile.xtras - non-build targets
|
|
|
|
|
|
|
|
# Resist the urge to fill this with miscellaneous junk
|
|
|
|
|
|
|
|
# We are not building here (shouldn't be), so no meta mode.
|
|
|
|
.MAKE.MODE = normal
|
|
|
|
|
|
|
|
_here := ${_PARSEDIR}
|
|
|
|
|
|
|
|
.MAIN: no-default
|
|
|
|
|
2015-05-29 06:44:09 +00:00
|
|
|
.if !empty(SB_NAME)
|
|
|
|
# mk wrapper
|
|
|
|
MAKE_CMD= mk
|
|
|
|
MAKE_MACHINE_CMD= mk --machine <machine>
|
|
|
|
.else
|
|
|
|
# not using 'mk'
|
|
|
|
MAKE_CMD= ${.MAKE:T}
|
|
|
|
MAKE_MACHINE_CMD= env MACHINE=<machine> ${.MAKE:T}
|
|
|
|
.endif
|
|
|
|
|
2012-11-09 05:44:34 +00:00
|
|
|
no-default:
|
|
|
|
@echo "ERROR: there is no supported default target."; \
|
2015-05-29 06:44:09 +00:00
|
|
|
echo "Try '${MAKE_CMD} help'"
|
2012-11-09 05:44:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
.if make(show-valid-targets)
|
|
|
|
OTHER_TARGETS = \
|
|
|
|
destroy \
|
2016-02-24 17:20:28 +00:00
|
|
|
destroy-arch \
|
|
|
|
destroy-host \
|
|
|
|
destroy-stage \
|
2012-11-09 05:44:34 +00:00
|
|
|
|
2016-03-30 18:55:58 +00:00
|
|
|
BUILD_TARGETS_${MACHINE:tu} != cd ${_here} && \
|
2012-11-09 05:44:34 +00:00
|
|
|
find . \( -name Makefile.depend -o -name ${.MAKE.DEPENDFILE:T} \) | \
|
|
|
|
sed 's,/Makefile.*,,;s,^./,,' | sort -u
|
|
|
|
|
2016-03-30 18:55:58 +00:00
|
|
|
.for _machine in ${all_machine_list}
|
|
|
|
_targets_${_machine} != cd ${_here} && \
|
|
|
|
find . \( -name Makefile.depend.${_machine} -o \
|
|
|
|
-name ${.MAKE.DEPENDFILE:T}.${_machine} \) | \
|
2016-03-30 18:39:41 +00:00
|
|
|
sed 's,/Makefile.*,,;s,^./,,' | sort -u
|
2016-03-30 18:55:58 +00:00
|
|
|
BUILD_TARGETS_${_machine:tu} += ${_targets_${_machine}}
|
|
|
|
.endfor
|
2016-03-30 18:39:41 +00:00
|
|
|
|
2012-11-09 05:44:34 +00:00
|
|
|
show-valid-targets:
|
2016-03-30 18:55:58 +00:00
|
|
|
.for _machine in ${all_machine_list:O}
|
|
|
|
.if !empty(BUILD_TARGETS_${_machine:tu})
|
|
|
|
@echo "Build targets for ${_machine} (leave out the ${target_dirs:S,${_here:T},,:S,^/,,:S,$,/,}):"
|
2016-03-30 22:26:14 +00:00
|
|
|
@echo -e "${BUILD_TARGETS_${_machine:tu}:O:ts\n}" | sed -e 's,^, ,'
|
2016-03-30 18:39:41 +00:00
|
|
|
@echo
|
|
|
|
.endif
|
2016-03-30 18:55:58 +00:00
|
|
|
.endfor
|
2016-03-30 22:26:14 +00:00
|
|
|
@echo "Other targets:"; echo "${OTHER_TARGETS:O:ts\n}" | sed -e 's,^, ,'
|
2012-11-09 05:44:34 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
help: show-help
|
|
|
|
show-help:
|
|
|
|
@echo; \
|
|
|
|
echo "You can see the targets which are valid for a given machine"; \
|
2015-05-29 06:44:09 +00:00
|
|
|
echo "by running '${MAKE_MACHINE_CMD} show-valid-targets'"; \
|
2012-11-09 05:44:34 +00:00
|
|
|
echo "For other information, read: ${HELP_DOCS:@d@${.newline}$d@}"; \
|
|
|
|
echo
|
|
|
|
|
|
|
|
not-valid-target:
|
|
|
|
@echo "ERROR: '${_TARGETS}' is not a valid target for ${MACHINE}."
|
|
|
|
|
2016-02-26 22:13:45 +00:00
|
|
|
.if make(destroy*)
|
2016-02-24 17:20:25 +00:00
|
|
|
.include <bsd.obj.mk>
|
2016-02-26 22:13:45 +00:00
|
|
|
.endif
|
2012-11-09 05:44:34 +00:00
|
|
|
|
|
|
|
.for t in ${_TARGETS:Nlove}
|
|
|
|
.if !target($t)
|
|
|
|
$t: not-valid-target show-help
|
|
|
|
.endif
|
|
|
|
.endfor
|