NetBSD/tools/Makefile
tv 19ab4b257e Don't build groff if MKMAN=no. (groff does not build properly on some
platforms because of its completely insane Make structure; this allows it
to be disabled in a sane way.)
2002-03-07 18:57:18 +00:00

108 lines
3.1 KiB
Makefile

# $NetBSD: Makefile,v 1.39 2002/03/07 18:57:18 tv Exp $
# XXX Note: NO_DBSYM is a stopgap temporary variable for use
# with the development of non-NetBSD hosting support. This will go away.
.include <bsd.own.mk>
# XXX We can't currently build the toolchain for x86-64.
.if ${MACHINE_ARCH} != "x86_64"
TOOLCHAIN_BITS= toolchain .WAIT ${NO_DBSYM:D:Udbsym} mdsetimage
.endif
# Dependencies in SUBDIR below ordered to maximize parallel ability.
.if !defined(NOSUBDIR)
SUBDIR= host-mkdep .WAIT compat .WAIT \
binstall .WAIT \
cap_mkdb crunchgen ctags gencat lint lint2 lorder \
m4 makewhatis mkdep mtree rpcgen tsort uudecode \
texinfo .WAIT \
yacc .WAIT \
lex .WAIT \
${TOOLCHAIN_BITS} \
asn1_compile compile_et config lint1 \
makefs menuc mklocale msgc pax pwd_mkdb zic
.if ${MKMAN} != "no"
SUBDIR+= groff
.endif
.if ${MKMAINTAINERTOOLS:Uno} != "no"
SUBDIR+= autoconf gettext
.endif
.if ${MACHINE} == sparc || ${MACHINE} == sparc64
SUBDIR+= sparc-installboot
.endif
.if (${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb")
SUBDIR+= mips-elf2ecoff
.endif
.endif
.if ${MKTOOLS:Uyes} == "no" || ${USETOOLS} != "yes"
realall install: _warn
.if ${MKTOOLS:Uyes} == "no"
_warn:
@echo '*** WARNING: "MKTOOLS" is set to "no"; this will prevent building and'
@echo '*** updating your host toolchain. This should be used only as a'
@echo '*** temporary workaround for toolchain problems, as it will result'
@echo '*** in version skew and build errors over time!'
.else
_warn:
.endif
.for dir in ${SUBDIR:N.WAIT}
all-${dir} depend-${dir} dependall-${dir} install-${dir}:
@true
.endfor
.endif
.include <bsd.subdir.mk>
.include <bsd.obj.mk>
# For each .WAIT point, make sure the previous targets are installed before
# building a dependent target.
#
# We use the "internal" targets and dependencies generated by <bsd.subdir.mk>
# to achieve this. These targets look like:
# subdir-all: all-dir1 [.WAIT] all-dir2 etc..
# subdir-install: install-dir1 [.WAIT] install-dir2 etc..
# and so on for each element in ${TARGETS}, with .WAIT sources inserted at
# places corresponding to the .WAITs in our $SUBDIR variable.
#
# In this Makefile we want additional depencies of the `all-dirN',
# `depend-dirN' and `dependall-dirN' targets in the Nth ".WAIT group" on all
# of the `install-dir[N-1]' targets in the previous ".WAIT group".
#
# Also, since we're now mixing `install' with `all' and `depend' targets
# an order relationship between those in each individual subdirectory
# must be established.
#
_dep:=
_group:=
.for d in ${SUBDIR}
_this:= ${d}
.if ${_this} == ".WAIT"
# setup dependency to apply to all/depend targets in the next group
_dep:= ${_group:S/^/install-/}
_group:=
.else
# build the current ".WAIT group"
_group:= ${_group} ${d}
# order depend/all/install targets for ${d} subdir. Note the additional
# .WAIT to achieve "closure" of the predecessor/successor relationships.
.ORDER: depend-${d} all-${d} dependall-${d} .WAIT install-${d}
# make all/depend-${d} dependent on all install targets in the previous group
depend-${d} all-${d} dependall-${d}: ${_dep}
.endif
.endfor
cleantools:
rm -r -f tools.${HOST_OSTYPE}