2024-05-31 23:52:58 +03:00
|
|
|
# $NetBSD: Makefile,v 1.221 2024/05/31 20:52:58 tsutsui 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"
|
2024-03-27 08:43:38 +03:00
|
|
|
. if "${TOOLDIR}" == ""
|
|
|
|
. error TOOLDIR is undefined or empty
|
|
|
|
. elif ${TOOLDIR:tW:M/*} == ""
|
|
|
|
. error TOOLDIR '${TOOLDIR}' is not an absolute path
|
|
|
|
. endif
|
2012-12-02 16:10:43 +04:00
|
|
|
.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"
|
2021-02-06 19:14:55 +03:00
|
|
|
. if (defined(HAVE_GCC) && ${HAVE_GCC} > 0) || \
|
|
|
|
(defined(HAVE_GDB) && ${HAVE_GDB} > 0 && ${MKCROSSGDB:Uno} != "no")
|
|
|
|
TOOLCHAIN_BITS+= gmake .WAIT
|
2011-06-21 06:15:41 +04:00
|
|
|
TOOLCHAIN_BITS+= gmp .WAIT
|
|
|
|
TOOLCHAIN_BITS+= mpfr .WAIT
|
|
|
|
TOOLCHAIN_BITS+= mpc .WAIT
|
2024-02-23 08:34:41 +03:00
|
|
|
. if (defined(HAVE_GCC) && ${HAVE_GCC} >= 12)
|
|
|
|
TOOLCHAIN_BITS+= isl .WAIT
|
|
|
|
. endif
|
2014-06-15 00:49:36 +04:00
|
|
|
. endif
|
2012-08-10 20:13:36 +04:00
|
|
|
|
2006-03-30 01:10:52 +04:00
|
|
|
TOOLCHAIN_BITS+= binutils .WAIT
|
2012-08-10 20:13:36 +04:00
|
|
|
|
2021-02-06 19:14:55 +03:00
|
|
|
. if defined(HAVE_GCC) && ${HAVE_GCC} > 0
|
2003-12-04 13:08:58 +03:00
|
|
|
TOOLCHAIN_BITS+= gcc
|
2021-02-06 19:14:55 +03:00
|
|
|
. endif
|
|
|
|
|
|
|
|
. if defined(HAVE_GDB) && ${HAVE_GDB} > 0 && ${MKCROSSGDB:Uno} != "no"
|
2003-10-26 04:06:27 +03:00
|
|
|
TOOLCHAIN_BITS+= gdb
|
2014-06-15 00:49:36 +04:00
|
|
|
. endif
|
2021-02-06 19:14:55 +03:00
|
|
|
|
|
|
|
TOOLCHAIN_BITS+= .WAIT
|
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"
|
2024-03-31 01:38:02 +03:00
|
|
|
DTRACE_BITS+= .WAIT elftoolchain/common
|
|
|
|
DTRACE_BITS+= .WAIT elftoolchain/libelf
|
|
|
|
DTRACE_BITS+= .WAIT elftoolchain/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.
|
|
|
|
#
|
2021-05-27 11:41:35 +03:00
|
|
|
.ORDER: dependall-host-mkdep dependall-compat dependall-binstall \
|
|
|
|
dependall-date
|
2012-12-02 16:25:25 +04:00
|
|
|
.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
|
2021-05-27 11:41:35 +03:00
|
|
|
.endif
|
|
|
|
.if make(dependall-date)
|
|
|
|
dependall-date: dependall-host-mkdep dependall-compat
|
2012-12-02 16:25:25 +04:00
|
|
|
.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.
|
|
|
|
#
|
2021-05-26 23:19:15 +03:00
|
|
|
SUBDIR= host-mkdep compat binstall date \
|
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
|
|
|
|
|
2024-04-01 05:22:38 +03:00
|
|
|
SUBDIR+= cat gzip rpcgen join lorder m4 mkdep tsort .WAIT yacc .WAIT awk .WAIT lex
|
2013-01-31 19:22:50 +04:00
|
|
|
.if ${TOOLS_BUILDRUMP} == "no"
|
2019-09-26 12:21:34 +03:00
|
|
|
SUBDIR+= xz-include .WAIT grep xz-lib pax .WAIT libprop
|
|
|
|
|
2013-01-31 19:22:50 +04:00
|
|
|
SUBDIR += .WAIT texinfo \
|
2011-11-03 00:36:41 +04:00
|
|
|
.WAIT tic \
|
2009-12-23 23:15:21 +03:00
|
|
|
.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
|
2019-09-26 12:21:34 +03:00
|
|
|
SUBDIR+= stat .WAIT config
|
|
|
|
.if ${TOOLS_BUILDRUMP} == "no"
|
|
|
|
SUBDIR+= xz-bin
|
|
|
|
.endif
|
2001-12-12 00:17:56 +03:00
|
|
|
|
2019-04-03 18:21:58 +03:00
|
|
|
.if ${MKLLVM} != "no" || ${MKLLVMRT} != "no"
|
2011-02-06 04:13:42 +03:00
|
|
|
SUBDIR+= \
|
|
|
|
llvm .WAIT \
|
2017-01-11 15:08:34 +03:00
|
|
|
llvm-lib/libLLVMDemangle llvm-lib/libLLVMSupport llvm-lib/libLLVMTableGen .WAIT \
|
2019-04-03 18:21:58 +03:00
|
|
|
llvm-tblgen
|
|
|
|
.endif
|
|
|
|
.if ${MKLLVM} != "no"
|
|
|
|
SUBDIR+= \
|
|
|
|
llvm-clang-tblgen
|
2018-05-09 16:21:27 +03:00
|
|
|
.endif
|
|
|
|
.if ${MKLLVM} != "no" && !defined(EXTERNAL_TOOLCHAIN)
|
|
|
|
SUBDIR+= \
|
|
|
|
.WAIT llvm-include .WAIT \
|
2019-04-03 18:12:44 +03:00
|
|
|
llvm-lib .WAIT \
|
|
|
|
llvm-clang
|
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
|
|
|
|
|
2019-01-02 16:29:22 +03:00
|
|
|
.if ${MACHINE_CPU} == "arm"
|
2018-12-31 16:35:15 +03:00
|
|
|
SUBDIR+= arm-elf2aout
|
|
|
|
.endif
|
|
|
|
|
2019-01-02 16:29:22 +03:00
|
|
|
.if ${MACHINE_CPU} == "m68k"
|
2011-07-16 19:52:01 +04:00
|
|
|
SUBDIR+= m68k-elf2aout
|
|
|
|
.endif
|
|
|
|
|
2021-04-25 18:11:28 +03:00
|
|
|
.if !empty(MACHINE_ARCH:Mmips*)
|
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
|
|
|
|
|
2021-11-14 18:48:02 +03:00
|
|
|
.if ${MACHINE} == "evbarm" || ${MACHINE} == "evbmips" || \
|
|
|
|
${MACHINE} == "evbppc" || ${MACHINE} == "evbsh3" || \
|
|
|
|
${MACHINE} == "sandpoint" || \
|
|
|
|
${MACHINE_CPU} == "riscv"
|
2024-05-23 05:50:47 +03: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
|
|
|
|
|
2021-05-06 16:23:36 +03:00
|
|
|
.if ${MACHINE} == "mvme68k"
|
|
|
|
SUBDIR+= mvme68k-wrtvid
|
|
|
|
.endif
|
|
|
|
|
2024-05-31 23:52:58 +03:00
|
|
|
.if ${MACHINE} == "mac68k" || ${MACHINE} == "macppc"
|
|
|
|
SUBDIR+= mkhybrid
|
|
|
|
.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
|
|
|
|
|
2023-11-30 09:29:33 +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}
|