2018-09-25 08:42:08 +03:00
|
|
|
# $NetBSD: Makefile,v 1.196 2018/09/25 05:42:08 joerg Exp $
|
2001-08-14 15:01:55 +04:00
|
|
|
|
2001-09-22 08:15:19 +04:00
|
|
|
.include <bsd.own.mk>
|
2013-02-05 11:27:02 +04:00
|
|
|
.include <bsd.endian.mk>
|
2001-09-22 08:15:19 +04:00
|
|
|
|
2012-11-16 03:51:53 +04:00
|
|
|
# Make sure that the ordered build/install processing applies when using
|
|
|
|
# plain make.
|
|
|
|
.MAIN: build_install
|
|
|
|
|
2012-12-02 16:10:43 +04:00
|
|
|
# TOOLDIR must be valid, unless MKTOOLS=no
|
|
|
|
.if ${MKTOOLS:Uyes} != "no"
|
|
|
|
.if "${TOOLDIR}" == ""
|
|
|
|
.error "TOOLDIR is undefined or empty"
|
|
|
|
.elif "${TOOLDIR:tW:M/*}" == ""
|
|
|
|
.error "TOOLDIR is not an absolute path: ${TOOLDIR}"
|
|
|
|
#.elif !exists(TOOLDIR) # XXX .exists fails for directories
|
|
|
|
#.error "TOOLDIR does not exist: ${TOOLDIR}"
|
|
|
|
.endif
|
|
|
|
.endif # MKTOOLS != no
|
|
|
|
|
2013-01-31 19:22:50 +04:00
|
|
|
# TOOLS_BUILDRUMP == yes builds only the subset of the tools required
|
|
|
|
# for building rump kernels and the hypervisor. It is typically used
|
|
|
|
# when building rump kernels targeted for non-NetBSD systems (via
|
|
|
|
# buildrump.sh), and should not be set for a regular "make build".
|
|
|
|
TOOLS_BUILDRUMP?=no
|
|
|
|
|
2012-11-26 20:57:25 +04:00
|
|
|
.if ${TOOLCHAIN_MISSING} == "no"
|
2014-08-10 09:56:36 +04:00
|
|
|
. if defined(HAVE_GCC) && ${HAVE_GCC} > 0
|
2006-03-30 01:10:52 +04:00
|
|
|
TOOLCHAIN_BITS= gmake .WAIT
|
2011-06-21 06:15:41 +04:00
|
|
|
TOOLCHAIN_BITS+= gmp .WAIT
|
|
|
|
TOOLCHAIN_BITS+= mpfr .WAIT
|
|
|
|
TOOLCHAIN_BITS+= mpc .WAIT
|
2014-06-15 00:49:36 +04:00
|
|
|
. endif
|
2012-08-10 20:13:36 +04:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if ${TOOLCHAIN_MISSING} == "no"
|
2006-03-30 01:10:52 +04:00
|
|
|
TOOLCHAIN_BITS+= binutils .WAIT
|
2012-08-10 20:13:36 +04:00
|
|
|
.endif
|
|
|
|
|
2014-08-10 09:56:36 +04:00
|
|
|
.if defined(HAVE_GCC) && ${HAVE_GCC} > 0
|
2014-06-15 00:49:36 +04:00
|
|
|
. if ${TOOLCHAIN_MISSING} == "no"
|
2003-12-04 13:08:58 +03:00
|
|
|
TOOLCHAIN_BITS+= gcc
|
2013-07-20 00:58:58 +04:00
|
|
|
. if ${MKCROSSGDB:Uno} != "no" || make(obj)
|
2003-10-26 04:06:27 +03:00
|
|
|
TOOLCHAIN_BITS+= gdb
|
2003-07-25 20:26:51 +04:00
|
|
|
. endif
|
2012-08-10 20:13:36 +04:00
|
|
|
TOOLCHAIN_BITS+= .WAIT
|
2014-06-15 00:49:36 +04:00
|
|
|
. endif
|
2008-08-24 09:53:36 +04:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(HAVE_PCC)
|
2014-06-15 00:49:36 +04:00
|
|
|
. if ${TOOLCHAIN_MISSING} == "no"
|
2008-08-24 09:53:36 +04:00
|
|
|
TOOLCHAIN_BITS+= pcc
|
2014-06-15 00:49:36 +04:00
|
|
|
. endif
|
2008-08-24 09:53:36 +04:00
|
|
|
.endif
|
2002-01-29 13:20:28 +03:00
|
|
|
|
2017-12-28 00:34:11 +03:00
|
|
|
.if ${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN)
|
2012-08-10 20:13:36 +04:00
|
|
|
TOOLCHAIN_BITS+= dbsym mdsetimage
|
2012-09-20 19:50:20 +04:00
|
|
|
.endif
|
2012-08-10 20:13:36 +04:00
|
|
|
|
2010-03-02 23:47:01 +03:00
|
|
|
DTRACE_BITS=
|
2014-04-03 22:23:38 +04:00
|
|
|
.if ${MKDTRACE} != "no" || ${MKCTF} != "no"
|
2010-03-02 23:47:01 +03:00
|
|
|
DTRACE_BITS+= .WAIT libelf
|
|
|
|
DTRACE_BITS+= .WAIT libdwarf
|
2012-12-02 15:19:45 +04:00
|
|
|
DTRACE_BITS+= .WAIT libctf
|
2014-03-25 13:52:55 +04:00
|
|
|
.endif
|
|
|
|
.if ${MKCTF} != "no"
|
2010-03-02 23:47:01 +03:00
|
|
|
DTRACE_BITS+= .WAIT ctfconvert ctfmerge
|
|
|
|
.endif
|
|
|
|
|
2006-06-23 00:03:41 +04:00
|
|
|
LINT_BITS=
|
|
|
|
.if ${MKLINT} != "no"
|
|
|
|
LINT_BITS= lint lint2
|
|
|
|
.endif
|
|
|
|
|
2012-12-02 16:25:25 +04:00
|
|
|
# All of host-mkdep, compat, and binstall are needed before anything
|
|
|
|
# else. Within this group, they must be built in a specific order, and
|
|
|
|
# all of them must be built before any of them is installed. They may
|
|
|
|
# be installed in any order. This can't be expressed using the .WAIT
|
|
|
|
# notation inside the SUBDIR list.
|
|
|
|
#
|
|
|
|
# XXX .ORDER does not work when multiple targets are passed on the
|
|
|
|
# make command line without "-j", so use dependencies in addition to .ORDER.
|
|
|
|
#
|
|
|
|
.ORDER: dependall-host-mkdep dependall-compat dependall-binstall
|
|
|
|
.if make(dependall-host-mkdep) && make(dependall-compat)
|
|
|
|
dependall-compat: dependall-host-mkdep
|
|
|
|
.endif
|
|
|
|
.if make(dependall-compat) && make(dependall-binstall)
|
|
|
|
dependall-binstall: dependall-compat
|
|
|
|
.endif
|
|
|
|
|
2001-11-13 02:16:17 +03:00
|
|
|
# Dependencies in SUBDIR below ordered to maximize parallel ability.
|
2012-12-02 16:25:25 +04:00
|
|
|
# See above for special treatment for host-mkdep, compat, and binstall.
|
|
|
|
#
|
|
|
|
SUBDIR= host-mkdep compat binstall \
|
2014-12-05 04:50:47 +03:00
|
|
|
.WAIT mktemp .WAIT sed .WAIT genassym
|
2013-01-31 19:22:50 +04:00
|
|
|
.if ${TOOLS_BUILDRUMP} == "no"
|
2014-12-05 04:50:47 +03:00
|
|
|
SUBDIR+= cap_mkdb crunchgen ctags gencat hexdump \
|
2006-06-23 00:03:41 +04:00
|
|
|
${LINT_BITS} \
|
2014-06-15 18:36:57 +04:00
|
|
|
makewhatis mtree nbperf .WAIT uudecode
|
2013-01-31 19:22:50 +04:00
|
|
|
.endif
|
|
|
|
|
2018-09-25 08:42:08 +03:00
|
|
|
SUBDIR+= cat rpcgen join lorder m4 mkdep tsort xz-include .WAIT yacc .WAIT awk .WAIT lex
|
|
|
|
SUBDIR+= grep xz-lib
|
2013-01-31 19:22:50 +04:00
|
|
|
|
|
|
|
.if ${TOOLS_BUILDRUMP} == "no"
|
|
|
|
SUBDIR += .WAIT texinfo \
|
2011-11-03 00:36:41 +04:00
|
|
|
.WAIT tic \
|
2009-12-23 23:15:21 +03:00
|
|
|
.WAIT pax \
|
|
|
|
.WAIT ${TOOLCHAIN_BITS} \
|
2010-03-02 23:47:01 +03:00
|
|
|
${DTRACE_BITS} \
|
2014-06-15 18:36:57 +04:00
|
|
|
asn1_compile cksum compile_et db \
|
2011-04-15 22:05:42 +04:00
|
|
|
file lint1 slc \
|
2015-12-19 04:10:31 +03:00
|
|
|
makefs sortinfo \
|
|
|
|
.WAIT menuc mkcsmapper mkesdb mklocale mknod msgc \
|
2014-09-30 23:38:25 +04:00
|
|
|
.WAIT disklabel gpt \
|
2009-12-23 23:15:21 +03:00
|
|
|
.WAIT paxctl \
|
|
|
|
.WAIT fdisk \
|
|
|
|
.WAIT installboot \
|
2014-07-15 17:19:44 +04:00
|
|
|
pwd_mkdb strfile sunlabel vgrind zic
|
2013-01-31 19:22:50 +04:00
|
|
|
.endif
|
2018-09-25 08:42:08 +03:00
|
|
|
SUBDIR+= stat .WAIT config xz-bin
|
2001-12-12 00:17:56 +03:00
|
|
|
|
2011-02-06 04:13:42 +03:00
|
|
|
.if ${MKLLVM} != "no"
|
|
|
|
SUBDIR+= \
|
|
|
|
llvm .WAIT \
|
2017-01-11 15:08:34 +03:00
|
|
|
llvm-lib/libLLVMDemangle llvm-lib/libLLVMSupport llvm-lib/libLLVMTableGen .WAIT \
|
2018-05-09 16:21:27 +03:00
|
|
|
llvm-tblgen llvm-clang-tblgen
|
|
|
|
.endif
|
|
|
|
.if ${MKLLVM} != "no" && !defined(EXTERNAL_TOOLCHAIN)
|
|
|
|
SUBDIR+= \
|
|
|
|
.WAIT llvm-include .WAIT \
|
2011-02-06 04:13:42 +03:00
|
|
|
llvm-lib .WAIT \
|
|
|
|
llvm-clang
|
2014-06-15 00:49:36 +04:00
|
|
|
. if ${MKLLD} != "no"
|
2013-09-02 18:34:55 +04:00
|
|
|
SUBDIR+= llvm-lld
|
2014-06-15 00:49:36 +04:00
|
|
|
. endif
|
|
|
|
. if ${MKMCLINKER} != "no"
|
2013-02-28 01:25:05 +04:00
|
|
|
SUBDIR+= llvm-mcld
|
2014-06-15 00:49:36 +04:00
|
|
|
. endif
|
2011-02-06 04:13:42 +03:00
|
|
|
.endif
|
|
|
|
|
2008-10-13 22:11:15 +04:00
|
|
|
.if ${MKMAN} != "no" || ${MKDOC} != "no" || ${MKHTML} != "no"
|
2014-06-15 00:49:36 +04:00
|
|
|
. if ${MKGROFF} != "no"
|
2002-03-07 21:57:18 +03:00
|
|
|
SUBDIR+= groff
|
2014-06-15 00:49:36 +04:00
|
|
|
. endif
|
2010-02-20 03:35:11 +03:00
|
|
|
SUBDIR+= mandoc
|
2002-03-07 21:57:18 +03:00
|
|
|
.endif
|
|
|
|
|
2013-01-31 19:22:50 +04:00
|
|
|
.if ${TOOLS_BUILDRUMP} == "no"
|
|
|
|
|
2001-12-12 00:17:56 +03:00
|
|
|
.if ${MKMAINTAINERTOOLS:Uno} != "no"
|
2006-07-18 08:24:52 +04:00
|
|
|
SUBDIR+= autoconf .WAIT gettext
|
2004-07-28 13:17:31 +04:00
|
|
|
.endif
|
|
|
|
|
2010-08-15 11:27:33 +04:00
|
|
|
.if ${USE_PIGZGZIP} != "no"
|
|
|
|
SUBDIR+= pigz
|
|
|
|
.endif
|
|
|
|
|
2014-02-24 11:23:38 +04:00
|
|
|
.if ${MACHINE} == "hppa"
|
|
|
|
SUBDIR+= hppa-mkboot
|
2001-12-12 00:17:56 +03:00
|
|
|
.endif
|
2002-01-05 10:03:30 +03:00
|
|
|
|
2004-11-28 14:14:41 +03:00
|
|
|
.if ${MACHINE} == "ibmnws"
|
2003-10-19 07:35:30 +04:00
|
|
|
SUBDIR+= ibmnws-ncdcs
|
|
|
|
.endif
|
|
|
|
|
2004-11-28 14:14:41 +03:00
|
|
|
.if ${MACHINE} == "macppc"
|
2003-12-11 03:29:33 +03:00
|
|
|
SUBDIR+= macppc-fixcoff
|
|
|
|
.endif
|
|
|
|
|
2008-05-01 01:18:17 +04:00
|
|
|
.if (${MACHINE} == "prep" || ${MACHINE} == "rs6000" || ${MACHINE} == "bebox")
|
2008-05-01 01:15:33 +04:00
|
|
|
SUBDIR+= powerpc-mkbootimage
|
2002-05-04 00:35:46 +04:00
|
|
|
.endif
|
|
|
|
|
2011-07-16 19:52:01 +04:00
|
|
|
.if ${MACHINE_ARCH} == "m68k"
|
|
|
|
SUBDIR+= m68k-elf2aout
|
|
|
|
.endif
|
|
|
|
|
2011-07-10 12:43:50 +04:00
|
|
|
.if (${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" || \
|
|
|
|
${MACHINE_ARCH} == "mips64el" || ${MACHINE_ARCH} == "mips64eb")
|
2002-02-24 00:32:27 +03:00
|
|
|
SUBDIR+= mips-elf2ecoff
|
|
|
|
.endif
|
|
|
|
|
2003-11-08 08:02:33 +03:00
|
|
|
.if (${MACHINE} == "sgimips")
|
|
|
|
SUBDIR+= sgivol
|
|
|
|
.endif
|
|
|
|
|
2004-06-09 01:44:46 +04:00
|
|
|
.if ${MACHINE} == "acorn32"
|
|
|
|
SUBDIR+= sparkcrc
|
|
|
|
.endif
|
|
|
|
|
2009-02-14 16:50:50 +03:00
|
|
|
.if (${MACHINE_ARCH} == "sparc" || ${MACHINE_ARCH} == "sparc64")
|
2002-05-29 01:56:05 +04:00
|
|
|
SUBDIR+= fgen
|
|
|
|
.endif
|
|
|
|
|
2004-11-28 10:00:52 +03:00
|
|
|
.if ${MACHINE} == "amiga"
|
|
|
|
SUBDIR+= amiga-elf2bb
|
|
|
|
SUBDIR+= amiga-txlt
|
|
|
|
.endif
|
|
|
|
|
2004-11-28 14:14:41 +03:00
|
|
|
.if ${MACHINE} == "hp300"
|
|
|
|
SUBDIR+= hp300-mkboot
|
|
|
|
.endif
|
|
|
|
|
2013-02-05 11:27:02 +04:00
|
|
|
.if ${MACHINE} == "evbarm" \
|
|
|
|
&& ${MACHINE_CPU} == "arm" \
|
|
|
|
&& ${TARGET_ENDIANNESS} == "1234"
|
2012-11-15 23:49:11 +04:00
|
|
|
SUBDIR+= elftosb
|
|
|
|
.endif
|
|
|
|
|
2011-02-26 02:29:16 +03:00
|
|
|
.if ${MACHINE} == "evbarm" || ${MACHINE} == "evbmips" || \
|
|
|
|
${MACHINE} == "evbppc" || ${MACHINE} == "sandpoint"
|
2010-06-18 22:57:27 +04:00
|
|
|
SUBDIR+= mkubootimage
|
2017-06-07 13:38:33 +03:00
|
|
|
SUBDIR+= libfdt .WAIT
|
|
|
|
SUBDIR+= dtc
|
2010-06-18 22:57:27 +04:00
|
|
|
.endif
|
|
|
|
|
2015-07-23 11:03:24 +03:00
|
|
|
.if ${MKX11} != "no"
|
2015-06-25 01:20:24 +03:00
|
|
|
SUBDIR+= makestrs
|
|
|
|
SUBDIR+= makekeys
|
2015-01-07 23:42:01 +03:00
|
|
|
.endif
|
|
|
|
|
2016-01-25 01:49:08 +03:00
|
|
|
SUBDIR+= cvslatest
|
|
|
|
|
2018-02-18 04:06:24 +03:00
|
|
|
.endif # TOOLS_BUILDRUMP != no
|
2013-01-31 19:22:50 +04:00
|
|
|
|
2003-07-16 16:57:57 +04:00
|
|
|
check_MKTOOLS: .PHONY .NOTMAIN
|
2001-11-22 22:09:42 +03:00
|
|
|
.if ${MKTOOLS:Uyes} == "no"
|
2001-11-13 19:17:24 +03:00
|
|
|
@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
|
|
|
.endif
|
2001-11-13 19:17:24 +03:00
|
|
|
|
2003-07-16 16:57:57 +04:00
|
|
|
.if ${MKTOOLS:Uyes} == "no" || ${USETOOLS} != "yes" # {
|
2012-12-02 15:46:34 +04:00
|
|
|
SUBDIR= # empty
|
2003-07-16 17:13:42 +04:00
|
|
|
realall realdepend install: check_MKTOOLS
|
2003-07-16 16:57:57 +04:00
|
|
|
.endif # }
|
2001-11-13 19:17:24 +03:00
|
|
|
|
2001-08-14 15:01:55 +04:00
|
|
|
.include <bsd.subdir.mk>
|
2012-11-16 03:51:53 +04:00
|
|
|
.include <bsd.buildinstall.mk>
|
2001-10-31 04:20:09 +03:00
|
|
|
.include <bsd.obj.mk>
|
2001-10-31 20:46:08 +03:00
|
|
|
|
2006-07-17 17:54:46 +04:00
|
|
|
.if !defined(PREVIOUSTOOLDIR)
|
|
|
|
. if exists(PREVIOUSTOOLDIR)
|
2003-07-16 16:57:57 +04:00
|
|
|
PREVIOUSTOOLDIR!= cat PREVIOUSTOOLDIR
|
2006-07-17 17:54:46 +04:00
|
|
|
. else
|
2012-12-02 15:19:45 +04:00
|
|
|
PREVIOUSTOOLDIR=
|
2006-07-17 17:54:46 +04:00
|
|
|
. endif
|
2003-07-16 16:57:57 +04:00
|
|
|
.endif
|
|
|
|
|
|
|
|
CLEANFILES+= PREVIOUSTOOLDIR
|
|
|
|
|
2006-07-17 15:02:02 +04:00
|
|
|
realall realdepend: .MAKE
|
2006-10-08 19:21:00 +04:00
|
|
|
.if !empty(PREVIOUSTOOLDIR) && "${PREVIOUSTOOLDIR}" != "${TOOLDIR}"
|
2003-07-16 16:57:57 +04:00
|
|
|
@echo "*** WARNING: TOOLDIR has moved?"
|
|
|
|
@echo "*** PREVIOUSTOOLDIR '${PREVIOUSTOOLDIR}'"
|
|
|
|
@echo "*** != TOOLDIR '${TOOLDIR}'"
|
|
|
|
@echo "*** Cleaning mis-matched tools"
|
|
|
|
rm -f PREVIOUSTOOLDIR
|
2006-08-03 21:11:05 +04:00
|
|
|
(cd ${.CURDIR} && ${MAKE} PREVIOUSTOOLDIR=${TOOLDIR} cleandir)
|
2003-07-16 16:57:57 +04:00
|
|
|
.endif
|
2006-07-17 17:54:46 +04:00
|
|
|
echo ${TOOLDIR} >PREVIOUSTOOLDIR
|
2003-07-16 16:57:57 +04:00
|
|
|
|
2003-07-24 17:00:52 +04:00
|
|
|
cleandir:
|
|
|
|
rm -f ${CLEANFILES}
|