2002-09-14 22:00:22 +04:00
|
|
|
# $NetBSD: Makefile,v 1.56 2002/09/14 18:00:22 thorpej Exp $
|
2001-08-14 15:01:55 +04:00
|
|
|
|
2001-09-22 08:15:19 +04:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
2002-06-12 23:09:37 +04:00
|
|
|
# XXX We can't currently build the toolchain for hppa, ns32k, or x86-64.
|
|
|
|
# XXX In theory, we could use in-tree BFD for hppa. Explore that later.
|
2002-06-12 23:59:55 +04:00
|
|
|
.if ${MACHINE_ARCH} != "hppa" && ${MACHINE_ARCH} != "ns32k" && \
|
2002-06-12 23:09:37 +04:00
|
|
|
${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.
|
2002-05-18 09:59:23 +04:00
|
|
|
.if !defined(NOSUBDIR) # {
|
|
|
|
|
2002-01-10 20:04:20 +03:00
|
|
|
SUBDIR= host-mkdep .WAIT compat .WAIT \
|
2002-09-14 22:00:22 +04:00
|
|
|
binstall mktemp .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-06-10 22:32:28 +04:00
|
|
|
asn1_compile cat 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
|
|
|
|
2002-05-04 00:35:46 +04:00
|
|
|
.if ${MACHINE} == prep
|
|
|
|
SUBDIR+= prep-mkbootimage
|
|
|
|
.endif
|
|
|
|
|
2002-02-24 00:32:27 +03:00
|
|
|
.if (${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb")
|
|
|
|
SUBDIR+= mips-elf2ecoff
|
|
|
|
.endif
|
|
|
|
|
2002-05-29 01:56:05 +04:00
|
|
|
.if (${MACHINE} == "sparc" || ${MACHINE} == "sparc64")
|
|
|
|
SUBDIR+= fgen
|
|
|
|
.endif
|
|
|
|
|
2002-05-18 09:59:23 +04:00
|
|
|
.endif # ! NOSUBDIR # }
|
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}
|