2003-12-08 01:52:56 +03:00
|
|
|
# $NetBSD: bsd.own.mk,v 1.403 2003/12/07 22:52:56 scw Exp $
|
1998-04-13 16:03:07 +04:00
|
|
|
|
|
|
|
.if !defined(_BSD_OWN_MK_)
|
|
|
|
_BSD_OWN_MK_=1
|
1996-04-13 06:08:08 +04:00
|
|
|
|
2001-08-14 09:55:27 +04:00
|
|
|
MAKECONF?= /etc/mk.conf
|
2001-11-02 08:21:47 +03:00
|
|
|
.-include "${MAKECONF}"
|
1994-09-28 18:59:28 +03:00
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
* Eliminate the USE_NEW_TOOLCHAIN variable. Instead, split it into
two variables:
TOOLCHAIN_MISSING -- set to "yes" on platforms for which there is
no working in-tree toolchain (hppa, ns32k, sh5, x86_64).
EXTERNAL_TOOLCHAIN -- if defined by the user, points to the root of
an external toolchain (e.g. /usr/local/gnu). This enables the cross-build
framework even for TOOLCHAIN_MISSING platforms.
If TOOLCHAIN_MISSING is set to "yes", MKGDB, MKBFD, and MKGCC are all
unconditionally set to "no", since the bits are not there to build.
If EXTERNAL_TOOLCHAIN is set, MKGCC is unconditionally set to "no",
since the external toolchain's compiler is not in-sync with the
in-tree compiler support components (e.g. libgcc).
* Set MACHINE_CPU much earlier in bsd.own.mk, so that more tests in
that file can use it.
2002-09-18 03:18:25 +04:00
|
|
|
# CPU model, derived from MACHINE_ARCH
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
* Eliminate the USE_NEW_TOOLCHAIN variable. Instead, split it into
two variables:
TOOLCHAIN_MISSING -- set to "yes" on platforms for which there is
no working in-tree toolchain (hppa, ns32k, sh5, x86_64).
EXTERNAL_TOOLCHAIN -- if defined by the user, points to the root of
an external toolchain (e.g. /usr/local/gnu). This enables the cross-build
framework even for TOOLCHAIN_MISSING platforms.
If TOOLCHAIN_MISSING is set to "yes", MKGDB, MKBFD, and MKGCC are all
unconditionally set to "no", since the bits are not there to build.
If EXTERNAL_TOOLCHAIN is set, MKGCC is unconditionally set to "no",
since the external toolchain's compiler is not in-sync with the
in-tree compiler support components (e.g. libgcc).
* Set MACHINE_CPU much earlier in bsd.own.mk, so that more tests in
that file can use it.
2002-09-18 03:18:25 +04:00
|
|
|
MACHINE_CPU= ${MACHINE_ARCH:C/mipse[bl]/mips/:C/sh3e[bl]/sh3/:C/sh5e[bl]/sh5/:S/m68000/m68k/:S/armeb/arm/}
|
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2001-11-05 22:45:25 +03:00
|
|
|
# NEED_OWN_INSTALL_TARGET is set to "no" by pkgsrc/mk/bsd.pkg.mk to
|
|
|
|
# ensure that things defined by <bsd.own.mk> (default targets,
|
|
|
|
# INSTALL_FILE, etc.) are not conflicting with bsd.pkg.mk.
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2001-11-05 22:45:25 +03:00
|
|
|
NEED_OWN_INSTALL_TARGET?= yes
|
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
* Eliminate the USE_NEW_TOOLCHAIN variable. Instead, split it into
two variables:
TOOLCHAIN_MISSING -- set to "yes" on platforms for which there is
no working in-tree toolchain (hppa, ns32k, sh5, x86_64).
EXTERNAL_TOOLCHAIN -- if defined by the user, points to the root of
an external toolchain (e.g. /usr/local/gnu). This enables the cross-build
framework even for TOOLCHAIN_MISSING platforms.
If TOOLCHAIN_MISSING is set to "yes", MKGDB, MKBFD, and MKGCC are all
unconditionally set to "no", since the bits are not there to build.
If EXTERNAL_TOOLCHAIN is set, MKGCC is unconditionally set to "no",
since the external toolchain's compiler is not in-sync with the
in-tree compiler support components (e.g. libgcc).
* Set MACHINE_CPU much earlier in bsd.own.mk, so that more tests in
that file can use it.
2002-09-18 03:18:25 +04:00
|
|
|
# This lists the platforms which do not have working in-tree toolchains.
|
2003-12-08 01:52:56 +03:00
|
|
|
# For the in-tree gcc 3.3.2 toolchain, this list is empty.
|
|
|
|
# If some future port is not supported by the in-tree toolchain, this
|
|
|
|
# should be set to "yes" for that port only.
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
* Eliminate the USE_NEW_TOOLCHAIN variable. Instead, split it into
two variables:
TOOLCHAIN_MISSING -- set to "yes" on platforms for which there is
no working in-tree toolchain (hppa, ns32k, sh5, x86_64).
EXTERNAL_TOOLCHAIN -- if defined by the user, points to the root of
an external toolchain (e.g. /usr/local/gnu). This enables the cross-build
framework even for TOOLCHAIN_MISSING platforms.
If TOOLCHAIN_MISSING is set to "yes", MKGDB, MKBFD, and MKGCC are all
unconditionally set to "no", since the bits are not there to build.
If EXTERNAL_TOOLCHAIN is set, MKGCC is unconditionally set to "no",
since the external toolchain's compiler is not in-sync with the
in-tree compiler support components (e.g. libgcc).
* Set MACHINE_CPU much earlier in bsd.own.mk, so that more tests in
that file can use it.
2002-09-18 03:18:25 +04:00
|
|
|
TOOLCHAIN_MISSING= no
|
2001-10-04 19:52:59 +04:00
|
|
|
|
2003-07-27 18:49:22 +04:00
|
|
|
#
|
|
|
|
# Transitional for toolchain upgrade to GCC3.3
|
|
|
|
#
|
2003-08-27 20:03:17 +04:00
|
|
|
# not working:
|
|
|
|
#
|
2003-12-05 15:14:42 +03:00
|
|
|
.if ${MACHINE_ARCH} == "sh3el" || \
|
2003-11-27 16:09:37 +03:00
|
|
|
${MACHINE_ARCH} == "sh3eb" || \
|
|
|
|
${MACHINE_ARCH} == "vax"
|
|
|
|
HAVE_GCC3?= no
|
|
|
|
.else
|
2003-08-27 20:03:17 +04:00
|
|
|
HAVE_GCC3?= yes
|
2003-11-27 16:09:37 +03:00
|
|
|
.endif
|
|
|
|
|
2003-08-27 20:03:17 +04:00
|
|
|
# Do we want to use tools/toolchain or not?
|
|
|
|
.if ${HAVE_GCC3} == "yes"
|
|
|
|
USE_TOOLS_TOOLCHAIN=no
|
2003-07-27 18:49:22 +04:00
|
|
|
.endif
|
2003-08-28 16:28:34 +04:00
|
|
|
USE_TOOLS_TOOLCHAIN?=yes
|
2003-07-27 18:49:22 +04:00
|
|
|
|
* Eliminate the USE_NEW_TOOLCHAIN variable. Instead, split it into
two variables:
TOOLCHAIN_MISSING -- set to "yes" on platforms for which there is
no working in-tree toolchain (hppa, ns32k, sh5, x86_64).
EXTERNAL_TOOLCHAIN -- if defined by the user, points to the root of
an external toolchain (e.g. /usr/local/gnu). This enables the cross-build
framework even for TOOLCHAIN_MISSING platforms.
If TOOLCHAIN_MISSING is set to "yes", MKGDB, MKBFD, and MKGCC are all
unconditionally set to "no", since the bits are not there to build.
If EXTERNAL_TOOLCHAIN is set, MKGCC is unconditionally set to "no",
since the external toolchain's compiler is not in-sync with the
in-tree compiler support components (e.g. libgcc).
* Set MACHINE_CPU much earlier in bsd.own.mk, so that more tests in
that file can use it.
2002-09-18 03:18:25 +04:00
|
|
|
CPPFLAG_ISYSTEM= -isystem
|
2003-12-03 13:26:45 +03:00
|
|
|
# GCC2 did not have -isystem-cxx
|
2003-07-27 18:49:22 +04:00
|
|
|
.if ${USE_TOOLS_TOOLCHAIN} == "yes"
|
|
|
|
CPPFLAG_ISYSTEMXX= -isystem
|
|
|
|
.else
|
2003-08-02 02:51:34 +04:00
|
|
|
CPPFLAG_ISYSTEMXX= -isystem-cxx
|
2003-07-27 18:49:22 +04:00
|
|
|
.endif
|
2001-11-19 05:46:50 +03:00
|
|
|
|
2001-11-19 07:44:32 +03:00
|
|
|
.if empty(.MAKEFLAGS:M-V*)
|
|
|
|
PRINTOBJDIR= ${MAKE} -V .OBJDIR
|
|
|
|
.else
|
|
|
|
PRINTOBJDIR= echo # prevent infinite recursion
|
|
|
|
.endif
|
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2002-04-23 11:20:22 +04:00
|
|
|
# Determine if running in the NetBSD source tree by checking for the
|
|
|
|
# existence of build.sh and tools/ in the current or a parent directory,
|
|
|
|
# and setting _SRC_TOP_ to the result.
|
|
|
|
#
|
2002-04-26 18:27:23 +04:00
|
|
|
.if !defined(_SRC_TOP_) # {
|
2001-10-26 08:59:10 +04:00
|
|
|
_SRC_TOP_!= cd ${.CURDIR}; while :; do \
|
2001-10-26 10:41:46 +04:00
|
|
|
here=`pwd`; \
|
2001-10-26 08:59:10 +04:00
|
|
|
[ -f build.sh ] && [ -d tools ] && { echo $$here; break; }; \
|
|
|
|
case $$here in /) echo ""; break;; esac; \
|
2003-07-18 12:26:01 +04:00
|
|
|
cd ..; done
|
2001-10-26 08:59:10 +04:00
|
|
|
|
|
|
|
.MAKEOVERRIDES+= _SRC_TOP_
|
|
|
|
|
2002-04-26 18:27:23 +04:00
|
|
|
.endif # }
|
2001-11-19 07:44:32 +03:00
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2002-12-23 05:01:29 +03:00
|
|
|
# If _SRC_TOP_ != "", we're within the NetBSD source tree, so set
|
2002-04-26 19:02:02 +04:00
|
|
|
# defaults for NETBSDSRCDIR and _SRC_TOP_OBJ_.
|
2002-04-23 11:20:22 +04:00
|
|
|
#
|
2002-04-26 18:27:23 +04:00
|
|
|
.if (${_SRC_TOP_} != "") # {
|
2002-04-23 11:20:22 +04:00
|
|
|
|
2002-04-26 19:02:02 +04:00
|
|
|
NETBSDSRCDIR?= ${_SRC_TOP_}
|
2002-04-23 11:20:22 +04:00
|
|
|
|
|
|
|
.if !defined(_SRC_TOP_OBJ_)
|
|
|
|
_SRC_TOP_OBJ_!= cd ${_SRC_TOP_} && ${PRINTOBJDIR}
|
|
|
|
.MAKEOVERRIDES+= _SRC_TOP_OBJ_
|
|
|
|
.endif
|
|
|
|
|
2002-12-23 05:01:29 +03:00
|
|
|
.endif # _SRC_TOP_ != "" # }
|
2002-04-26 18:27:23 +04:00
|
|
|
|
|
|
|
|
* Eliminate the USE_NEW_TOOLCHAIN variable. Instead, split it into
two variables:
TOOLCHAIN_MISSING -- set to "yes" on platforms for which there is
no working in-tree toolchain (hppa, ns32k, sh5, x86_64).
EXTERNAL_TOOLCHAIN -- if defined by the user, points to the root of
an external toolchain (e.g. /usr/local/gnu). This enables the cross-build
framework even for TOOLCHAIN_MISSING platforms.
If TOOLCHAIN_MISSING is set to "yes", MKGDB, MKBFD, and MKGCC are all
unconditionally set to "no", since the bits are not there to build.
If EXTERNAL_TOOLCHAIN is set, MKGCC is unconditionally set to "no",
since the external toolchain's compiler is not in-sync with the
in-tree compiler support components (e.g. libgcc).
* Set MACHINE_CPU much earlier in bsd.own.mk, so that more tests in
that file can use it.
2002-09-18 03:18:25 +04:00
|
|
|
.if (${_SRC_TOP_} != "") && \
|
|
|
|
(${TOOLCHAIN_MISSING} != "yes" || defined(EXTERNAL_TOOLCHAIN))
|
2002-04-26 18:27:23 +04:00
|
|
|
USETOOLS?= yes
|
|
|
|
.endif
|
|
|
|
USETOOLS?= no
|
|
|
|
|
|
|
|
|
* Eliminate the USE_NEW_TOOLCHAIN variable. Instead, split it into
two variables:
TOOLCHAIN_MISSING -- set to "yes" on platforms for which there is
no working in-tree toolchain (hppa, ns32k, sh5, x86_64).
EXTERNAL_TOOLCHAIN -- if defined by the user, points to the root of
an external toolchain (e.g. /usr/local/gnu). This enables the cross-build
framework even for TOOLCHAIN_MISSING platforms.
If TOOLCHAIN_MISSING is set to "yes", MKGDB, MKBFD, and MKGCC are all
unconditionally set to "no", since the bits are not there to build.
If EXTERNAL_TOOLCHAIN is set, MKGCC is unconditionally set to "no",
since the external toolchain's compiler is not in-sync with the
in-tree compiler support components (e.g. libgcc).
* Set MACHINE_CPU much earlier in bsd.own.mk, so that more tests in
that file can use it.
2002-09-18 03:18:25 +04:00
|
|
|
.if ${MACHINE_ARCH} == "mips" || ${MACHINE_ARCH} == "sh3" || \
|
|
|
|
${MACHINE_ARCH} == "sh5"
|
2001-09-22 09:45:50 +04:00
|
|
|
.BEGIN:
|
|
|
|
@echo "Must set MACHINE_ARCH to one of ${MACHINE_ARCH}eb or ${MACHINE_ARCH}el"
|
|
|
|
@false
|
* Eliminate the USE_NEW_TOOLCHAIN variable. Instead, split it into
two variables:
TOOLCHAIN_MISSING -- set to "yes" on platforms for which there is
no working in-tree toolchain (hppa, ns32k, sh5, x86_64).
EXTERNAL_TOOLCHAIN -- if defined by the user, points to the root of
an external toolchain (e.g. /usr/local/gnu). This enables the cross-build
framework even for TOOLCHAIN_MISSING platforms.
If TOOLCHAIN_MISSING is set to "yes", MKGDB, MKBFD, and MKGCC are all
unconditionally set to "no", since the bits are not there to build.
If EXTERNAL_TOOLCHAIN is set, MKGCC is unconditionally set to "no",
since the external toolchain's compiler is not in-sync with the
in-tree compiler support components (e.g. libgcc).
* Set MACHINE_CPU much earlier in bsd.own.mk, so that more tests in
that file can use it.
2002-09-18 03:18:25 +04:00
|
|
|
.elif defined(REQUIRETOOLS) && \
|
|
|
|
(${TOOLCHAIN_MISSING} != "yes" || defined(EXTERNAL_TOOLCHAIN)) && \
|
|
|
|
${USETOOLS} == "no"
|
2001-09-22 09:45:50 +04:00
|
|
|
.BEGIN:
|
2001-10-31 19:25:21 +03:00
|
|
|
@echo "USETOOLS=no, but this component requires a version-specific host toolchain"
|
2001-09-22 09:45:50 +04:00
|
|
|
@false
|
|
|
|
.endif
|
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2001-10-31 20:46:08 +03:00
|
|
|
# Host platform information; may be overridden
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2001-10-31 20:46:08 +03:00
|
|
|
.if !defined(HOST_OSTYPE)
|
|
|
|
_HOST_OSNAME!= uname -s
|
|
|
|
_HOST_OSREL!= uname -r
|
|
|
|
_HOST_ARCH!= uname -p 2>/dev/null || uname -m
|
2002-01-15 22:13:59 +03:00
|
|
|
HOST_OSTYPE:= ${_HOST_OSNAME}-${_HOST_OSREL:C/\([^\)]*\)//}-${_HOST_ARCH}
|
2001-10-31 20:46:08 +03:00
|
|
|
.MAKEOVERRIDES+= HOST_OSTYPE
|
|
|
|
.endif
|
2003-05-09 00:39:00 +04:00
|
|
|
HOST_CYGWIN= ${HOST_OSTYPE:MCYGWIN*}
|
2001-10-31 20:46:08 +03:00
|
|
|
|
2002-03-19 14:03:05 +03:00
|
|
|
.if ${USETOOLS} == "yes" # {
|
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2001-10-31 20:46:08 +03:00
|
|
|
# Provide a default for TOOLDIR.
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2001-10-26 08:59:10 +04:00
|
|
|
.if !defined(TOOLDIR)
|
2003-07-16 17:19:49 +04:00
|
|
|
TOOLDIR:= ${_SRC_TOP_OBJ_}/tooldir.${HOST_OSTYPE}
|
2001-10-31 20:46:08 +03:00
|
|
|
.MAKEOVERRIDES+= TOOLDIR
|
2001-10-26 08:59:10 +04:00
|
|
|
.endif
|
2001-09-22 09:45:50 +04:00
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2002-12-08 23:19:56 +03:00
|
|
|
# This is the prefix used for the NetBSD-sourced tools.
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2002-12-08 23:19:56 +03:00
|
|
|
_TOOL_PREFIX?= nb
|
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2002-11-26 22:51:16 +03:00
|
|
|
# If an external toolchain base is specified, use it.
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
|
|
|
.if defined(EXTERNAL_TOOLCHAIN) # {
|
2002-11-26 22:51:16 +03:00
|
|
|
AR= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ar
|
|
|
|
AS= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-as
|
|
|
|
LD= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ld
|
|
|
|
NM= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-nm
|
|
|
|
OBJCOPY= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objcopy
|
|
|
|
OBJDUMP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-objdump
|
|
|
|
RANLIB= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-ranlib
|
|
|
|
SIZE= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-size
|
|
|
|
STRIP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-strip
|
|
|
|
|
|
|
|
CC= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
|
|
|
|
CPP= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-cpp
|
|
|
|
CXX= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-c++
|
|
|
|
FC= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-g77
|
|
|
|
OBJC= ${EXTERNAL_TOOLCHAIN}/bin/${MACHINE_GNU_PLATFORM}-gcc
|
2003-07-18 12:26:01 +04:00
|
|
|
.else # } {
|
2001-10-31 20:46:08 +03:00
|
|
|
# Define default locations for common tools.
|
2003-07-18 12:26:01 +04:00
|
|
|
.if ${USETOOLS_BINUTILS:Uyes} == "yes" # {
|
2001-12-12 06:28:37 +03:00
|
|
|
AR= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ar
|
|
|
|
AS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-as
|
2001-12-12 08:50:09 +03:00
|
|
|
LD= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ld
|
|
|
|
NM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-nm
|
|
|
|
OBJCOPY= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objcopy
|
|
|
|
OBJDUMP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-objdump
|
|
|
|
RANLIB= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ranlib
|
|
|
|
SIZE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-size
|
|
|
|
STRIP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-strip
|
2003-07-18 12:26:01 +04:00
|
|
|
.endif # }
|
2001-12-12 08:50:09 +03:00
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
.if ${USETOOLS_GCC:Uyes} == "yes" # {
|
2001-09-22 09:45:50 +04:00
|
|
|
CC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
|
2001-12-12 08:50:09 +03:00
|
|
|
CPP= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-cpp
|
|
|
|
CXX= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-c++
|
|
|
|
FC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-g77
|
|
|
|
OBJC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
|
2003-07-18 12:26:01 +04:00
|
|
|
.endif # }
|
|
|
|
.endif # EXTERNAL_TOOLCHAIN # }
|
2001-12-12 08:50:09 +03:00
|
|
|
|
2003-07-10 14:33:58 +04:00
|
|
|
HOST_MKDEP= ${TOOLDIR}/bin/${_TOOL_PREFIX}host-mkdep
|
|
|
|
|
2001-11-09 10:30:55 +03:00
|
|
|
DBSYM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-dbsym
|
2002-12-08 23:19:56 +03:00
|
|
|
ELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
|
|
|
|
INSTALL= STRIP=${STRIP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}install
|
|
|
|
LEX= ${TOOLDIR}/bin/${_TOOL_PREFIX}lex
|
2001-11-13 20:37:03 +03:00
|
|
|
LINT= CC=${CC:Q} ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-lint
|
2003-07-10 14:33:58 +04:00
|
|
|
LORDER= NM=${NM:Q} MKTEMP=${TOOL_MKTEMP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}lorder
|
2002-12-08 23:19:56 +03:00
|
|
|
MKDEP= CC=${CC:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep
|
|
|
|
TSORT= ${TOOLDIR}/bin/${_TOOL_PREFIX}tsort -q
|
|
|
|
YACC= ${TOOLDIR}/bin/${_TOOL_PREFIX}yacc
|
2003-07-10 14:33:58 +04:00
|
|
|
|
|
|
|
TOOL_ASN1_COMPILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}asn1_compile
|
|
|
|
TOOL_CAP_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}cap_mkdb
|
|
|
|
TOOL_CAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}cat
|
|
|
|
TOOL_CKSUM= ${TOOLDIR}/bin/${_TOOL_PREFIX}cksum
|
|
|
|
TOOL_COMPILE_ET= ${TOOLDIR}/bin/${_TOOL_PREFIX}compile_et
|
|
|
|
TOOL_CONFIG= ${TOOLDIR}/bin/${_TOOL_PREFIX}config
|
|
|
|
TOOL_CRUNCHGEN= MAKE=${.MAKE:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}crunchgen
|
|
|
|
TOOL_CTAGS= ${TOOLDIR}/bin/${_TOOL_PREFIX}ctags
|
|
|
|
TOOL_DB= ${TOOLDIR}/bin/${_TOOL_PREFIX}db
|
|
|
|
TOOL_EQN= ${TOOLDIR}/bin/${_TOOL_PREFIX}eqn
|
|
|
|
TOOL_FGEN= ${TOOLDIR}/bin/${_TOOL_PREFIX}fgen
|
|
|
|
TOOL_GENCAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}gencat
|
|
|
|
TOOL_GROFF= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}groff
|
|
|
|
TOOL_HEXDUMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}hexdump
|
|
|
|
TOOL_INDXBIB= ${TOOLDIR}/bin/${_TOOL_PREFIX}indxbib
|
|
|
|
TOOL_INSTALLBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}installboot
|
|
|
|
TOOL_INSTALL_INFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}install-info
|
|
|
|
TOOL_M4= ${TOOLDIR}/bin/${_TOOL_PREFIX}m4
|
|
|
|
TOOL_MAKEFS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makefs
|
|
|
|
TOOL_MAKEINFO= ${TOOLDIR}/bin/${_TOOL_PREFIX}makeinfo
|
|
|
|
TOOL_MAKEWHATIS= ${TOOLDIR}/bin/${_TOOL_PREFIX}makewhatis
|
|
|
|
TOOL_MDSETIMAGE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-mdsetimage
|
|
|
|
TOOL_MENUC= MENUDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}menuc
|
|
|
|
TOOL_MKCSMAPPER= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkcsmapper
|
|
|
|
TOOL_MKESDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}mkesdb
|
|
|
|
TOOL_MKLOCALE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mklocale
|
|
|
|
TOOL_MKMAGIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}file
|
|
|
|
TOOL_MKTEMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}mktemp
|
|
|
|
TOOL_MSGC= MSGDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}msgc
|
|
|
|
TOOL_MTREE= ${TOOLDIR}/bin/${_TOOL_PREFIX}mtree
|
|
|
|
TOOL_PAX= ${TOOLDIR}/bin/${_TOOL_PREFIX}pax
|
|
|
|
TOOL_PIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}pic
|
|
|
|
TOOL_PREPMKBOOTIMAGE= ${TOOLDIR}/bin/${_TOOL_PREFIX}prep-mkbootimage
|
|
|
|
TOOL_PWD_MKDB= ${TOOLDIR}/bin/${_TOOL_PREFIX}pwd_mkdb
|
|
|
|
TOOL_REFER= ${TOOLDIR}/bin/${_TOOL_PREFIX}refer
|
|
|
|
TOOL_ROFF_ASCII= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}nroff
|
|
|
|
TOOL_ROFF_DVI= ${TOOL_GROFF} -Tdvi
|
2003-07-18 06:52:51 +04:00
|
|
|
TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html
|
2003-07-10 14:33:58 +04:00
|
|
|
TOOL_ROFF_PS= ${TOOL_GROFF} -Tps
|
|
|
|
TOOL_ROFF_RAW= ${TOOL_GROFF} -Z
|
|
|
|
TOOL_RPCGEN= CPP=${CPP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}rpcgen
|
|
|
|
TOOL_SOELIM= ${TOOLDIR}/bin/${_TOOL_PREFIX}soelim
|
2003-07-20 18:36:12 +04:00
|
|
|
TOOL_STAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}stat
|
2003-07-10 14:33:58 +04:00
|
|
|
TOOL_SUNLABEL= ${TOOLDIR}/bin/${_TOOL_PREFIX}sunlabel
|
|
|
|
TOOL_TBL= ${TOOLDIR}/bin/${_TOOL_PREFIX}tbl
|
|
|
|
TOOL_UUDECODE= ${TOOLDIR}/bin/${_TOOL_PREFIX}uudecode
|
|
|
|
TOOL_VGRIND= ${TOOLDIR}/bin/${_TOOL_PREFIX}vgrind -f
|
|
|
|
TOOL_ZIC= ${TOOLDIR}/bin/${_TOOL_PREFIX}zic
|
2001-09-22 09:45:50 +04:00
|
|
|
|
2002-03-19 14:03:05 +03:00
|
|
|
.endif # USETOOLS == yes # }
|
2002-03-05 06:53:58 +03:00
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2002-03-05 06:53:58 +03:00
|
|
|
# Targets to check if DESTDIR or RELEASEDIR is provided
|
|
|
|
#
|
|
|
|
.if !target(check_DESTDIR)
|
|
|
|
check_DESTDIR: .PHONY .NOTMAIN
|
|
|
|
.if !defined(DESTDIR)
|
|
|
|
@echo "setenv DESTDIR before doing that!"
|
|
|
|
@false
|
|
|
|
.else
|
|
|
|
@true
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !target(check_RELEASEDIR)
|
|
|
|
check_RELEASEDIR: .PHONY .NOTMAIN
|
|
|
|
.if !defined(RELEASEDIR)
|
|
|
|
@echo "setenv RELEASEDIR before doing that!"
|
|
|
|
@false
|
|
|
|
.else
|
|
|
|
@true
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
.if ${USETOOLS} == "yes" # {
|
|
|
|
#
|
2001-09-22 09:45:50 +04:00
|
|
|
# Make sure DESTDIR is set, so that builds with these tools always
|
|
|
|
# get appropriate -nostdinc, -nostdlib, etc. handling. The default is
|
|
|
|
# <empty string>, meaning start from /, the root directory.
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2001-09-22 09:45:50 +04:00
|
|
|
DESTDIR?=
|
2003-07-18 12:26:01 +04:00
|
|
|
.endif # }
|
2001-09-22 09:45:50 +04:00
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2002-08-27 18:46:11 +04:00
|
|
|
# Build a dynamically linked /bin and /sbin, with the necessary shared
|
|
|
|
# libraries moved from /usr/lib to /lib and the shared linker moved
|
|
|
|
# from /usr/libexec to /lib
|
|
|
|
#
|
Only use the MKDYNAMICROOT semantics (i.e. -rpath=/lib,/usr/lib and
-dynamic-linker=/libexec/ld.elf_so) if the BINDIR of the program being
built is /bin or /sbin.
The reason we do this is because now all programs *except* those in
/bin and /sbin (i.e. the "special cases") match the default the compiler
uses, which is what is used for things in e.g. xsrc, pkgsrc, and other
random 3rd party programs.
This is done by decoupling where a shlib is installed from how it
is located. Two new variables, SHLIBINSTALLDIR and SHLINKINSTALLDIR,
contain the former information, and key off MKDYNAMICROOT only. SHLIBDIR
and SHLINKDIR contain the latter, and key off MKDYNAMICROOT and BINDIR.
The SHLIBINSTALLDIR, SHLIBDIR, _LIBSODIR, SHLINKINSTALLDIR, and
SHLINKDIR parameters are moved to a new <bsd.shlib.mk>; see bsd.README
for usage details.
2002-09-28 01:37:50 +04:00
|
|
|
# Note that if the BINDIR is not /bin or /sbin, then we always use the
|
|
|
|
# non-DYNAMICROOT behavior (i.e. it is only enabled for programs in /bin
|
|
|
|
# and /sbin). See <bsd.shlib.mk>.
|
|
|
|
#
|
2002-09-22 19:08:17 +04:00
|
|
|
MKDYNAMICROOT?= yes
|
2002-08-27 18:46:11 +04:00
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2002-04-26 18:27:23 +04:00
|
|
|
# Where the system object and source trees are kept; can be configurable
|
|
|
|
# by the user in case they want them in ~/foosrc and ~/fooobj (for example).
|
|
|
|
#
|
|
|
|
BSDSRCDIR?= /usr/src
|
|
|
|
BSDOBJDIR?= /usr/obj
|
2002-04-26 19:02:02 +04:00
|
|
|
NETBSDSRCDIR?= ${BSDSRCDIR}
|
2002-04-26 18:27:23 +04:00
|
|
|
|
1998-02-26 11:46:09 +03:00
|
|
|
BINGRP?= wheel
|
|
|
|
BINOWN?= root
|
1993-04-10 00:05:56 +04:00
|
|
|
BINMODE?= 555
|
1993-08-16 00:42:39 +04:00
|
|
|
NONBINMODE?= 444
|
1993-04-10 00:05:56 +04:00
|
|
|
|
1997-03-25 00:54:12 +03:00
|
|
|
MANDIR?= /usr/share/man
|
1998-02-26 11:46:09 +03:00
|
|
|
MANGRP?= wheel
|
|
|
|
MANOWN?= root
|
1993-08-16 00:42:39 +04:00
|
|
|
MANMODE?= ${NONBINMODE}
|
1997-10-03 23:20:56 +04:00
|
|
|
MANINSTALL?= maninstall catinstall
|
1993-04-10 00:05:56 +04:00
|
|
|
|
1999-02-11 16:25:42 +03:00
|
|
|
INFODIR?= /usr/share/info
|
|
|
|
INFOGRP?= wheel
|
|
|
|
INFOOWN?= root
|
|
|
|
INFOMODE?= ${NONBINMODE}
|
|
|
|
|
1993-08-16 00:42:39 +04:00
|
|
|
LIBDIR?= /usr/lib
|
Only use the MKDYNAMICROOT semantics (i.e. -rpath=/lib,/usr/lib and
-dynamic-linker=/libexec/ld.elf_so) if the BINDIR of the program being
built is /bin or /sbin.
The reason we do this is because now all programs *except* those in
/bin and /sbin (i.e. the "special cases") match the default the compiler
uses, which is what is used for things in e.g. xsrc, pkgsrc, and other
random 3rd party programs.
This is done by decoupling where a shlib is installed from how it
is located. Two new variables, SHLIBINSTALLDIR and SHLINKINSTALLDIR,
contain the former information, and key off MKDYNAMICROOT only. SHLIBDIR
and SHLINKDIR contain the latter, and key off MKDYNAMICROOT and BINDIR.
The SHLIBINSTALLDIR, SHLIBDIR, _LIBSODIR, SHLINKINSTALLDIR, and
SHLINKDIR parameters are moved to a new <bsd.shlib.mk>; see bsd.README
for usage details.
2002-09-28 01:37:50 +04:00
|
|
|
|
1993-08-16 00:42:39 +04:00
|
|
|
LINTLIBDIR?= /usr/libdata/lint
|
|
|
|
LIBGRP?= ${BINGRP}
|
|
|
|
LIBOWN?= ${BINOWN}
|
|
|
|
LIBMODE?= ${NONBINMODE}
|
1993-04-10 00:05:56 +04:00
|
|
|
|
2000-04-24 18:22:05 +04:00
|
|
|
DOCDIR?= /usr/share/doc
|
2000-05-02 15:44:20 +04:00
|
|
|
HTMLDOCDIR?= /usr/share/doc/html
|
1998-02-26 11:46:09 +03:00
|
|
|
DOCGRP?= wheel
|
|
|
|
DOCOWN?= root
|
2000-04-24 18:22:05 +04:00
|
|
|
DOCMODE?= ${NONBINMODE}
|
1993-08-16 00:42:39 +04:00
|
|
|
|
1995-02-21 00:26:33 +03:00
|
|
|
NLSDIR?= /usr/share/nls
|
1998-02-26 11:46:09 +03:00
|
|
|
NLSGRP?= wheel
|
|
|
|
NLSOWN?= root
|
1995-02-21 00:26:33 +03:00
|
|
|
NLSMODE?= ${NONBINMODE}
|
|
|
|
|
1996-08-28 02:15:52 +04:00
|
|
|
KMODDIR?= /usr/lkm
|
1998-02-26 11:46:09 +03:00
|
|
|
KMODGRP?= wheel
|
|
|
|
KMODOWN?= root
|
1996-08-28 02:15:52 +04:00
|
|
|
KMODMODE?= ${NONBINMODE}
|
|
|
|
|
2001-02-01 22:29:59 +03:00
|
|
|
LOCALEDIR?= /usr/share/locale
|
|
|
|
LOCALEGRP?= wheel
|
|
|
|
LOCALEOWN?= root
|
|
|
|
LOCALEMODE?= ${NONBINMODE}
|
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
|
|
|
# Data-driven table using make variables to control how
|
2002-01-29 22:17:49 +03:00
|
|
|
# toolchain-dependent targets and shared libraries are built
|
|
|
|
# for different platforms and object formats.
|
|
|
|
#
|
2002-06-05 06:42:09 +04:00
|
|
|
# OBJECT_FMT: currently either "ELF" or "a.out".
|
2002-01-29 22:17:49 +03:00
|
|
|
#
|
2002-06-05 06:42:09 +04:00
|
|
|
# All platforms are ELF, except for ns32k (which does not yet have
|
|
|
|
# an ELF BFD back-end).
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2002-06-05 06:42:09 +04:00
|
|
|
.if ${MACHINE_ARCH} == "ns32k"
|
|
|
|
OBJECT_FMT?= a.out # allow overrides, to ease transition
|
2002-01-29 22:17:49 +03:00
|
|
|
.else
|
2002-06-05 06:42:09 +04:00
|
|
|
OBJECT_FMT= ELF
|
2002-01-29 22:17:49 +03:00
|
|
|
.endif
|
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
* Eliminate the USE_NEW_TOOLCHAIN variable. Instead, split it into
two variables:
TOOLCHAIN_MISSING -- set to "yes" on platforms for which there is
no working in-tree toolchain (hppa, ns32k, sh5, x86_64).
EXTERNAL_TOOLCHAIN -- if defined by the user, points to the root of
an external toolchain (e.g. /usr/local/gnu). This enables the cross-build
framework even for TOOLCHAIN_MISSING platforms.
If TOOLCHAIN_MISSING is set to "yes", MKGDB, MKBFD, and MKGCC are all
unconditionally set to "no", since the bits are not there to build.
If EXTERNAL_TOOLCHAIN is set, MKGCC is unconditionally set to "no",
since the external toolchain's compiler is not in-sync with the
in-tree compiler support components (e.g. libgcc).
* Set MACHINE_CPU much earlier in bsd.own.mk, so that more tests in
that file can use it.
2002-09-18 03:18:25 +04:00
|
|
|
# If this platform's toolchain is missing, we obviously cannot build it.
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
* Eliminate the USE_NEW_TOOLCHAIN variable. Instead, split it into
two variables:
TOOLCHAIN_MISSING -- set to "yes" on platforms for which there is
no working in-tree toolchain (hppa, ns32k, sh5, x86_64).
EXTERNAL_TOOLCHAIN -- if defined by the user, points to the root of
an external toolchain (e.g. /usr/local/gnu). This enables the cross-build
framework even for TOOLCHAIN_MISSING platforms.
If TOOLCHAIN_MISSING is set to "yes", MKGDB, MKBFD, and MKGCC are all
unconditionally set to "no", since the bits are not there to build.
If EXTERNAL_TOOLCHAIN is set, MKGCC is unconditionally set to "no",
since the external toolchain's compiler is not in-sync with the
in-tree compiler support components (e.g. libgcc).
* Set MACHINE_CPU much earlier in bsd.own.mk, so that more tests in
that file can use it.
2002-09-18 03:18:25 +04:00
|
|
|
.if ${TOOLCHAIN_MISSING} == "yes"
|
|
|
|
MKBFD:= no
|
|
|
|
MKGDB:= no
|
|
|
|
MKGCC:= no
|
|
|
|
.endif
|
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
* Eliminate the USE_NEW_TOOLCHAIN variable. Instead, split it into
two variables:
TOOLCHAIN_MISSING -- set to "yes" on platforms for which there is
no working in-tree toolchain (hppa, ns32k, sh5, x86_64).
EXTERNAL_TOOLCHAIN -- if defined by the user, points to the root of
an external toolchain (e.g. /usr/local/gnu). This enables the cross-build
framework even for TOOLCHAIN_MISSING platforms.
If TOOLCHAIN_MISSING is set to "yes", MKGDB, MKBFD, and MKGCC are all
unconditionally set to "no", since the bits are not there to build.
If EXTERNAL_TOOLCHAIN is set, MKGCC is unconditionally set to "no",
since the external toolchain's compiler is not in-sync with the
in-tree compiler support components (e.g. libgcc).
* Set MACHINE_CPU much earlier in bsd.own.mk, so that more tests in
that file can use it.
2002-09-18 03:18:25 +04:00
|
|
|
# If we are using an external toolchain, we can still build the target's
|
|
|
|
# BFD stuff, but we cannot build GCC's support libraries, since those are
|
|
|
|
# tightly-coupled to the version of GCC being used.
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
* Eliminate the USE_NEW_TOOLCHAIN variable. Instead, split it into
two variables:
TOOLCHAIN_MISSING -- set to "yes" on platforms for which there is
no working in-tree toolchain (hppa, ns32k, sh5, x86_64).
EXTERNAL_TOOLCHAIN -- if defined by the user, points to the root of
an external toolchain (e.g. /usr/local/gnu). This enables the cross-build
framework even for TOOLCHAIN_MISSING platforms.
If TOOLCHAIN_MISSING is set to "yes", MKGDB, MKBFD, and MKGCC are all
unconditionally set to "no", since the bits are not there to build.
If EXTERNAL_TOOLCHAIN is set, MKGCC is unconditionally set to "no",
since the external toolchain's compiler is not in-sync with the
in-tree compiler support components (e.g. libgcc).
* Set MACHINE_CPU much earlier in bsd.own.mk, so that more tests in
that file can use it.
2002-09-18 03:18:25 +04:00
|
|
|
.if defined(EXTERNAL_TOOLCHAIN)
|
|
|
|
MKGCC:= no
|
|
|
|
.endif
|
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2003-09-01 13:38:42 +04:00
|
|
|
# GCC can produce PIC code for sh3 only starting with gcc3.
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2003-09-01 13:38:42 +04:00
|
|
|
.if ${MACHINE_CPU} == "sh3" && ${HAVE_GCC3} != "yes"
|
2001-12-12 02:25:23 +03:00
|
|
|
NOPIC= # defined
|
2002-02-04 02:52:23 +03:00
|
|
|
.endif
|
2000-08-03 00:04:45 +04:00
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2003-12-08 01:52:56 +03:00
|
|
|
# gcc3 and gdb on sh5 are not ready for prime-time.
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2002-11-26 22:30:13 +03:00
|
|
|
.if ${MACHINE_CPU} == "sh5"
|
2002-07-11 19:00:57 +04:00
|
|
|
NOPROFILE= # defined
|
2003-12-08 01:52:56 +03:00
|
|
|
NOPIC= # defined
|
|
|
|
MKGDB=no
|
2002-07-11 19:00:57 +04:00
|
|
|
.endif
|
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2001-07-13 16:44:22 +04:00
|
|
|
# The m68000 port is incomplete.
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2001-07-13 16:44:22 +04:00
|
|
|
.if ${MACHINE_ARCH} == "m68000"
|
2001-12-12 02:25:23 +03:00
|
|
|
NOPIC= # defined
|
2001-07-13 16:44:22 +04:00
|
|
|
.endif
|
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2002-06-10 18:14:47 +04:00
|
|
|
# The hppa port is incomplete.
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2002-06-10 18:14:47 +04:00
|
|
|
.if ${MACHINE_ARCH} == "hppa"
|
|
|
|
NOLINT= # defined
|
|
|
|
NOPROFILE= # defined
|
|
|
|
.endif
|
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2003-04-12 02:40:31 +04:00
|
|
|
# On the MIPS, all libs are compiled with ABIcalls (and are thus PIC),
|
|
|
|
# not just shared libraries, so don't build the _pic version.
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2003-04-12 02:40:31 +04:00
|
|
|
.if ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
|
|
|
|
MKPICLIB:= no
|
|
|
|
.endif
|
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2003-12-05 15:14:42 +03:00
|
|
|
# Shared libraries are not supported on ns32k with current GNU tools.
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2003-12-05 15:14:42 +03:00
|
|
|
.if ${MACHINE_ARCH} == "ns32k"
|
2002-06-05 06:42:09 +04:00
|
|
|
NOPIC= # defined
|
|
|
|
.endif
|
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2003-04-12 02:40:31 +04:00
|
|
|
# On VAX using ELF, all objects are PIC, not just shared libraries,
|
2003-12-08 01:23:00 +03:00
|
|
|
# so don't build the _pic version. Unless we are using GCC3 which
|
|
|
|
# doesn't support PIC yet.
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2003-12-08 01:33:16 +03:00
|
|
|
.if ${MACHINE_ARCH} == "vax" && ${HAVE_GCC3} != "no"
|
2003-12-08 01:23:00 +03:00
|
|
|
NOPIC= # defined
|
|
|
|
.endif
|
2003-04-12 02:40:31 +04:00
|
|
|
.if ${MACHINE_ARCH} == "vax" && ${OBJECT_FMT} == "ELF"
|
|
|
|
MKPICLIB:= no
|
|
|
|
.endif
|
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
1999-06-10 04:38:49 +04:00
|
|
|
# Location of the file that contains the major and minor numbers of the
|
|
|
|
# version of a shared library. If this file exists a shared library
|
|
|
|
# will be built by <bsd.lib.mk>.
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
1999-06-10 04:38:49 +04:00
|
|
|
SHLIB_VERSION_FILE?= ${.CURDIR}/shlib_version
|
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
1998-05-22 20:43:42 +04:00
|
|
|
# GNU sources and packages sometimes see architecture names differently.
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2002-01-28 22:22:52 +03:00
|
|
|
GNU_ARCH.m68000=m68010
|
2001-01-04 13:29:11 +03:00
|
|
|
GNU_ARCH.sh3eb=sh
|
2001-12-15 04:50:33 +03:00
|
|
|
GNU_ARCH.sh3el=shle
|
2002-11-26 22:30:13 +03:00
|
|
|
GNU_ARCH.sh5eb=sh5
|
|
|
|
GNU_ARCH.sh5el=sh5le
|
2001-08-14 13:31:42 +04:00
|
|
|
MACHINE_GNU_ARCH=${GNU_ARCH.${MACHINE_ARCH}:U${MACHINE_ARCH}}
|
2001-06-02 05:53:29 +04:00
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2001-06-02 05:53:29 +04:00
|
|
|
# In order to identify NetBSD to GNU packages, we sometimes need
|
|
|
|
# an "elf" tag for historically a.out platforms.
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2001-06-02 06:22:35 +04:00
|
|
|
.if ${OBJECT_FMT} == "ELF" && \
|
2001-10-23 21:15:21 +04:00
|
|
|
(${MACHINE_GNU_ARCH} == "arm" || \
|
2002-05-20 18:34:07 +04:00
|
|
|
${MACHINE_GNU_ARCH} == "armeb" || \
|
2002-06-05 06:42:09 +04:00
|
|
|
${MACHINE_ARCH} == "ns32k" || \
|
2001-07-23 21:13:44 +04:00
|
|
|
${MACHINE_ARCH} == "i386" || \
|
2001-06-02 05:53:29 +04:00
|
|
|
${MACHINE_ARCH} == "m68k" || \
|
2002-01-28 04:44:19 +03:00
|
|
|
${MACHINE_ARCH} == "m68000" || \
|
2001-12-15 03:39:08 +03:00
|
|
|
${MACHINE_GNU_ARCH} == "sh" || \
|
2001-12-15 04:50:33 +03:00
|
|
|
${MACHINE_GNU_ARCH} == "shle" || \
|
2001-07-23 21:13:44 +04:00
|
|
|
${MACHINE_ARCH} == "sparc" || \
|
|
|
|
${MACHINE_ARCH} == "vax")
|
2002-11-26 22:51:16 +03:00
|
|
|
MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf
|
2001-06-02 05:53:29 +04:00
|
|
|
.else
|
2002-11-26 22:51:16 +03:00
|
|
|
MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsd
|
2001-06-02 05:53:29 +04:00
|
|
|
.endif
|
2001-01-08 10:28:07 +03:00
|
|
|
|
2001-06-01 21:49:32 +04:00
|
|
|
TARGETS+= all clean cleandir depend dependall includes \
|
2000-09-22 09:37:57 +04:00
|
|
|
install lint obj regress tags html installhtml cleanhtml
|
1999-09-14 05:31:11 +04:00
|
|
|
.PHONY: all clean cleandir depend dependall distclean includes \
|
|
|
|
install lint obj regress tags beforedepend afterdepend \
|
2000-09-22 09:37:57 +04:00
|
|
|
beforeinstall afterinstall realinstall realdepend realall \
|
2002-01-27 02:53:00 +03:00
|
|
|
html installhtml cleanhtml subdir-all subdir-install subdir-depend
|
1997-05-07 19:53:28 +04:00
|
|
|
|
1999-02-12 04:10:06 +03:00
|
|
|
.if ${NEED_OWN_INSTALL_TARGET} == "yes"
|
1997-10-23 16:44:28 +04:00
|
|
|
.if !target(install)
|
1997-10-27 22:41:05 +03:00
|
|
|
install: .NOTMAIN beforeinstall subdir-install realinstall afterinstall
|
|
|
|
beforeinstall: .NOTMAIN
|
|
|
|
subdir-install: .NOTMAIN beforeinstall
|
|
|
|
realinstall: .NOTMAIN beforeinstall
|
|
|
|
afterinstall: .NOTMAIN subdir-install realinstall
|
1997-05-07 19:53:28 +04:00
|
|
|
.endif
|
2000-01-22 22:31:00 +03:00
|
|
|
all: .NOTMAIN realall subdir-all
|
|
|
|
subdir-all: .NOTMAIN
|
|
|
|
realall: .NOTMAIN
|
|
|
|
depend: .NOTMAIN realdepend subdir-depend
|
|
|
|
subdir-depend: .NOTMAIN
|
|
|
|
realdepend: .NOTMAIN
|
2001-06-01 21:49:32 +04:00
|
|
|
distclean: .NOTMAIN cleandir
|
2001-08-14 11:02:13 +04:00
|
|
|
cleandir: .NOTMAIN clean
|
2001-11-02 08:21:47 +03:00
|
|
|
|
|
|
|
dependall: .NOTMAIN realdepend .MAKE
|
|
|
|
@cd ${.CURDIR}; ${MAKE} realall
|
2000-01-22 22:53:53 +03:00
|
|
|
.endif
|
1998-04-13 16:03:07 +04:00
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
1999-02-12 04:10:06 +03:00
|
|
|
# Define MKxxx variables (which are either yes or no) for users
|
2003-07-28 11:03:43 +04:00
|
|
|
# to set in /etc/mk.conf and override in the make environment.
|
1999-02-12 04:10:06 +03:00
|
|
|
# These should be tested with `== "no"' or `!= "no"'.
|
2003-07-18 06:52:51 +04:00
|
|
|
# The NOxxx variables should only be set by Makefiles.
|
1999-02-12 04:10:06 +03:00
|
|
|
#
|
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2001-12-12 02:25:23 +03:00
|
|
|
# Supported NO* options (if defined, MK* will be forced to "no",
|
|
|
|
# regardless of user's mk.conf setting).
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2003-07-18 06:52:51 +04:00
|
|
|
.for var in CRYPTO DOC HTML LINKLIB LINT MAN NLS OBJ PIC PICINSTALL PROFILE \
|
2003-09-13 23:08:26 +04:00
|
|
|
SHARE STATICLIB
|
2001-12-12 02:25:23 +03:00
|
|
|
.if defined(NO${var})
|
|
|
|
MK${var}:= no
|
1999-02-12 15:38:44 +03:00
|
|
|
.endif
|
2001-12-12 02:25:23 +03:00
|
|
|
.endfor
|
1999-02-12 04:10:06 +03:00
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
|
|
|
# Older-style variables that enabled behaviour when set.
|
|
|
|
#
|
|
|
|
.for var in MANZ UNPRIVED UPDATE
|
|
|
|
.if defined(${var})
|
|
|
|
MK${var}:= yes
|
2002-02-07 03:53:34 +03:00
|
|
|
.endif
|
2003-07-18 12:26:01 +04:00
|
|
|
.endfor
|
2002-02-07 03:53:34 +03:00
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2001-12-12 02:25:23 +03:00
|
|
|
# MK* options which default to "yes".
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2003-10-19 03:40:36 +04:00
|
|
|
.for var in BFD BINUTILS \
|
|
|
|
CATPAGES CRYPTO CVS \
|
|
|
|
DOC \
|
|
|
|
GCC GCCCMDS GDB \
|
|
|
|
HESIOD HTML \
|
2003-12-05 05:35:24 +03:00
|
|
|
IEEEFP INET6 INFO \
|
2003-10-19 03:40:36 +04:00
|
|
|
KERBEROS KERBEROS4 \
|
|
|
|
LINKLIB LINT \
|
|
|
|
MAN \
|
|
|
|
NLS \
|
|
|
|
OBJ \
|
|
|
|
PIC PICINSTALL PICLIB POSTFIX PROFILE \
|
|
|
|
SENDMAIL SHARE STATICLIB SKEY \
|
|
|
|
UUCP \
|
|
|
|
YP
|
2001-12-12 02:25:23 +03:00
|
|
|
MK${var}?= yes
|
|
|
|
.endfor
|
1999-02-12 04:10:06 +03:00
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2001-12-12 02:25:23 +03:00
|
|
|
# MK* options which default to "no".
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2003-07-28 12:53:53 +04:00
|
|
|
.for var in CRYPTO_IDEA CRYPTO_MDC2 CRYPTO_RC5 \
|
2003-07-28 11:03:43 +04:00
|
|
|
MANZ OBJDIRS SOFTFLOAT UNPRIVED UPDATE
|
2001-12-12 02:25:23 +03:00
|
|
|
MK${var}?= no
|
|
|
|
.endfor
|
1999-02-12 04:10:06 +03:00
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2001-12-12 02:25:23 +03:00
|
|
|
# Force some options off if their dependencies are off.
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
|
|
|
|
2001-12-12 02:25:23 +03:00
|
|
|
.if ${MKCRYPTO} == "no"
|
2003-07-23 12:01:24 +04:00
|
|
|
MKKERBEROS4:= no
|
2001-12-12 02:25:23 +03:00
|
|
|
MKKERBEROS:= no
|
1999-02-12 04:10:06 +03:00
|
|
|
.endif
|
|
|
|
|
2003-07-18 06:52:51 +04:00
|
|
|
.if ${MKMAN} == "no"
|
2003-07-18 12:26:01 +04:00
|
|
|
MKCATPAGES:= no
|
2003-07-18 06:52:51 +04:00
|
|
|
MKHTML:= no
|
|
|
|
.endif
|
|
|
|
|
2001-12-12 02:25:23 +03:00
|
|
|
.if ${MKLINKLIB} == "no"
|
|
|
|
MKPICINSTALL:= no
|
|
|
|
MKPROFILE:= no
|
1999-02-12 04:10:06 +03:00
|
|
|
.endif
|
|
|
|
|
2003-04-12 02:40:31 +04:00
|
|
|
.if ${MKPIC} == "no"
|
|
|
|
MKPICLIB:= no
|
|
|
|
.endif
|
|
|
|
|
2001-12-12 02:25:23 +03:00
|
|
|
.if ${MKOBJ} == "no"
|
|
|
|
MKOBJDIRS:= no
|
1999-02-12 04:10:06 +03:00
|
|
|
.endif
|
|
|
|
|
1999-02-12 15:38:44 +03:00
|
|
|
.if ${MKSHARE} == "no"
|
2001-12-12 02:25:23 +03:00
|
|
|
MKCATPAGES:= no
|
|
|
|
MKDOC:= no
|
|
|
|
MKINFO:= no
|
2003-07-18 12:26:01 +04:00
|
|
|
MKHTML:= no
|
2001-12-12 02:25:23 +03:00
|
|
|
MKMAN:= no
|
|
|
|
MKNLS:= no
|
1999-02-12 15:38:44 +03:00
|
|
|
.endif
|
1999-02-12 04:10:06 +03:00
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
|
|
|
# install(1) parameters.
|
|
|
|
#
|
|
|
|
COPY?= -c
|
|
|
|
.if ${MKUPDATE} == "no"
|
|
|
|
PRESERVE?=
|
|
|
|
.else
|
|
|
|
PRESERVE?= -p
|
|
|
|
.endif
|
|
|
|
RENAME?= -r
|
|
|
|
HRDLINK?= -l h
|
|
|
|
SYMLINK?= -l s
|
|
|
|
|
|
|
|
METALOG?= ${DESTDIR}/METALOG
|
|
|
|
METALOG.add?= ${TOOL_CAT} -l >> ${METALOG}
|
|
|
|
.if (${_SRC_TOP_} != "") # only set INSTPRIV if inside ${NETBSDSRCDIR}
|
|
|
|
.if ${MKUNPRIVED} != "no"
|
|
|
|
INSTPRIV.unpriv=-U -M ${METALOG} -D ${DESTDIR}
|
|
|
|
.else
|
|
|
|
INSTPRIV.unpriv=
|
|
|
|
.endif
|
|
|
|
INSTPRIV?= ${INSTPRIV.unpriv} -N ${NETBSDSRCDIR}/etc
|
|
|
|
.endif
|
|
|
|
SYSPKGTAG?= ${SYSPKG:D-T ${SYSPKG}_pkg}
|
|
|
|
SYSPKGDOCTAG?= ${SYSPKG:D-T ${SYSPKG}-doc_pkg}
|
|
|
|
STRIPFLAG?= -s
|
|
|
|
|
|
|
|
.if ${NEED_OWN_INSTALL_TARGET} == "yes"
|
|
|
|
INSTALL_DIR?= ${INSTALL} ${INSTPRIV} -d
|
|
|
|
INSTALL_FILE?= ${INSTALL} ${INSTPRIV} ${COPY} ${PRESERVE} ${RENAME}
|
|
|
|
INSTALL_LINK?= ${INSTALL} ${INSTPRIV} ${HRDLINK} ${RENAME}
|
|
|
|
INSTALL_SYMLINK?= ${INSTALL} ${INSTPRIV} ${SYMLINK} ${RENAME}
|
|
|
|
HOST_INSTALL_FILE?= ${INSTALL} ${COPY} ${PRESERVE} ${RENAME}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
#
|
2003-07-28 12:53:53 +04:00
|
|
|
# Set defaults for the USE_xxx variables.
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# USE_* options which default to "yes" unless their corresponding MK*
|
|
|
|
# variable is set to "no".
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2003-12-05 05:35:24 +03:00
|
|
|
.for var in HESIOD INET6 KERBEROS KERBEROS4 SKEY YP
|
Split the notion of building Hesiod, Kerberos, S/key, and YP
infrastructure and using that infrastructure in programs.
* MKHESIOD, MKKERBEROS, MKSKEY, and MKYP control building
of the infratsructure (libraries, support programs, etc.)
* USE_HESIOD, USE_KERBEROS, USE_SKEY, and USE_YP control
building of support for using the corresponding API
in various libraries/programs that can use it.
As discussed on tech-toolchain.
2002-03-22 21:10:19 +03:00
|
|
|
.if (${MK${var}} == "no")
|
|
|
|
USE_${var}:= no
|
|
|
|
.else
|
|
|
|
USE_${var}?= yes
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
2003-07-28 12:53:53 +04:00
|
|
|
#
|
|
|
|
# USE_* options which default to "yes".
|
|
|
|
#
|
|
|
|
.for var in LIBSTDCXX
|
|
|
|
USE_${var}?= yes
|
|
|
|
.endfor
|
|
|
|
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2003-11-03 03:30:34 +03:00
|
|
|
# Use XFree86 4.x as default version on i386, amd64, macppc, cats, sgimips,
|
|
|
|
# and sparc*.
|
2003-07-18 12:26:01 +04:00
|
|
|
#
|
2003-04-27 14:15:01 +04:00
|
|
|
.if ${MACHINE_ARCH} == "i386" || ${MACHINE} == "amd64" || \
|
2003-07-22 15:48:59 +04:00
|
|
|
${MACHINE} == "macppc" || ${MACHINE} == "cats" || \
|
2003-11-03 03:30:34 +03:00
|
|
|
${MACHINE} == "sgimips" || \
|
2003-08-29 14:51:21 +04:00
|
|
|
${MACHINE} == "sparc" || ${MACHINE} == "sparc64"
|
2002-07-03 15:51:34 +04:00
|
|
|
USE_XF86_4?= yes
|
|
|
|
.endif
|
|
|
|
|
2003-09-12 11:44:10 +04:00
|
|
|
#
|
|
|
|
# Where X11R6 sources are and where it is installed to
|
|
|
|
#
|
|
|
|
X11SRCDIR?= /usr/xsrc
|
|
|
|
X11SRCDIR.xc?= ${X11SRCDIR}/xfree/xc
|
|
|
|
X11SRCDIR.local?= ${X11SRCDIR}/local
|
|
|
|
X11ROOTDIR?= /usr/X11R6
|
|
|
|
X11BINDIR?= ${X11ROOTDIR}/bin
|
|
|
|
X11FONTDIR?= ${X11ROOTDIR}/lib/X11/fonts
|
|
|
|
X11INCDIR?= ${X11ROOTDIR}/include
|
|
|
|
X11LIBDIR?= ${X11ROOTDIR}/lib/X11
|
|
|
|
X11MANDIR?= ${X11ROOTDIR}/man
|
|
|
|
X11USRLIBDIR?= ${X11ROOTDIR}/lib
|
|
|
|
|
2003-10-21 20:36:58 +04:00
|
|
|
|
|
|
|
#
|
|
|
|
# MAKEVERBOSE support. Levels are:
|
2003-10-26 05:17:46 +03:00
|
|
|
# 0 No messages
|
|
|
|
# 1 Enable info messages, suppress command output
|
|
|
|
# 2 Enable info messages and command output
|
2003-10-21 20:36:58 +04:00
|
|
|
#
|
|
|
|
MAKEVERBOSE?= 2
|
|
|
|
|
|
|
|
.if ${MAKEVERBOSE} == 0
|
|
|
|
_MKMSG?= @\#
|
|
|
|
_MKSHMSG?= : echo
|
|
|
|
_MKSHECHO?= : echo
|
2003-10-26 05:17:46 +03:00
|
|
|
.SILENT:
|
2003-10-21 20:36:58 +04:00
|
|
|
.elif ${MAKEVERBOSE} == 1
|
|
|
|
_MKMSG?= @echo ' '
|
|
|
|
_MKSHMSG?= echo ' '
|
|
|
|
_MKSHECHO?= : echo
|
2003-10-26 05:17:46 +03:00
|
|
|
.SILENT:
|
2003-10-21 20:36:58 +04:00
|
|
|
.else # MAKEVERBOSE == 2 ?
|
|
|
|
_MKMSG?= @echo '\# '
|
|
|
|
_MKSHMSG?= echo '\# '
|
|
|
|
_MKSHECHO?= echo
|
2003-10-26 05:17:46 +03:00
|
|
|
.SILENT: __makeverbose_dummy_target__
|
2003-10-21 20:36:58 +04:00
|
|
|
.endif
|
|
|
|
|
|
|
|
_MKMSG_BUILD?= ${_MKMSG} " build "
|
|
|
|
_MKMSG_CREATE?= ${_MKMSG} " create "
|
|
|
|
_MKMSG_COMPILE?= ${_MKMSG} "compile "
|
|
|
|
_MKMSG_FORMAT?= ${_MKMSG} " format "
|
|
|
|
_MKMSG_INSTALL?= ${_MKMSG} "install "
|
|
|
|
_MKMSG_LINK?= ${_MKMSG} " link "
|
|
|
|
_MKMSG_LEX?= ${_MKMSG} " lex "
|
|
|
|
_MKMSG_REMOVE?= ${_MKMSG} " remove "
|
|
|
|
_MKMSG_YACC?= ${_MKMSG} " yacc "
|
|
|
|
|
2003-11-07 03:05:24 +03:00
|
|
|
_MKSHMSG_CREATE?= ${_MKSHMSG} " create "
|
|
|
|
_MKSHMSG_INSTALL?= ${_MKSHMSG} "install "
|
|
|
|
|
2003-11-24 08:44:59 +03:00
|
|
|
_MKTARGET_BUILD?= ${_MKMSG_BUILD} ${.CURDIR:T}/${.TARGET}
|
|
|
|
_MKTARGET_CREATE?= ${_MKMSG_CREATE} ${.CURDIR:T}/${.TARGET}
|
|
|
|
_MKTARGET_COMPILE?= ${_MKMSG_COMPILE} ${.CURDIR:T}/${.TARGET}
|
|
|
|
_MKTARGET_FORMAT?= ${_MKMSG_FORMAT} ${.CURDIR:T}/${.TARGET}
|
|
|
|
_MKTARGET_INSTALL?= ${_MKMSG_INSTALL} ${.TARGET}
|
|
|
|
_MKTARGET_LINK?= ${_MKMSG_LINK} ${.CURDIR:T}/${.TARGET}
|
|
|
|
_MKTARGET_LEX?= ${_MKMSG_LEX} ${.CURDIR:T}/${.TARGET}
|
|
|
|
_MKTARGET_REMOVE?= ${_MKMSG_REMOVE} ${.TARGET}
|
|
|
|
_MKTARGET_YACC?= ${_MKMSG_YACC} ${.CURDIR:T}/${.TARGET}
|
2003-10-21 20:36:58 +04:00
|
|
|
|
2003-07-28 06:38:33 +04:00
|
|
|
.endif # !defined(_BSD_OWN_MK_)
|