2012-12-02 16:25:25 +04:00
|
|
|
# $NetBSD: Makefile,v 1.165 2012/12/02 12:25:25 apb Exp $
|
2001-08-14 15:01:55 +04:00
|
|
|
|
2001-09-22 08:15:19 +04:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
|
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
|
|
|
|
|
2012-11-26 20:57:25 +04:00
|
|
|
.if ${TOOLCHAIN_MISSING} == "no"
|
|
|
|
.if defined(HAVE_GCC)
|
2006-03-30 01:10:52 +04:00
|
|
|
TOOLCHAIN_BITS= gmake .WAIT
|
2012-08-10 20:13:36 +04:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(HAVE_GCC)
|
2011-06-21 06:15:41 +04:00
|
|
|
.if ${HAVE_GCC} >= 45
|
|
|
|
TOOLCHAIN_BITS+= gmp .WAIT
|
|
|
|
TOOLCHAIN_BITS+= mpfr .WAIT
|
|
|
|
TOOLCHAIN_BITS+= mpc .WAIT
|
|
|
|
.endif
|
2012-08-10 20:13:36 +04:00
|
|
|
.endif
|
|
|
|
.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
|
|
|
|
|
|
|
|
.if defined(HAVE_GCC)
|
|
|
|
.if ${TOOLCHAIN_MISSING} == "no"
|
2003-12-04 13:08:58 +03:00
|
|
|
TOOLCHAIN_BITS+= gcc
|
2006-06-03 02:16:18 +04:00
|
|
|
. if ${MKCROSSGDB:Uno} != "no"
|
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
|
2002-01-29 13:20:28 +03:00
|
|
|
.endif
|
2008-08-24 09:53:36 +04:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if defined(HAVE_PCC)
|
|
|
|
.if ${TOOLCHAIN_MISSING} == "no"
|
|
|
|
TOOLCHAIN_BITS+= pcc
|
|
|
|
.endif
|
|
|
|
.endif
|
2002-01-29 13:20:28 +03:00
|
|
|
|
2012-09-20 19:50:20 +04:00
|
|
|
.if ${TOOLCHAIN_MISSING} == "no"
|
|
|
|
# XXX Eventually, we want to be able to build dbsym and mdsetimage
|
|
|
|
# XXX if EXTERNAL_TOOLCHAIN is set.
|
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=
|
|
|
|
.if ${MKDTRACE} != "no"
|
|
|
|
DTRACE_BITS+= .WAIT libelf
|
|
|
|
DTRACE_BITS+= .WAIT libdwarf
|
2012-12-02 15:19:45 +04:00
|
|
|
DTRACE_BITS+= .WAIT libctf
|
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 \
|
|
|
|
.WAIT mktemp .WAIT sed .WAIT \
|
2007-01-14 19:17:29 +03:00
|
|
|
cap_mkdb crunchgen ctags genassym gencat hexdump join \
|
2006-06-23 00:03:41 +04:00
|
|
|
${LINT_BITS} \
|
2011-11-03 00:33:18 +04:00
|
|
|
lorder makewhatis mkdep mtree nbperf .WAIT rpcgen tsort \
|
2010-02-03 18:34:37 +03:00
|
|
|
uudecode m4 \
|
2009-12-23 23:15:21 +03:00
|
|
|
.WAIT texinfo \
|
|
|
|
.WAIT yacc \
|
|
|
|
.WAIT awk \
|
2011-11-03 00:36:41 +04:00
|
|
|
.WAIT tic \
|
2009-12-23 23:15:21 +03:00
|
|
|
.WAIT lex \
|
|
|
|
.WAIT pax \
|
|
|
|
.WAIT ${TOOLCHAIN_BITS} \
|
2010-03-02 23:47:01 +03:00
|
|
|
${DTRACE_BITS} \
|
2010-06-04 12:34:35 +04:00
|
|
|
asn1_compile cat cksum compile_et config db \
|
2011-04-15 22:05:42 +04:00
|
|
|
file lint1 slc \
|
2011-03-17 22:06:45 +03:00
|
|
|
makefs .WAIT menuc mkcsmapper mkesdb mklocale mknod msgc \
|
2009-12-23 23:15:21 +03:00
|
|
|
.WAIT disklabel \
|
|
|
|
.WAIT paxctl \
|
|
|
|
.WAIT fdisk \
|
|
|
|
.WAIT installboot \
|
2011-11-03 03:47:07 +04:00
|
|
|
pwd_mkdb stat strfile sunlabel zic
|
2001-12-12 00:17:56 +03:00
|
|
|
|
2011-02-06 04:13:42 +03:00
|
|
|
.if ${MKLLVM} != "no"
|
|
|
|
SUBDIR+= \
|
|
|
|
llvm .WAIT \
|
2011-10-11 17:53:56 +04:00
|
|
|
llvm-lib/libLLVMSupport llvm-lib/libLLVMTableGen .WAIT \
|
2012-11-16 03:51:53 +04:00
|
|
|
llvm-tblgen llvm-clang-tblgen .WAIT \
|
2011-02-06 04:13:42 +03:00
|
|
|
llvm-include .WAIT \
|
|
|
|
llvm-lib .WAIT \
|
|
|
|
llvm-clang
|
|
|
|
.endif
|
|
|
|
|
2008-10-13 22:11:15 +04:00
|
|
|
.if ${MKMAN} != "no" || ${MKDOC} != "no" || ${MKHTML} != "no"
|
2010-02-20 03:35:11 +03:00
|
|
|
. if ${MKGROFF} != "no"
|
2002-03-07 21:57:18 +03:00
|
|
|
SUBDIR+= groff
|
2009-10-24 02:14:37 +04:00
|
|
|
. endif
|
2010-02-20 03:35:11 +03:00
|
|
|
SUBDIR+= mandoc
|
2002-03-07 21:57:18 +03:00
|
|
|
.endif
|
|
|
|
|
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
|
|
|
|
|
2004-11-28 14:14:41 +03:00
|
|
|
.if ${MACHINE} == "hp700"
|
2004-07-28 13:17:31 +04:00
|
|
|
SUBDIR+= hp700-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
|
|
|
|
|
2012-11-28 00:00:38 +04:00
|
|
|
.if ${MACHINE} == "evbarm" && ${MACHINE_ARCH} == "arm"
|
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
|
|
|
|
.endif
|
|
|
|
|
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}
|