Home | History | Annotate | Line # | Download | only in tools
Makefile revision 1.58
      1 #	$NetBSD: Makefile,v 1.58 2002/09/17 23:18:26 thorpej Exp $
      2 
      3 .include <bsd.own.mk>
      4 
      5 .if !defined(TOOLCHAIN_MISSING)
      6 TOOLCHAIN_BITS= toolchain .WAIT dbsym mdsetimage
      7 # XXX Eventually, we want to be able to build dbsym and mdsetimage
      8 # XXX if EXTERNAL_TOOLCHAIN is set.
      9 .endif
     10 
     11 # Dependencies in SUBDIR below ordered to maximize parallel ability.
     12 .if !defined(NOSUBDIR)					# {
     13 
     14 SUBDIR=	host-mkdep .WAIT compat .WAIT \
     15 	binstall .WAIT mktemp .WAIT \
     16 		cap_mkdb crunchgen ctags gencat lint lint2 lorder \
     17 		m4 makewhatis mkdep mtree rpcgen tsort uudecode \
     18 	texinfo .WAIT \
     19 	yacc .WAIT \
     20 	lex .WAIT \
     21 	${TOOLCHAIN_BITS} \
     22 		asn1_compile cat cksum compile_et config installboot lint1 \
     23 		makefs menuc mklocale msgc pax pwd_mkdb zic
     24 
     25 .if ${MKMAN} != "no"
     26 SUBDIR+=	groff
     27 .endif
     28 
     29 .if ${MKMAINTAINERTOOLS:Uno} != "no"
     30 SUBDIR+=	autoconf gettext
     31 .endif
     32 
     33 .if ${MACHINE} == prep
     34 SUBDIR+=	prep-mkbootimage
     35 .endif
     36 
     37 .if (${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb")
     38 SUBDIR+=	mips-elf2ecoff
     39 .endif
     40 
     41 .if (${MACHINE} == "sparc" || ${MACHINE} == "sparc64")
     42 SUBDIR+=	fgen
     43 .endif
     44 
     45 .endif	# ! NOSUBDIR					# }
     46 
     47 .if ${MKTOOLS:Uyes} == "no" || ${USETOOLS} != "yes"
     48 realall install: _warn
     49 .if ${MKTOOLS:Uyes} == "no"
     50 _warn:
     51 	@echo '*** WARNING: "MKTOOLS" is set to "no"; this will prevent building and'
     52 	@echo '*** updating your host toolchain.  This should be used only as a'
     53 	@echo '*** temporary workaround for toolchain problems, as it will result'
     54 	@echo '*** in version skew and build errors over time!'
     55 .else
     56 _warn:
     57 .endif
     58 
     59 .for dir in ${SUBDIR:N.WAIT}
     60 all-${dir} depend-${dir} dependall-${dir} install-${dir}:
     61 	@true
     62 .endfor
     63 .endif
     64 
     65 .include <bsd.subdir.mk>
     66 .include <bsd.obj.mk>
     67 
     68 # For each .WAIT point, make sure the immediately preceding target is
     69 # installed before building anything after that point.
     70 #
     71 # We use the "internal" targets and dependencies generated by <bsd.subdir.mk>
     72 # to achieve this. These targets look like:
     73 #	subdir-all:	all-dir1     [.WAIT] all-dir2     etc..
     74 #	subdir-install:	install-dir1 [.WAIT] install-dir2 etc..
     75 # and so on for each element in ${TARGETS}, with .WAIT sources inserted at
     76 # places corresponding to the .WAITs in our $SUBDIR variable.
     77 #
     78 # Also, since we're now mixing `install' with `all' and `depend' targets
     79 # an order relationship between those in each individual subdirectory
     80 # must be established.
     81 #
     82 _deps:=
     83 _prev:=
     84 
     85 .for d in ${SUBDIR}
     86 _this:=		${d}
     87 
     88 .if ${_this} == ".WAIT"
     89 
     90 # setup dependency to apply to all/depend targets in the next group
     91 _deps:=		${_deps} ${_prev:S/^/install-/}
     92 
     93 # if we're building *only* individual targets (i.e. "dependall-yacc"),
     94 # make sure prerequisite tools build before installing
     95 .if !make(all) && !make(dependall)
     96 install-${_prev}: dependall-${_prev}
     97 .endif
     98 
     99 .else
    100 
    101 # order depend/all/install targets for ${d} subdir.  Note the additional
    102 # .WAIT to achieve "closure" of the predecessor/successor relationships.
    103 .ORDER: depend-${d} all-${d} dependall-${d} .WAIT install-${d}
    104 
    105 # make all/depend-${d} dependent on list of install targets
    106 depend-${d} all-${d} dependall-${d}: ${_deps}
    107 
    108 .endif
    109 
    110 # stash current name in case the next entry is .WAIT
    111 _prev:=		${d}
    112 .endfor
    113 
    114 cleantools:
    115 	rm -r -f tools.${HOST_OSTYPE}
    116