2002-04-06 17:33:46 +04:00
|
|
|
# $NetBSD: Makefile,v 1.47 2002/04/06 13:33:46 bjh21 Exp $
|
2001-08-14 15:01:55 +04:00
|
|
|
|
2001-09-22 08:15:19 +04:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
2002-01-01 01:35:41 +03:00
|
|
|
# XXX We can't currently build the toolchain for x86-64.
|
|
|
|
.if ${MACHINE_ARCH} != "x86_64"
|
2002-04-02 02:03:46 +04:00
|
|
|
TOOLCHAIN_BITS= toolchain .WAIT dbsym mdsetimage
|
2002-01-29 13:20:28 +03:00
|
|
|
.endif
|
|
|
|
|
2001-11-13 02:16:17 +03:00
|
|
|
# Dependencies in SUBDIR below ordered to maximize parallel ability.
|
2001-11-02 08:07:22 +03:00
|
|
|
.if !defined(NOSUBDIR)
|
2002-01-10 20:04:20 +03:00
|
|
|
SUBDIR= host-mkdep .WAIT compat .WAIT \
|
2001-11-13 02:16:17 +03:00
|
|
|
binstall .WAIT \
|
2002-02-01 01:43:33 +03:00
|
|
|
cap_mkdb crunchgen ctags gencat lint lint2 lorder \
|
|
|
|
m4 makewhatis mkdep mtree rpcgen tsort uudecode \
|
|
|
|
texinfo .WAIT \
|
2001-11-13 02:16:17 +03:00
|
|
|
yacc .WAIT \
|
|
|
|
lex .WAIT \
|
2002-02-01 01:43:33 +03:00
|
|
|
${TOOLCHAIN_BITS} \
|
2002-04-03 10:03:35 +04:00
|
|
|
asn1_compile cksum compile_et config installboot lint1 \
|
2002-04-01 17:54:00 +04:00
|
|
|
makefs menuc mklocale msgc pax pwd_mkdb zic
|
2001-12-12 00:17:56 +03:00
|
|
|
|
2002-03-07 21:57:18 +03:00
|
|
|
.if ${MKMAN} != "no"
|
|
|
|
SUBDIR+= groff
|
|
|
|
.endif
|
|
|
|
|
2001-12-12 00:17:56 +03:00
|
|
|
.if ${MKMAINTAINERTOOLS:Uno} != "no"
|
2002-02-26 21:14:40 +03:00
|
|
|
SUBDIR+= autoconf gettext
|
2001-12-12 00:17:56 +03:00
|
|
|
.endif
|
2002-01-05 10:03:30 +03:00
|
|
|
|
|
|
|
.if ${MACHINE} == sparc || ${MACHINE} == sparc64
|
|
|
|
SUBDIR+= sparc-installboot
|
|
|
|
.endif
|
2002-02-24 00:32:27 +03:00
|
|
|
|
|
|
|
.if (${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb")
|
|
|
|
SUBDIR+= mips-elf2ecoff
|
|
|
|
.endif
|
|
|
|
|
2001-11-02 08:07:22 +03:00
|
|
|
.endif
|
2001-08-14 15:01:55 +04:00
|
|
|
|
2001-11-22 03:13:10 +03:00
|
|
|
.if ${MKTOOLS:Uyes} == "no" || ${USETOOLS} != "yes"
|
2001-11-13 19:17:24 +03:00
|
|
|
realall install: _warn
|
2001-11-22 22:09:42 +03:00
|
|
|
.if ${MKTOOLS:Uyes} == "no"
|
2001-11-13 19:17:24 +03:00
|
|
|
_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'
|
2001-12-29 18:45:52 +03:00
|
|
|
@echo '*** in version skew and build errors over time!'
|
2001-11-22 03:13:10 +03:00
|
|
|
.else
|
|
|
|
_warn:
|
|
|
|
.endif
|
2001-11-13 19:17:24 +03:00
|
|
|
|
|
|
|
.for dir in ${SUBDIR:N.WAIT}
|
|
|
|
all-${dir} depend-${dir} dependall-${dir} install-${dir}:
|
|
|
|
@true
|
|
|
|
.endfor
|
|
|
|
.endif
|
|
|
|
|
2001-08-14 15:01:55 +04:00
|
|
|
.include <bsd.subdir.mk>
|
2001-10-31 04:20:09 +03:00
|
|
|
.include <bsd.obj.mk>
|
2001-10-31 20:46:08 +03:00
|
|
|
|
2002-03-07 22:12:33 +03:00
|
|
|
# For each .WAIT point, make sure the immediately preceding target is
|
|
|
|
# installed before building anything after that point.
|
2002-02-18 18:35:53 +03:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
# Also, since we're now mixing `install' with `all' and `depend' targets
|
|
|
|
# an order relationship between those in each individual subdirectory
|
|
|
|
# must be established.
|
|
|
|
#
|
2002-03-07 22:12:33 +03:00
|
|
|
_deps:=
|
|
|
|
_prev:=
|
|
|
|
|
2001-11-13 02:16:17 +03:00
|
|
|
.for d in ${SUBDIR}
|
|
|
|
_this:= ${d}
|
2002-03-07 22:12:33 +03:00
|
|
|
|
2001-11-13 02:16:17 +03:00
|
|
|
.if ${_this} == ".WAIT"
|
2002-02-18 18:35:53 +03:00
|
|
|
|
|
|
|
# setup dependency to apply to all/depend targets in the next group
|
2002-03-07 22:12:33 +03:00
|
|
|
_deps:= ${_deps} ${_prev:S/^/install-/}
|
|
|
|
|
|
|
|
# if we're building *only* individual targets (i.e. "dependall-yacc"),
|
|
|
|
# make sure prerequisite tools build before installing
|
|
|
|
.if !make(all) && !make(dependall)
|
|
|
|
install-${_prev}: dependall-${_prev}
|
|
|
|
.endif
|
2002-02-18 18:35:53 +03:00
|
|
|
|
2001-11-13 02:16:17 +03:00
|
|
|
.else
|
2002-02-18 18:35:53 +03:00
|
|
|
|
|
|
|
# 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}
|
2002-03-07 22:12:33 +03:00
|
|
|
|
|
|
|
# make all/depend-${d} dependent on list of install targets
|
|
|
|
depend-${d} all-${d} dependall-${d}: ${_deps}
|
2002-02-18 18:35:53 +03:00
|
|
|
|
2001-11-13 02:16:17 +03:00
|
|
|
.endif
|
2002-03-07 22:12:33 +03:00
|
|
|
|
|
|
|
# stash current name in case the next entry is .WAIT
|
|
|
|
_prev:= ${d}
|
2001-11-13 02:16:17 +03:00
|
|
|
.endfor
|
|
|
|
|
2001-10-31 20:46:08 +03:00
|
|
|
cleantools:
|
|
|
|
rm -r -f tools.${HOST_OSTYPE}
|