818 lines
21 KiB
Makefile
818 lines
21 KiB
Makefile
# $NetBSD: bsd.own.mk,v 1.491 2006/12/29 15:52:20 pooka Exp $
|
|
|
|
.if !defined(_BSD_OWN_MK_)
|
|
_BSD_OWN_MK_=1
|
|
|
|
MAKECONF?= /etc/mk.conf
|
|
.-include "${MAKECONF}"
|
|
|
|
#
|
|
# CPU model, derived from MACHINE_ARCH
|
|
#
|
|
MACHINE_CPU= ${MACHINE_ARCH:C/mipse[bl]/mips/:C/mips64e[bl]/mips/:C/sh3e[bl]/sh3/:C/sh5e[bl]/sh5/:S/m68000/m68k/:S/armeb/arm/}
|
|
|
|
#
|
|
# Subdirectory used below ${RELEASEDIR} when building a release
|
|
#
|
|
RELEASEMACHINEDIR?= ${MACHINE}
|
|
|
|
#
|
|
# Subdirectory or path component used for the following paths:
|
|
# distrib/${RELEASEMACHINE}
|
|
# distrib/notes/${RELEASEMACHINE}
|
|
# etc/etc.${RELEASEMACHINE}
|
|
# Used when building a release.
|
|
#
|
|
RELEASEMACHINE?= ${MACHINE}
|
|
|
|
#
|
|
# 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.
|
|
#
|
|
NEED_OWN_INSTALL_TARGET?= yes
|
|
|
|
#
|
|
# This lists the platforms which do not have working in-tree toolchains.
|
|
# 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.
|
|
#
|
|
TOOLCHAIN_MISSING?= no
|
|
|
|
#
|
|
# Transitional for toolchain upgrade to GCC4.1
|
|
#
|
|
# not working:
|
|
# ns32k
|
|
#
|
|
.if \
|
|
${MACHINE_ARCH} == "ns32k"
|
|
HAVE_GCC?= 3
|
|
.endif
|
|
|
|
# default to GCC4
|
|
HAVE_GCC?= 4
|
|
|
|
#
|
|
# Transitional for toolchain upgrade to GDB6
|
|
#
|
|
.if \
|
|
${MACHINE_CPU} == "arm" || \
|
|
${MACHINE_ARCH} == "i386" || \
|
|
${MACHINE_ARCH} == "powerpc" || \
|
|
${MACHINE_ARCH} == "sparc64"
|
|
HAVE_GDB?= 6
|
|
.endif
|
|
|
|
HAVE_GDB?= 5
|
|
|
|
CPPFLAG_ISYSTEM= -isystem
|
|
.if ${HAVE_GCC} == 3
|
|
CPPFLAG_ISYSTEMXX= -isystem-cxx
|
|
.else # GCC 4
|
|
CPPFLAG_ISYSTEMXX= -cxx-isystem
|
|
.endif
|
|
|
|
.if empty(.MAKEFLAGS:M-V*)
|
|
.if defined(MAKEOBJDIRPREFIX) || defined(MAKEOBJDIR)
|
|
PRINTOBJDIR= ${MAKE} -r -V .OBJDIR -f /dev/null xxx
|
|
.else
|
|
PRINTOBJDIR= ${MAKE} -V .OBJDIR
|
|
.endif
|
|
.else
|
|
PRINTOBJDIR= echo # prevent infinite recursion
|
|
.endif
|
|
|
|
#
|
|
# 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.
|
|
#
|
|
.if !defined(_SRC_TOP_) # {
|
|
_SRC_TOP_!= cd ${.CURDIR}; while :; do \
|
|
here=`pwd`; \
|
|
[ -f build.sh ] && [ -d tools ] && { echo $$here; break; }; \
|
|
case $$here in /) echo ""; break;; esac; \
|
|
cd ..; done
|
|
|
|
.MAKEOVERRIDES+= _SRC_TOP_
|
|
|
|
.endif # }
|
|
|
|
#
|
|
# If _SRC_TOP_ != "", we're within the NetBSD source tree, so set
|
|
# defaults for NETBSDSRCDIR and _SRC_TOP_OBJ_.
|
|
#
|
|
.if (${_SRC_TOP_} != "") # {
|
|
|
|
NETBSDSRCDIR?= ${_SRC_TOP_}
|
|
|
|
.if !defined(_SRC_TOP_OBJ_)
|
|
_SRC_TOP_OBJ_!= cd ${_SRC_TOP_} && ${PRINTOBJDIR}
|
|
.MAKEOVERRIDES+= _SRC_TOP_OBJ_
|
|
.endif
|
|
|
|
.endif # _SRC_TOP_ != "" # }
|
|
|
|
|
|
.if (${_SRC_TOP_} != "") && \
|
|
(${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN))
|
|
USETOOLS?= yes
|
|
.endif
|
|
USETOOLS?= no
|
|
|
|
|
|
.if ${MACHINE_ARCH} == "mips" || ${MACHINE_ARCH} == "mips64" || \
|
|
${MACHINE_ARCH} == "sh3" || ${MACHINE_ARCH} == "sh5"
|
|
.BEGIN:
|
|
@echo "Must set MACHINE_ARCH to one of ${MACHINE_ARCH}eb or ${MACHINE_ARCH}el"
|
|
@false
|
|
.elif defined(REQUIRETOOLS) && \
|
|
(${TOOLCHAIN_MISSING} == "no" || defined(EXTERNAL_TOOLCHAIN)) && \
|
|
${USETOOLS} == "no"
|
|
.BEGIN:
|
|
@echo "USETOOLS=no, but this component requires a version-specific host toolchain"
|
|
@false
|
|
.endif
|
|
|
|
#
|
|
# Host platform information; may be overridden
|
|
#
|
|
.if !defined(HOST_OSTYPE)
|
|
_HOST_OSNAME!= uname -s
|
|
_HOST_OSREL!= uname -r
|
|
_HOST_ARCH!= uname -p 2>/dev/null || uname -m
|
|
HOST_OSTYPE:= ${_HOST_OSNAME}-${_HOST_OSREL:C/\([^\)]*\)//g:[*]:C/ /_/g}-${_HOST_ARCH:C/\([^\)]*\)//g:[*]:C/ /_/g}
|
|
.MAKEOVERRIDES+= HOST_OSTYPE
|
|
.endif
|
|
HOST_CYGWIN= ${HOST_OSTYPE:MCYGWIN*}
|
|
|
|
.if ${USETOOLS} == "yes" # {
|
|
|
|
#
|
|
# Provide a default for TOOLDIR.
|
|
#
|
|
.if !defined(TOOLDIR)
|
|
TOOLDIR:= ${_SRC_TOP_OBJ_}/tooldir.${HOST_OSTYPE}
|
|
.MAKEOVERRIDES+= TOOLDIR
|
|
.endif
|
|
|
|
#
|
|
# This is the prefix used for the NetBSD-sourced tools.
|
|
#
|
|
_TOOL_PREFIX?= nb
|
|
|
|
#
|
|
# If an external toolchain base is specified, use it.
|
|
#
|
|
.if defined(EXTERNAL_TOOLCHAIN) # {
|
|
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
|
|
.else # } {
|
|
# Define default locations for common tools.
|
|
.if ${USETOOLS_BINUTILS:Uyes} == "yes" # {
|
|
AR= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-ar
|
|
AS= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-as
|
|
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
|
|
.endif # }
|
|
|
|
.if ${USETOOLS_GCC:Uyes} == "yes" # {
|
|
CC= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-gcc
|
|
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
|
|
.endif # }
|
|
.endif # EXTERNAL_TOOLCHAIN # }
|
|
|
|
HOST_MKDEP= ${TOOLDIR}/bin/${_TOOL_PREFIX}host-mkdep
|
|
|
|
DBSYM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-dbsym
|
|
ELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
|
|
INSTALL= STRIP=${STRIP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}install
|
|
LEX= ${TOOLDIR}/bin/${_TOOL_PREFIX}lex
|
|
LINT= CC=${CC:Q} ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-lint
|
|
LORDER= NM=${NM:Q} MKTEMP=${TOOL_MKTEMP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}lorder
|
|
MKDEP= CC=${CC:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}mkdep
|
|
PAXCTL= ${TOOLDIR}/bin/${_TOOL_PREFIX}paxctl
|
|
TSORT= ${TOOLDIR}/bin/${_TOOL_PREFIX}tsort -q
|
|
YACC= ${TOOLDIR}/bin/${_TOOL_PREFIX}yacc
|
|
|
|
TOOL_AMIGAAOUT2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-aout2bb
|
|
TOOL_AMIGAELF2BB= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-elf2bb
|
|
TOOL_AMIGATXLT= ${TOOLDIR}/bin/${_TOOL_PREFIX}amiga-txlt
|
|
TOOL_ASN1_COMPILE= ${TOOLDIR}/bin/${_TOOL_PREFIX}asn1_compile
|
|
TOOL_BEBOXELF2PEF= ${TOOLDIR}/bin/${_TOOL_PREFIX}bebox-elf2pef
|
|
TOOL_BEBOXMKBOOTIMAGE= ${TOOLDIR}/bin/${_TOOL_PREFIX}bebox-mkbootimage
|
|
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_GENASSYM= ${TOOLDIR}/bin/${_TOOL_PREFIX}genassym
|
|
TOOL_GENCAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}gencat
|
|
TOOL_GMAKE= ${TOOLDIR}/bin/${_TOOL_PREFIX}gmake
|
|
TOOL_GROFF= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}groff
|
|
TOOL_HEXDUMP= ${TOOLDIR}/bin/${_TOOL_PREFIX}hexdump
|
|
TOOL_HP300MKBOOT= ${TOOLDIR}/bin/${_TOOL_PREFIX}hp300-mkboot
|
|
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_MACPPCFIXCOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}macppc-fixcoff
|
|
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_DISKLABEL= ${TOOLDIR}/bin/nbdisklabel-${MAKEWRAPPERMACHINE}
|
|
TOOL_FDISK= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-fdisk
|
|
TOOL_MENUC= MENUDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/${_TOOL_PREFIX}menuc
|
|
TOOL_MIPSELF2ECOFF= ${TOOLDIR}/bin/${_TOOL_PREFIX}mips-elf2ecoff
|
|
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
|
|
TOOL_ROFF_HTML= ${TOOL_GROFF} -Tlatin1 -mdoc2html
|
|
TOOL_ROFF_PS= ${TOOL_GROFF} -Tps
|
|
TOOL_ROFF_RAW= ${TOOL_GROFF} -Z
|
|
TOOL_RPCGEN= CPP=${CPP:Q} ${TOOLDIR}/bin/${_TOOL_PREFIX}rpcgen
|
|
TOOL_SED= ${TOOLDIR}/bin/${_TOOL_PREFIX}sed
|
|
TOOL_SOELIM= ${TOOLDIR}/bin/${_TOOL_PREFIX}soelim
|
|
TOOL_STAT= ${TOOLDIR}/bin/${_TOOL_PREFIX}stat
|
|
TOOL_SPARKCRC= ${TOOLDIR}/bin/${_TOOL_PREFIX}sparkcrc
|
|
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
|
|
|
|
.endif # USETOOLS == yes # }
|
|
|
|
#
|
|
# 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
|
|
|
|
|
|
.if ${USETOOLS} == "yes" # {
|
|
#
|
|
# 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.
|
|
#
|
|
DESTDIR?=
|
|
.endif # }
|
|
|
|
#
|
|
# 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
|
|
#
|
|
# 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>.
|
|
#
|
|
MKDYNAMICROOT?= yes
|
|
|
|
#
|
|
# 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
|
|
NETBSDSRCDIR?= ${BSDSRCDIR}
|
|
|
|
BINGRP?= wheel
|
|
BINOWN?= root
|
|
BINMODE?= 555
|
|
NONBINMODE?= 444
|
|
|
|
MANDIR?= /usr/share/man
|
|
MANGRP?= wheel
|
|
MANOWN?= root
|
|
MANMODE?= ${NONBINMODE}
|
|
MANINSTALL?= maninstall catinstall
|
|
|
|
INFODIR?= /usr/share/info
|
|
INFOGRP?= wheel
|
|
INFOOWN?= root
|
|
INFOMODE?= ${NONBINMODE}
|
|
|
|
LIBDIR?= /usr/lib
|
|
|
|
LINTLIBDIR?= /usr/libdata/lint
|
|
LIBGRP?= ${BINGRP}
|
|
LIBOWN?= ${BINOWN}
|
|
LIBMODE?= ${NONBINMODE}
|
|
|
|
DOCDIR?= /usr/share/doc
|
|
HTMLDOCDIR?= /usr/share/doc/html
|
|
DOCGRP?= wheel
|
|
DOCOWN?= root
|
|
DOCMODE?= ${NONBINMODE}
|
|
|
|
NLSDIR?= /usr/share/nls
|
|
NLSGRP?= wheel
|
|
NLSOWN?= root
|
|
NLSMODE?= ${NONBINMODE}
|
|
|
|
KMODDIR?= /usr/lkm
|
|
KMODGRP?= wheel
|
|
KMODOWN?= root
|
|
KMODMODE?= ${NONBINMODE}
|
|
|
|
LOCALEDIR?= /usr/share/locale
|
|
LOCALEGRP?= wheel
|
|
LOCALEOWN?= root
|
|
LOCALEMODE?= ${NONBINMODE}
|
|
|
|
FIRMWAREDIR?= /libdata/firmware
|
|
FIRMWAREGRP?= wheel
|
|
FIRMWAREOWN?= root
|
|
FIRMWAREMODE?= ${NONBINMODE}
|
|
|
|
DEBUGDIR?= /usr/libdata/debug
|
|
DEBUGGRP?= wheel
|
|
DEBUGOWN?= root
|
|
DEBUGMODE?= ${NONBINMODE}
|
|
|
|
#
|
|
# Data-driven table using make variables to control how
|
|
# toolchain-dependent targets and shared libraries are built
|
|
# for different platforms and object formats.
|
|
#
|
|
# OBJECT_FMT: currently either "ELF" or "a.out".
|
|
#
|
|
# All platforms are ELF, except for ns32k (which does not yet have
|
|
# an ELF BFD back-end).
|
|
#
|
|
.if ${MACHINE_ARCH} == "ns32k"
|
|
OBJECT_FMT?= a.out # allow overrides, to ease transition
|
|
.else
|
|
OBJECT_FMT= ELF
|
|
.endif
|
|
|
|
#
|
|
# If this platform's toolchain is missing, we obviously cannot build it.
|
|
#
|
|
.if ${TOOLCHAIN_MISSING} != "no"
|
|
MKBFD:= no
|
|
MKGDB:= no
|
|
MKGCC:= no
|
|
.endif
|
|
|
|
#
|
|
# 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.
|
|
#
|
|
.if defined(EXTERNAL_TOOLCHAIN)
|
|
MKGCC:= no
|
|
.endif
|
|
|
|
#
|
|
# gcc3 and gdb on sh5 are not ready for prime-time.
|
|
#
|
|
.if ${MACHINE_CPU} == "sh5"
|
|
NOPROFILE= # defined
|
|
NOPIC= # defined
|
|
MKGDB=no
|
|
.endif
|
|
|
|
#
|
|
# The m68000 port is incomplete.
|
|
#
|
|
.if ${MACHINE_ARCH} == "m68000"
|
|
NOPIC= # defined
|
|
MKISCSI= no
|
|
# XXX GCC 4 outputs mcount() calling sequences that try to load values
|
|
# from over 64KB away and this fails to assemble.
|
|
.if ${HAVE_GCC} == 4
|
|
NOPROFILE= # defined
|
|
.endif
|
|
.endif
|
|
|
|
#
|
|
# The hppa port is incomplete.
|
|
#
|
|
.if ${MACHINE_ARCH} == "hppa"
|
|
MKGDB= no
|
|
.endif
|
|
|
|
#
|
|
# The ia64 port is incomplete.
|
|
#
|
|
.if ${MACHINE_ARCH} == "ia64"
|
|
MKLINT= no
|
|
MKGDB= no
|
|
.endif
|
|
|
|
#
|
|
# On the MIPS, all libs are compiled with ABIcalls (and are thus PIC),
|
|
# not just shared libraries, so don't build the _pic version.
|
|
#
|
|
.if ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb"
|
|
MKPICLIB:= no
|
|
.endif
|
|
|
|
#
|
|
# Shared libraries are not supported on ns32k with current GNU tools.
|
|
# Disable native gdb too.
|
|
#
|
|
.if ${MACHINE_ARCH} == "ns32k"
|
|
NOPIC= # defined
|
|
MKGDB= no
|
|
.endif
|
|
|
|
#
|
|
# On VAX using ELF, all objects are PIC, not just shared libraries,
|
|
# so don't build the _pic version. Unless we are using GCC3 which
|
|
# doesn't support PIC yet.
|
|
#
|
|
.if ${MACHINE_ARCH} == "vax" && ${HAVE_GCC} >= 3
|
|
NOPIC= # defined
|
|
.endif
|
|
.if ${MACHINE_ARCH} == "vax" && ${OBJECT_FMT} == "ELF"
|
|
MKPICLIB:= no
|
|
.endif
|
|
|
|
#
|
|
# 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>.
|
|
#
|
|
SHLIB_VERSION_FILE?= ${.CURDIR}/shlib_version
|
|
|
|
#
|
|
# GNU sources and packages sometimes see architecture names differently.
|
|
#
|
|
GNU_ARCH.m68000=m68010
|
|
GNU_ARCH.sh3eb=sh
|
|
GNU_ARCH.sh3el=shle
|
|
GNU_ARCH.sh5eb=sh5
|
|
GNU_ARCH.sh5el=sh5le
|
|
GNU_ARCH.mips64eb=mips64
|
|
MACHINE_GNU_ARCH=${GNU_ARCH.${MACHINE_ARCH}:U${MACHINE_ARCH}}
|
|
|
|
#
|
|
# In order to identify NetBSD to GNU packages, we sometimes need
|
|
# an "elf" tag for historically a.out platforms.
|
|
#
|
|
.if ${OBJECT_FMT} == "ELF" && \
|
|
(${MACHINE_GNU_ARCH} == "arm" || \
|
|
${MACHINE_GNU_ARCH} == "armeb" || \
|
|
${MACHINE_ARCH} == "ns32k" || \
|
|
${MACHINE_ARCH} == "i386" || \
|
|
${MACHINE_ARCH} == "m68k" || \
|
|
${MACHINE_ARCH} == "m68000" || \
|
|
${MACHINE_GNU_ARCH} == "sh" || \
|
|
${MACHINE_GNU_ARCH} == "shle" || \
|
|
${MACHINE_ARCH} == "sparc" || \
|
|
${MACHINE_ARCH} == "vax")
|
|
MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsdelf
|
|
.else
|
|
MACHINE_GNU_PLATFORM?=${MACHINE_GNU_ARCH}--netbsd
|
|
.endif
|
|
|
|
TARGETS+= all clean cleandir depend dependall includes \
|
|
install lint obj regress tags html installhtml cleanhtml
|
|
PHONY_NOTMAIN = all clean cleandir depend dependall distclean includes \
|
|
install lint obj regress tags beforedepend afterdepend \
|
|
beforeinstall afterinstall realinstall realdepend realall \
|
|
html installhtml cleanhtml subdir-all subdir-install subdir-depend
|
|
.PHONY: ${PHONY_NOTMAIN}
|
|
.NOTMAIN: ${PHONY_NOTMAIN}
|
|
|
|
.if ${NEED_OWN_INSTALL_TARGET} != "no"
|
|
.if !target(install)
|
|
install: beforeinstall .WAIT subdir-install realinstall .WAIT afterinstall
|
|
beforeinstall:
|
|
subdir-install:
|
|
realinstall:
|
|
afterinstall:
|
|
.endif
|
|
all: realall subdir-all
|
|
subdir-all:
|
|
realall:
|
|
depend: realdepend subdir-depend
|
|
subdir-depend:
|
|
realdepend:
|
|
distclean: cleandir
|
|
cleandir: clean
|
|
|
|
dependall: .NOTMAIN realdepend .MAKE
|
|
@cd ${.CURDIR}; ${MAKE} realall
|
|
.endif
|
|
|
|
#
|
|
# Define MKxxx variables (which are either yes or no) for users
|
|
# to set in /etc/mk.conf and override in the make environment.
|
|
# These should be tested with `== "no"' or `!= "no"'.
|
|
# The NOxxx variables should only be set by Makefiles.
|
|
#
|
|
# Please keep etc/Makefile and share/man/man5/mk.conf.5 in sync
|
|
# with changes to the MK* variables here.
|
|
#
|
|
|
|
#
|
|
# Supported NO* options (if defined, MK* will be forced to "no",
|
|
# regardless of user's mk.conf setting).
|
|
#
|
|
.for var in \
|
|
CRYPTO DOC HTML LINKLIB LINT MAN NLS OBJ PIC PICINSTALL PROFILE \
|
|
SHARE STATICLIB
|
|
.if defined(NO${var})
|
|
MK${var}:= no
|
|
.endif
|
|
.endfor
|
|
|
|
#
|
|
# Older-style variables that enabled behaviour when set.
|
|
#
|
|
.for var in MANZ UNPRIVED UPDATE
|
|
.if defined(${var})
|
|
MK${var}:= yes
|
|
.endif
|
|
.endfor
|
|
|
|
#
|
|
# MK* options which default to "yes".
|
|
#
|
|
.for var in \
|
|
BFD BINUTILS \
|
|
CATPAGES CRYPTO CVS \
|
|
DOC \
|
|
GCC GCCCMDS GDB \
|
|
HESIOD HTML \
|
|
IEEEFP INET6 INFO IPFILTER ISCSI \
|
|
KERBEROS \
|
|
LINKLIB LINT \
|
|
MAN \
|
|
NLS \
|
|
OBJ \
|
|
PAM PF PIC PICINSTALL PICLIB POSTFIX PROFILE \
|
|
SHARE SKEY STATICLIB \
|
|
YP
|
|
MK${var}?= yes
|
|
.endfor
|
|
|
|
#
|
|
# MK* options which default to "no".
|
|
#
|
|
.for var in \
|
|
CRYPTO_IDEA CRYPTO_MDC2 CRYPTO_RC5 DEBUG DEBUGLIB \
|
|
MANZ OBJDIRS PRIVATELIB PUFFS SOFTFLOAT UNPRIVED UPDATE X11
|
|
MK${var}?= no
|
|
.endfor
|
|
|
|
#
|
|
# Force some options off if their dependencies are off.
|
|
#
|
|
|
|
.if ${MKCRYPTO} == "no"
|
|
MKKERBEROS:= no
|
|
.endif
|
|
|
|
.if ${MKMAN} == "no"
|
|
MKCATPAGES:= no
|
|
MKHTML:= no
|
|
.endif
|
|
|
|
.if ${MKLINKLIB} == "no"
|
|
MKPICINSTALL:= no
|
|
MKPROFILE:= no
|
|
.endif
|
|
|
|
.if ${MKPIC} == "no"
|
|
MKPICLIB:= no
|
|
.endif
|
|
|
|
.if ${MKOBJ} == "no"
|
|
MKOBJDIRS:= no
|
|
.endif
|
|
|
|
.if ${MKSHARE} == "no"
|
|
MKCATPAGES:= no
|
|
MKDOC:= no
|
|
MKINFO:= no
|
|
MKHTML:= no
|
|
MKMAN:= no
|
|
MKNLS:= no
|
|
.endif
|
|
|
|
#
|
|
# 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} -h sha1
|
|
.else
|
|
INSTPRIV.unpriv=
|
|
.endif
|
|
INSTPRIV?= ${INSTPRIV.unpriv} -N ${NETBSDSRCDIR}/etc
|
|
.endif
|
|
STRIPFLAG?=
|
|
|
|
.if ${NEED_OWN_INSTALL_TARGET} != "no"
|
|
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}
|
|
HOST_INSTALL_DIR?= ${INSTALL} -d
|
|
HOST_INSTALL_SYMLINK?= ${INSTALL} ${SYMLINK} ${RENAME}
|
|
.endif
|
|
|
|
#
|
|
# Set defaults for the USE_xxx variables.
|
|
#
|
|
|
|
#
|
|
# USE_* options which default to "no" and will be forced to "no" if their
|
|
# corresponding MK* variable is set to "no".
|
|
# (The latter is implemented using the .for loop in the next block.)
|
|
#
|
|
|
|
#
|
|
# USE_* options which default to "yes" unless their corresponding MK*
|
|
# variable is set to "no".
|
|
#
|
|
.for var in HESIOD INET6 KERBEROS PAM SKEY YP
|
|
.if (${MK${var}} == "no")
|
|
USE_${var}:= no
|
|
.else
|
|
USE_${var}?= yes
|
|
.endif
|
|
.endfor
|
|
|
|
#
|
|
# USE_* options which default to "yes".
|
|
#
|
|
#.for var in
|
|
#USE_${var}?= yes
|
|
#.endfor
|
|
|
|
#
|
|
# USE_* options which default to "no".
|
|
#
|
|
#.for var in
|
|
#USE_${var}?= no
|
|
#.endfor
|
|
|
|
#
|
|
# 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
|
|
X11ETCDIR?= /etc/X11
|
|
X11FONTDIR?= ${X11ROOTDIR}/lib/X11/fonts
|
|
X11INCDIR?= ${X11ROOTDIR}/include
|
|
X11LIBDIR?= ${X11ROOTDIR}/lib/X11
|
|
X11MANDIR?= ${X11ROOTDIR}/man
|
|
X11USRLIBDIR?= ${X11ROOTDIR}/lib
|
|
|
|
X11DRI?= no
|
|
X11LOADABLE?= yes
|
|
|
|
|
|
#
|
|
# MAKEDIRTARGET dir target [extra make(1) params]
|
|
# run "cd $${dir} && ${MAKE} [params] $${target}", with a pretty message
|
|
#
|
|
MAKEDIRTARGET=\
|
|
@_makedirtarget() { \
|
|
dir="$$1"; shift; \
|
|
target="$$1"; shift; \
|
|
case "$${dir}" in \
|
|
/*) this="$${dir}/"; \
|
|
real="$${dir}" ;; \
|
|
.) this="${_THISDIR_}"; \
|
|
real="${.CURDIR}" ;; \
|
|
*) this="${_THISDIR_}$${dir}/"; \
|
|
real="${.CURDIR}/$${dir}" ;; \
|
|
esac; \
|
|
show=$${this:-.}; \
|
|
echo "$${target} ===> $${show%/}$${1:+ (with: $$@)}"; \
|
|
cd "$${real}" \
|
|
&& ${MAKE} _THISDIR_="$${this}" "$$@" $${target}; \
|
|
}; \
|
|
_makedirtarget
|
|
|
|
#
|
|
# MAKEVERBOSE support. Levels are:
|
|
# 0 No messages
|
|
# 1 Enable info messages, suppress command output
|
|
# 2 Enable info messages and command output
|
|
#
|
|
MAKEVERBOSE?= 2
|
|
|
|
.if ${MAKEVERBOSE} == 0
|
|
_MKMSG?= @\#
|
|
_MKSHMSG?= : echo
|
|
_MKSHECHO?= : echo
|
|
.SILENT:
|
|
.elif ${MAKEVERBOSE} == 1
|
|
_MKMSG?= @echo ' '
|
|
_MKSHMSG?= echo ' '
|
|
_MKSHECHO?= : echo
|
|
.SILENT:
|
|
.else # MAKEVERBOSE == 2 ?
|
|
_MKMSG?= @echo '\# '
|
|
_MKSHMSG?= echo '\# '
|
|
_MKSHECHO?= echo
|
|
.SILENT: __makeverbose_dummy_target__
|
|
.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 "
|
|
|
|
_MKSHMSG_CREATE?= ${_MKSHMSG} " create "
|
|
_MKSHMSG_INSTALL?= ${_MKSHMSG} "install "
|
|
|
|
_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}
|
|
|
|
.endif # !defined(_BSD_OWN_MK_)
|