Home | History | Annotate | Line # | Download | only in tools
Makefile revision 1.165
      1  1.165       apb #	$NetBSD: Makefile,v 1.165 2012/12/02 12:25:25 apb Exp $
      2    1.1        tv 
      3    1.3        tv .include <bsd.own.mk>
      4    1.3        tv 
      5  1.159     joerg # Make sure that the ordered build/install processing applies when using
      6  1.159     joerg # plain make.
      7  1.159     joerg .MAIN: build_install
      8  1.159     joerg 
      9  1.164       apb # TOOLDIR must be valid, unless MKTOOLS=no
     10  1.164       apb .if ${MKTOOLS:Uyes} != "no"
     11  1.164       apb .if "${TOOLDIR}" == ""
     12  1.164       apb .error "TOOLDIR is undefined or empty"
     13  1.164       apb .elif "${TOOLDIR:tW:M/*}" == ""
     14  1.164       apb .error "TOOLDIR is not an absolute path: ${TOOLDIR}"
     15  1.164       apb #.elif !exists(TOOLDIR) # XXX .exists fails for directories
     16  1.164       apb #.error "TOOLDIR does not exist: ${TOOLDIR}"
     17  1.164       apb .endif
     18  1.164       apb .endif # MKTOOLS != no
     19  1.164       apb 
     20  1.160     pooka .if ${TOOLCHAIN_MISSING} == "no"
     21  1.160     pooka .if defined(HAVE_GCC)
     22   1.94       jmc TOOLCHAIN_BITS= gmake .WAIT
     23  1.156     joerg .endif
     24  1.156     joerg 
     25  1.156     joerg .if defined(HAVE_GCC)
     26  1.146       mrg .if ${HAVE_GCC} >= 45
     27  1.146       mrg TOOLCHAIN_BITS+= gmp .WAIT
     28  1.146       mrg TOOLCHAIN_BITS+= mpfr .WAIT
     29  1.146       mrg TOOLCHAIN_BITS+= mpc .WAIT
     30   1.94       jmc .endif
     31  1.156     joerg .endif
     32  1.156     joerg .endif
     33  1.156     joerg 
     34  1.156     joerg .if ${TOOLCHAIN_MISSING} == "no"
     35   1.94       jmc TOOLCHAIN_BITS+= binutils .WAIT
     36  1.156     joerg .endif
     37  1.156     joerg 
     38  1.156     joerg .if defined(HAVE_GCC)
     39  1.156     joerg .if ${TOOLCHAIN_MISSING} == "no"
     40   1.77       mrg TOOLCHAIN_BITS+= gcc
     41   1.97       mrg .  if ${MKCROSSGDB:Uno} != "no"
     42   1.74        cl TOOLCHAIN_BITS+= gdb
     43   1.70       mrg .  endif
     44  1.156     joerg TOOLCHAIN_BITS+= .WAIT
     45   1.31        tv .endif
     46  1.118  gmcgarry .endif
     47  1.118  gmcgarry 
     48  1.118  gmcgarry .if defined(HAVE_PCC)
     49  1.118  gmcgarry .if ${TOOLCHAIN_MISSING} == "no"
     50  1.118  gmcgarry TOOLCHAIN_BITS+= pcc
     51  1.118  gmcgarry .endif
     52  1.118  gmcgarry .endif
     53   1.31        tv 
     54  1.157     pooka .if ${TOOLCHAIN_MISSING} == "no"
     55  1.157     pooka # XXX Eventually, we want to be able to build dbsym and mdsetimage
     56  1.157     pooka # XXX if EXTERNAL_TOOLCHAIN is set.
     57  1.156     joerg TOOLCHAIN_BITS+= dbsym mdsetimage
     58  1.157     pooka .endif
     59  1.156     joerg 
     60  1.137    darran DTRACE_BITS=
     61  1.137    darran .if ${MKDTRACE} != "no"
     62  1.137    darran DTRACE_BITS+= .WAIT libelf
     63  1.137    darran DTRACE_BITS+= .WAIT libdwarf
     64  1.162       apb DTRACE_BITS+= .WAIT libctf
     65  1.137    darran DTRACE_BITS+= .WAIT ctfconvert ctfmerge
     66  1.137    darran .endif
     67  1.137    darran 
     68   1.99       mrg LINT_BITS=
     69   1.99       mrg .if ${MKLINT} != "no"
     70   1.99       mrg LINT_BITS= lint lint2
     71   1.99       mrg .endif
     72   1.99       mrg 
     73  1.165       apb # All of host-mkdep, compat, and binstall are needed before anything
     74  1.165       apb # else.  Within this group, they must be built in a specific order, and
     75  1.165       apb # all of them must be built before any of them is installed.  They may
     76  1.165       apb # be installed in any order.  This can't be expressed using the .WAIT
     77  1.165       apb # notation inside the SUBDIR list.
     78  1.165       apb #
     79  1.165       apb # XXX .ORDER does not work when multiple targets are passed on the
     80  1.165       apb # make command line without "-j", so use dependencies in addition to .ORDER.
     81  1.165       apb #
     82  1.165       apb .ORDER: dependall-host-mkdep dependall-compat dependall-binstall
     83  1.165       apb .if make(dependall-host-mkdep) && make(dependall-compat)
     84  1.165       apb dependall-compat: dependall-host-mkdep
     85  1.165       apb .endif
     86  1.165       apb .if make(dependall-compat) && make(dependall-binstall)
     87  1.165       apb dependall-binstall: dependall-compat
     88  1.165       apb .endif
     89  1.165       apb 
     90   1.16        tv # Dependencies in SUBDIR below ordered to maximize parallel ability.
     91  1.165       apb # See above for special treatment for host-mkdep, compat, and binstall.
     92  1.165       apb #
     93  1.165       apb SUBDIR=	host-mkdep compat binstall \
     94  1.165       apb 	.WAIT mktemp .WAIT sed .WAIT \
     95  1.113       apb 		cap_mkdb crunchgen ctags genassym gencat hexdump join \
     96   1.99       mrg 		${LINT_BITS} \
     97  1.152      yamt 		lorder makewhatis mkdep mtree nbperf .WAIT rpcgen tsort \
     98  1.134       roy 		uudecode m4 \
     99  1.132       mrg 	.WAIT texinfo \
    100  1.132       mrg 	.WAIT yacc \
    101  1.132       mrg 	.WAIT awk \
    102  1.153  christos 	.WAIT tic \
    103  1.132       mrg 	.WAIT lex \
    104  1.132       mrg 	.WAIT pax \
    105  1.132       mrg 	.WAIT ${TOOLCHAIN_BITS} \
    106  1.137    darran 	${DTRACE_BITS} \
    107  1.138      jmmv 		asn1_compile cat cksum compile_et config db \
    108  1.145     elric 		file lint1 slc \
    109  1.144       riz 		makefs .WAIT menuc mkcsmapper mkesdb mklocale mknod msgc \
    110  1.132       mrg 		.WAIT disklabel \
    111  1.132       mrg 		.WAIT paxctl \
    112  1.132       mrg 		.WAIT fdisk \
    113  1.132       mrg 		.WAIT installboot \
    114  1.154     njoly 		pwd_mkdb stat strfile sunlabel zic
    115   1.39        tv 
    116  1.142     joerg .if ${MKLLVM} != "no"
    117  1.142     joerg SUBDIR+= \
    118  1.142     joerg 	llvm .WAIT \
    119  1.149     joerg 	llvm-lib/libLLVMSupport llvm-lib/libLLVMTableGen .WAIT \
    120  1.159     joerg 	llvm-tblgen llvm-clang-tblgen .WAIT \
    121  1.142     joerg 	llvm-include .WAIT \
    122  1.142     joerg 	llvm-lib .WAIT \
    123  1.142     joerg 	llvm-clang
    124  1.142     joerg .endif
    125  1.142     joerg 
    126  1.121    dyoung .if ${MKMAN} != "no" || ${MKDOC} != "no" || ${MKHTML} != "no"
    127  1.136     joerg .  if ${MKGROFF} != "no"
    128   1.39        tv SUBDIR+=	groff
    129  1.136     joerg .  endif
    130  1.128     joerg SUBDIR+=	mandoc
    131   1.39        tv .endif
    132   1.22        tv 
    133   1.22        tv .if ${MKMAINTAINERTOOLS:Uno} != "no"
    134  1.103     lukem SUBDIR+=	autoconf .WAIT gettext
    135   1.72      matt .endif
    136   1.72      matt 
    137  1.140       mrg .if ${USE_PIGZGZIP} != "no"
    138  1.140       mrg SUBDIR+=	pigz
    139  1.140       mrg .endif
    140  1.140       mrg 
    141   1.86       jmc .if ${MACHINE} == "hp700"
    142   1.83     skrll SUBDIR+=	hp700-mkboot
    143   1.83     skrll .endif
    144   1.83     skrll 
    145   1.86       jmc .if ${MACHINE} == "ibmnws"
    146   1.72      matt SUBDIR+=	ibmnws-ncdcs
    147   1.79      matt .endif
    148   1.79      matt 
    149   1.86       jmc .if ${MACHINE} == "macppc"
    150   1.79      matt SUBDIR+=	macppc-fixcoff
    151   1.48    kleink .endif
    152   1.48    kleink 
    153  1.116   garbled .if (${MACHINE} == "prep" || ${MACHINE} == "rs6000" || ${MACHINE} == "bebox")
    154  1.115   garbled SUBDIR+=	powerpc-mkbootimage
    155   1.22        tv .endif
    156   1.37  gmcgarry 
    157  1.148   tsutsui .if ${MACHINE_ARCH} == "m68k"
    158  1.148   tsutsui SUBDIR+=	m68k-elf2aout
    159  1.148   tsutsui .endif
    160  1.148   tsutsui 
    161  1.147       mrg .if (${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" || \
    162  1.147       mrg      ${MACHINE_ARCH} == "mips64el" || ${MACHINE_ARCH} == "mips64eb")
    163   1.37  gmcgarry SUBDIR+=	mips-elf2ecoff
    164   1.76    sekiya .endif
    165   1.76    sekiya 
    166   1.76    sekiya .if (${MACHINE} == "sgimips")
    167   1.76    sekiya SUBDIR+=	sgivol
    168   1.51     bjh21 .endif
    169   1.51     bjh21 
    170   1.82       abs .if ${MACHINE} == "acorn32"
    171   1.82       abs SUBDIR+=	sparkcrc
    172   1.82       abs .endif
    173   1.82       abs 
    174  1.125       abs .if (${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64")
    175   1.51     bjh21 SUBDIR+=	fgen
    176   1.37  gmcgarry .endif
    177   1.37  gmcgarry 
    178   1.85       jmc .if ${MACHINE} == "amiga"
    179   1.85       jmc SUBDIR+=	amiga-elf2bb
    180   1.85       jmc SUBDIR+=	amiga-txlt
    181   1.85       jmc .endif
    182   1.85       jmc 
    183   1.86       jmc .if ${MACHINE} == "hp300"
    184   1.86       jmc SUBDIR+=	hp300-mkboot
    185   1.86       jmc .endif
    186   1.86       jmc 
    187  1.161     jkunz .if ${MACHINE} == "evbarm" && ${MACHINE_ARCH} == "arm"
    188  1.158     jkunz SUBDIR+=	elftosb
    189  1.158     jkunz .endif
    190  1.158     jkunz 
    191  1.143       phx .if ${MACHINE} == "evbarm" || ${MACHINE} == "evbmips" || \
    192  1.143       phx     ${MACHINE} == "evbppc" || ${MACHINE} == "sandpoint"
    193  1.139  jmcneill SUBDIR+=	mkubootimage
    194  1.139  jmcneill .endif
    195  1.139  jmcneill 
    196   1.66     lukem check_MKTOOLS: .PHONY .NOTMAIN
    197   1.19       jmc .if ${MKTOOLS:Uyes} == "no"
    198   1.17        tv 	@echo '*** WARNING: "MKTOOLS" is set to "no"; this will prevent building and'
    199   1.17        tv 	@echo '*** updating your host toolchain.  This should be used only as a'
    200   1.17        tv 	@echo '*** temporary workaround for toolchain problems, as it will result'
    201   1.23       wiz 	@echo '*** in version skew and build errors over time!'
    202   1.18       jmc .endif
    203   1.17        tv 
    204   1.66     lukem .if ${MKTOOLS:Uyes} == "no" || ${USETOOLS} != "yes"	# {
    205  1.163       apb SUBDIR= # empty
    206   1.67     lukem realall realdepend install: check_MKTOOLS
    207   1.66     lukem .endif							# }
    208    1.1        tv 
    209    1.1        tv .include <bsd.subdir.mk>
    210  1.159     joerg .include <bsd.buildinstall.mk>
    211   1.11        tv .include <bsd.obj.mk>
    212   1.16        tv 
    213  1.102      tron .if !defined(PREVIOUSTOOLDIR)
    214  1.102      tron .  if exists(PREVIOUSTOOLDIR)
    215   1.66     lukem PREVIOUSTOOLDIR!=	cat PREVIOUSTOOLDIR
    216  1.102      tron .  else
    217  1.162       apb PREVIOUSTOOLDIR=
    218  1.102      tron .  endif
    219   1.66     lukem .endif
    220   1.66     lukem 
    221   1.66     lukem CLEANFILES+=	PREVIOUSTOOLDIR
    222   1.66     lukem 
    223  1.101      tron realall realdepend: .MAKE
    224  1.107       apb .if !empty(PREVIOUSTOOLDIR) && "${PREVIOUSTOOLDIR}" != "${TOOLDIR}"
    225   1.66     lukem 	@echo "*** WARNING: TOOLDIR has moved?"
    226   1.66     lukem 	@echo "*** PREVIOUSTOOLDIR '${PREVIOUSTOOLDIR}'"
    227   1.66     lukem 	@echo "***     !=  TOOLDIR '${TOOLDIR}'"
    228   1.66     lukem 	@echo "*** Cleaning mis-matched tools"
    229   1.66     lukem 	rm -f PREVIOUSTOOLDIR
    230  1.106     freza 	(cd ${.CURDIR} && ${MAKE} PREVIOUSTOOLDIR=${TOOLDIR} cleandir)
    231   1.66     lukem .endif
    232  1.102      tron 	echo ${TOOLDIR} >PREVIOUSTOOLDIR
    233   1.66     lukem 
    234   1.69      tron cleandir:
    235   1.69      tron 	rm -f ${CLEANFILES}
    236