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