Home | History | Annotate | Line # | Download | only in tools
Makefile revision 1.92
      1  1.92       jmc #	$NetBSD: Makefile,v 1.92 2005/10/04 04:27:32 jmc Exp $
      2   1.1        tv 
      3   1.3        tv .include <bsd.own.mk>
      4   1.3        tv 
      5  1.81     lukem .if ${TOOLCHAIN_MISSING} == "no"
      6  1.77       mrg TOOLCHAIN_BITS= binutils .WAIT
      7  1.70       mrg .  if ${USE_TOOLS_TOOLCHAIN} != "yes"
      8  1.77       mrg TOOLCHAIN_BITS+= gcc
      9  1.74        cl .    if ${MKCROSSGDB:Uno} != "no"
     10  1.74        cl TOOLCHAIN_BITS+= gdb
     11  1.74        cl .    endif
     12  1.70       mrg .  else
     13  1.77       mrg TOOLCHAIN_BITS+= toolchain
     14  1.70       mrg .  endif
     15  1.70       mrg TOOLCHAIN_BITS+= .WAIT dbsym mdsetimage
     16  1.58   thorpej # XXX Eventually, we want to be able to build dbsym and mdsetimage
     17  1.58   thorpej # XXX if EXTERNAL_TOOLCHAIN is set.
     18  1.31        tv .endif
     19  1.31        tv 
     20  1.16        tv # Dependencies in SUBDIR below ordered to maximize parallel ability.
     21  1.50     lukem .if !defined(NOSUBDIR)					# {
     22  1.50     lukem 
     23  1.29        tv SUBDIR=	host-mkdep .WAIT compat .WAIT \
     24  1.57     chris 	binstall .WAIT mktemp .WAIT \
     25  1.89   thorpej 		cap_mkdb crunchgen ctags genassym gencat hexdump lint lint2 \
     26  1.89   thorpej 		lorder m4 makewhatis mkdep mtree rpcgen tsort uudecode \
     27  1.32        tv 	texinfo .WAIT \
     28  1.16        tv 	yacc .WAIT \
     29  1.16        tv 	lex .WAIT \
     30  1.32        tv 	${TOOLCHAIN_BITS} \
     31  1.90    dyoung 		asn1_compile cat cksum compile_et config db \
     32  1.91    dyoung 		file lint1 \
     33  1.90    dyoung 		makefs menuc mkcsmapper mkesdb mklocale mknod msgc \
     34  1.90    dyoung 		pax .WAIT \
     35  1.92       jmc 		disklabel .WAIT \
     36  1.92       jmc 		fdisk .WAIT \
     37  1.92       jmc 		installboot .WAIT \
     38  1.68     lukem 		pwd_mkdb stat sunlabel zic
     39  1.39        tv 
     40  1.39        tv .if ${MKMAN} != "no"
     41  1.39        tv SUBDIR+=	groff
     42  1.39        tv .endif
     43  1.22        tv 
     44  1.22        tv .if ${MKMAINTAINERTOOLS:Uno} != "no"
     45  1.38        tv SUBDIR+=	autoconf gettext
     46  1.72      matt .endif
     47  1.72      matt 
     48  1.86       jmc .if ${MACHINE} == "hp700"
     49  1.83     skrll SUBDIR+=	hp700-mkboot
     50  1.83     skrll .endif
     51  1.83     skrll 
     52  1.86       jmc .if ${MACHINE} == "ibmnws"
     53  1.72      matt SUBDIR+=	ibmnws-ncdcs
     54  1.79      matt .endif
     55  1.79      matt 
     56  1.86       jmc .if ${MACHINE} == "macppc"
     57  1.79      matt SUBDIR+=	macppc-fixcoff
     58  1.48    kleink .endif
     59  1.48    kleink 
     60  1.86       jmc .if ${MACHINE} == "prep"
     61  1.48    kleink SUBDIR+=	prep-mkbootimage
     62  1.22        tv .endif
     63  1.37  gmcgarry 
     64  1.37  gmcgarry .if (${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb")
     65  1.37  gmcgarry SUBDIR+=	mips-elf2ecoff
     66  1.76    sekiya .endif
     67  1.76    sekiya 
     68  1.76    sekiya .if (${MACHINE} == "sgimips")
     69  1.76    sekiya SUBDIR+=	sgivol
     70  1.51     bjh21 .endif
     71  1.51     bjh21 
     72  1.82       abs .if ${MACHINE} == "acorn32"
     73  1.82       abs SUBDIR+=	sparkcrc
     74  1.82       abs .endif
     75  1.82       abs 
     76  1.51     bjh21 .if (${MACHINE} == "sparc" || ${MACHINE} == "sparc64")
     77  1.51     bjh21 SUBDIR+=	fgen
     78  1.37  gmcgarry .endif
     79  1.37  gmcgarry 
     80  1.84       jmc .if ${MACHINE} == "bebox"
     81  1.84       jmc SUBDIR+=	bebox-elf2pef
     82  1.84       jmc SUBDIR+=	bebox-mkbootimage
     83  1.84       jmc .endif
     84  1.84       jmc 
     85  1.85       jmc .if ${MACHINE} == "amiga"
     86  1.85       jmc SUBDIR+=	amiga-elf2bb
     87  1.85       jmc SUBDIR+=	amiga-txlt
     88  1.85       jmc .endif
     89  1.85       jmc 
     90  1.86       jmc .if ${MACHINE} == "hp300"
     91  1.86       jmc SUBDIR+=	hp300-mkboot
     92  1.86       jmc .endif
     93  1.86       jmc 
     94  1.50     lukem .endif	# ! NOSUBDIR					# }
     95  1.17        tv 
     96  1.66     lukem check_MKTOOLS: .PHONY .NOTMAIN
     97  1.19       jmc .if ${MKTOOLS:Uyes} == "no"
     98  1.17        tv 	@echo '*** WARNING: "MKTOOLS" is set to "no"; this will prevent building and'
     99  1.17        tv 	@echo '*** updating your host toolchain.  This should be used only as a'
    100  1.17        tv 	@echo '*** temporary workaround for toolchain problems, as it will result'
    101  1.23       wiz 	@echo '*** in version skew and build errors over time!'
    102  1.18       jmc .endif
    103  1.17        tv 
    104  1.66     lukem .if ${MKTOOLS:Uyes} == "no" || ${USETOOLS} != "yes"	# {
    105  1.67     lukem realall realdepend install: check_MKTOOLS
    106  1.66     lukem 
    107  1.17        tv .for dir in ${SUBDIR:N.WAIT}
    108  1.17        tv all-${dir} depend-${dir} dependall-${dir} install-${dir}:
    109  1.17        tv 	@true
    110  1.17        tv .endfor
    111  1.66     lukem .endif							# }
    112   1.1        tv 
    113   1.1        tv .include <bsd.subdir.mk>
    114  1.11        tv .include <bsd.obj.mk>
    115  1.16        tv 
    116  1.66     lukem .if exists(PREVIOUSTOOLDIR)
    117  1.66     lukem PREVIOUSTOOLDIR!=	cat PREVIOUSTOOLDIR
    118  1.66     lukem .else
    119  1.66     lukem PREVIOUSTOOLDIR=	
    120  1.66     lukem .endif
    121  1.66     lukem 
    122  1.66     lukem CLEANFILES+=	PREVIOUSTOOLDIR
    123  1.66     lukem 
    124  1.67     lukem realall realdepend:
    125  1.87   mycroft .if "${PREVIOUSTOOLDIR}" != "${TOOLDIR}"
    126  1.66     lukem 	@echo "*** WARNING: TOOLDIR has moved?"
    127  1.66     lukem 	@echo "*** PREVIOUSTOOLDIR '${PREVIOUSTOOLDIR}'"
    128  1.66     lukem 	@echo "***     !=  TOOLDIR '${TOOLDIR}'"
    129  1.66     lukem 	@echo "*** Cleaning mis-matched tools"
    130  1.66     lukem 	rm -f PREVIOUSTOOLDIR
    131  1.78     lukem 	(cd ${.CURDIR} && ${MAKE} cleandir)
    132  1.66     lukem .endif
    133  1.66     lukem 	echo ${TOOLDIR} > PREVIOUSTOOLDIR
    134  1.66     lukem 
    135  1.40        tv # For each .WAIT point, make sure the immediately preceding target is
    136  1.40        tv # installed before building anything after that point.
    137  1.36        pk #
    138  1.36        pk # We use the "internal" targets and dependencies generated by <bsd.subdir.mk>
    139  1.36        pk # to achieve this. These targets look like:
    140  1.36        pk #	subdir-all:	all-dir1     [.WAIT] all-dir2     etc..
    141  1.36        pk #	subdir-install:	install-dir1 [.WAIT] install-dir2 etc..
    142  1.36        pk # and so on for each element in ${TARGETS}, with .WAIT sources inserted at
    143  1.36        pk # places corresponding to the .WAITs in our $SUBDIR variable.
    144  1.36        pk #
    145  1.36        pk # Also, since we're now mixing `install' with `all' and `depend' targets
    146  1.36        pk # an order relationship between those in each individual subdirectory
    147  1.36        pk # must be established.
    148  1.36        pk #
    149  1.40        tv _deps:=
    150  1.40        tv _prev:=
    151  1.40        tv 
    152  1.16        tv .for d in ${SUBDIR}
    153  1.16        tv _this:=		${d}
    154  1.40        tv 
    155  1.16        tv .if ${_this} == ".WAIT"
    156  1.36        pk 
    157  1.36        pk # setup dependency to apply to all/depend targets in the next group
    158  1.40        tv _deps:=		${_deps} ${_prev:S/^/install-/}
    159  1.40        tv 
    160  1.40        tv # if we're building *only* individual targets (i.e. "dependall-yacc"),
    161  1.40        tv # make sure prerequisite tools build before installing
    162  1.40        tv .if !make(all) && !make(dependall)
    163  1.40        tv install-${_prev}: dependall-${_prev}
    164  1.40        tv .endif
    165  1.36        pk 
    166  1.16        tv .else
    167  1.36        pk 
    168  1.36        pk # order depend/all/install targets for ${d} subdir.  Note the additional
    169  1.36        pk # .WAIT to achieve "closure" of the predecessor/successor relationships.
    170  1.36        pk .ORDER: depend-${d} all-${d} dependall-${d} .WAIT install-${d}
    171  1.40        tv 
    172  1.40        tv # make all/depend-${d} dependent on list of install targets
    173  1.40        tv depend-${d} all-${d} dependall-${d}: ${_deps}
    174  1.36        pk 
    175  1.16        tv .endif
    176  1.40        tv 
    177  1.40        tv # stash current name in case the next entry is .WAIT
    178  1.40        tv _prev:=		${d}
    179  1.16        tv .endfor
    180  1.69      tron 
    181  1.69      tron cleandir:
    182  1.69      tron 	rm -f ${CLEANFILES}
    183