2002-03-09 18:17:45 +03:00
|
|
|
# $NetBSD: bsd.own.mk,v 1.273 2002/03/09 15:17:45 tv 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
|
|
|
|
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.
|
|
|
|
NEED_OWN_INSTALL_TARGET?= yes
|
|
|
|
|
2001-10-04 19:52:59 +04:00
|
|
|
# Temporary; this will become default when all platforms have migrated.
|
2002-01-28 03:37:25 +03:00
|
|
|
# List all the platforms that have NOT switched, since the majority have.
|
|
|
|
.if !(${MACHINE_ARCH} == "arm32" || \
|
|
|
|
${MACHINE_ARCH} == "ns32k" || \
|
|
|
|
${MACHINE_ARCH} == "sh3eb" || ${MACHINE_ARCH} == "sh3el" || \
|
|
|
|
${MACHINE_ARCH} == "vax" || \
|
2002-01-29 00:46:49 +03:00
|
|
|
${MACHINE} == "mac68k")
|
2001-11-15 22:24:07 +03:00
|
|
|
USE_NEW_TOOLCHAIN=nowarn
|
2001-10-20 10:11:21 +04:00
|
|
|
.endif
|
2001-10-04 19:52:59 +04:00
|
|
|
|
2001-11-19 05:46:50 +03:00
|
|
|
.if defined(USE_NEW_TOOLCHAIN)
|
|
|
|
CPPFLAG_ISYSTEM= -isystem
|
|
|
|
.else
|
|
|
|
CPPFLAG_ISYSTEM= -idirafter
|
|
|
|
.endif
|
|
|
|
|
2001-11-19 07:44:32 +03:00
|
|
|
.if empty(.MAKEFLAGS:M-V*)
|
|
|
|
PRINTOBJDIR= ${MAKE} -V .OBJDIR
|
|
|
|
.else
|
|
|
|
PRINTOBJDIR= echo # prevent infinite recursion
|
|
|
|
.endif
|
|
|
|
|
2001-10-26 08:59:10 +04:00
|
|
|
.if !defined(_SRC_TOP_)
|
|
|
|
# Find the top of the source tree to see if we're inside of $BSDSRCDIR
|
|
|
|
_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; \
|
|
|
|
cd ..; done
|
|
|
|
|
|
|
|
.MAKEOVERRIDES+= _SRC_TOP_
|
2001-09-25 05:04:35 +04:00
|
|
|
.endif
|
2001-10-26 08:59:10 +04:00
|
|
|
|
2001-11-19 07:44:32 +03:00
|
|
|
.if !defined(_SRC_TOP_OBJ_)
|
2001-11-25 00:26:34 +03:00
|
|
|
.if ${_SRC_TOP_} != ""
|
2001-11-19 07:44:32 +03:00
|
|
|
_SRC_TOP_OBJ_!= cd ${_SRC_TOP_} && ${PRINTOBJDIR}
|
|
|
|
.MAKEOVERRIDES+= _SRC_TOP_OBJ_
|
|
|
|
.endif
|
2001-11-25 00:26:34 +03:00
|
|
|
.endif
|
2001-11-19 07:44:32 +03:00
|
|
|
|
2001-10-28 05:03:00 +03:00
|
|
|
.if (${_SRC_TOP_} != "") && defined(USE_NEW_TOOLCHAIN)
|
2001-09-22 09:45:50 +04:00
|
|
|
USETOOLS?= yes
|
2001-10-26 08:59:10 +04:00
|
|
|
.endif
|
|
|
|
USETOOLS?= no
|
2001-09-22 09:45:50 +04:00
|
|
|
|
|
|
|
.if ${MACHINE_ARCH} == "mips" || ${MACHINE_ARCH} == "sh3"
|
|
|
|
.BEGIN:
|
|
|
|
@echo "Must set MACHINE_ARCH to one of ${MACHINE_ARCH}eb or ${MACHINE_ARCH}el"
|
|
|
|
@false
|
2001-10-31 19:25:21 +03:00
|
|
|
.elif defined(REQUIRETOOLS) && defined(USE_NEW_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
|
|
|
|
|
2001-10-31 20:46:08 +03:00
|
|
|
# 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
|
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
|
|
|
|
|
2001-10-31 19:25:21 +03:00
|
|
|
.if ${USETOOLS} == "yes"
|
2001-10-31 20:46:08 +03:00
|
|
|
# Provide a default for TOOLDIR.
|
2001-10-26 08:59:10 +04:00
|
|
|
.if !defined(TOOLDIR)
|
2001-10-31 20:46:08 +03:00
|
|
|
_TOOLOBJ!= cd ${_SRC_TOP_:U${BSDSRCDIR}}/tools && ${PRINTOBJDIR}
|
|
|
|
TOOLDIR:= ${_TOOLOBJ}/tools.${HOST_OSTYPE}
|
|
|
|
.MAKEOVERRIDES+= TOOLDIR
|
2001-10-26 08:59:10 +04:00
|
|
|
.endif
|
2001-09-22 09:45:50 +04:00
|
|
|
|
2001-10-31 20:46:08 +03:00
|
|
|
# Define default locations for common tools.
|
2001-12-12 08:50:09 +03: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
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.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
|
|
|
|
.endif
|
|
|
|
|
|
|
|
ASN1_COMPILE= ${TOOLDIR}/bin/nbasn1_compile
|
2002-02-01 01:43:33 +03:00
|
|
|
CAP_MKDB= ${TOOLDIR}/bin/nbcap_mkdb
|
2001-11-15 01:13:39 +03:00
|
|
|
COMPILE_ET= ${TOOLDIR}/bin/nbcompile_et
|
|
|
|
CONFIG= ${TOOLDIR}/bin/nbconfig
|
|
|
|
CRUNCHGEN= MAKE=${.MAKE:Q} ${TOOLDIR}/bin/nbcrunchgen
|
2002-02-01 01:43:33 +03:00
|
|
|
CTAGS= ${TOOLDIR}/bin/nbctags
|
2001-11-09 10:30:55 +03:00
|
|
|
DBSYM= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-dbsym
|
2001-11-15 01:13:39 +03:00
|
|
|
EQN= ${TOOLDIR}/bin/nbeqn
|
|
|
|
GENCAT= ${TOOLDIR}/bin/nbgencat
|
|
|
|
#GRIND= ${TOOLDIR}/bin/nbvgrind -f
|
2001-11-28 08:03:18 +03:00
|
|
|
GROFF= PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/nbgroff
|
2002-01-04 01:45:23 +03:00
|
|
|
HOST_MKDEP= ${TOOLDIR}/bin/nbhost-mkdep
|
2001-11-15 01:13:39 +03:00
|
|
|
INDXBIB= ${TOOLDIR}/bin/nbindxbib
|
|
|
|
INSTALL= STRIP=${STRIP:Q} ${TOOLDIR}/bin/nbinstall
|
|
|
|
INSTALL_INFO= ${TOOLDIR}/bin/nbinstall-info
|
|
|
|
LEX= ${TOOLDIR}/bin/nblex
|
2001-11-13 20:37:03 +03:00
|
|
|
LINT= CC=${CC:Q} ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-lint
|
2001-11-15 01:13:39 +03:00
|
|
|
LORDER= NM=${NM:Q} ${TOOLDIR}/bin/nblorder
|
2002-02-01 01:43:33 +03:00
|
|
|
M4= ${TOOLDIR}/bin/nbm4
|
2002-01-10 08:17:20 +03:00
|
|
|
MAKEFS= ${TOOLDIR}/bin/nbmakefs
|
2001-11-15 16:05:35 +03:00
|
|
|
MAKEINFO= ${TOOLDIR}/bin/nbmakeinfo
|
2001-11-30 02:53:23 +03:00
|
|
|
MAKEWHATIS= ${TOOLDIR}/bin/nbmakewhatis
|
2001-10-25 03:58:21 +04:00
|
|
|
MDSETIMAGE= ${TOOLDIR}/bin/${MACHINE_GNU_PLATFORM}-mdsetimage
|
2001-11-15 01:13:39 +03:00
|
|
|
MENUC= MENUDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/nbmenuc
|
|
|
|
MKDEP= CC=${CC:Q} ${TOOLDIR}/bin/nbmkdep
|
|
|
|
MKLOCALE= ${TOOLDIR}/bin/nbmklocale
|
|
|
|
MSGC= MSGDEF=${TOOLDIR}/share/misc ${TOOLDIR}/bin/nbmsgc
|
|
|
|
MTREE= ${TOOLDIR}/bin/nbmtree
|
2002-01-25 08:21:40 +03:00
|
|
|
PAX= ${TOOLDIR}/bin/nbpax
|
2001-11-15 01:13:39 +03:00
|
|
|
PIC= ${TOOLDIR}/bin/nbpic
|
2001-12-07 05:28:53 +03:00
|
|
|
PWD_MKDB= ${TOOLDIR}/bin/nbpwd_mkdb
|
2001-11-15 01:13:39 +03:00
|
|
|
REFER= ${TOOLDIR}/bin/nbrefer
|
2002-01-29 13:21:35 +03:00
|
|
|
RPCGEN= CPP=${CPP:Q} ${TOOLDIR}/bin/nbrpcgen
|
2001-11-15 01:13:39 +03:00
|
|
|
SOELIM= ${TOOLDIR}/bin/nbsoelim
|
2002-01-19 16:32:52 +03:00
|
|
|
SPARCINSTALLBOOT=${TOOLDIR}/bin/nbsparc-installboot
|
|
|
|
SUNLABEL= ${TOOLDIR}/bin/nbsunlabel
|
2001-11-15 01:13:39 +03:00
|
|
|
TBL= ${TOOLDIR}/bin/nbtbl
|
|
|
|
TSORT= ${TOOLDIR}/bin/nbtsort -q
|
2002-02-01 01:43:33 +03:00
|
|
|
UUDECODE= ${TOOLDIR}/bin/nbuudecode
|
2001-11-15 01:13:39 +03:00
|
|
|
YACC= ${TOOLDIR}/bin/nbyacc
|
2002-01-05 10:34:08 +03:00
|
|
|
ZIC= ${TOOLDIR}/bin/nbzic
|
2001-09-22 09:45:50 +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
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
DESTDIR?=
|
|
|
|
.endif
|
|
|
|
|
1994-09-28 18:59:28 +03:00
|
|
|
# Defining `SKEY' causes support for S/key authentication to be compiled in.
|
|
|
|
SKEY= yes
|
1993-11-07 12:45:04 +03: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
|
1993-04-10 00:05:56 +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
|
|
|
|
1995-06-02 06:52:04 +04:00
|
|
|
# Define MANZ to have the man pages compressed (gzip)
|
|
|
|
#MANZ= 1
|
|
|
|
|
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
|
* Add user-controlled mk.conf variables
- SHLIBDIR Location to install shared libraries if ${USE_SHLIBDIR}
is "yes". Defaults to "/usr/lib".
- USE_SHLIBDIR If "yes", install shared libraries in ${SHLIBDIR}
instead of ${LIBDIR}. Defaults to "no".
Sets ${_LIBSODIR} to the appropriate value.
This may be set by individual Makefiles as well.
- SHLINKDIR Location of shared linker. Defaults to "/usr/libexec".
If != "/usr/libexec", change the dynamic-linker
encoded in shared programs
* Set USE_SHLIBDIR for libraries used by /bin and /sbin:
libc libcrypt libcrypto libedit libipsec libkvm libm libmi387
libtermcap libutil libz
* If ${_LIBSODIR} != ${LIBDIR}, add symlinks from ${LIBDIR}/${LIB}.so*
to ${_LIBSODIR}/${LIB}.so* for compatibility.
* Always install /sbin/init statically (for now)
The net effect of these changes depends on how the variables are set:
1.) If nothing is set or changed, there is no change from the
current behaviour:
- Static /bin, /sbin, and bits of /usr/*
- Dynamic rest
- Shared linker is /usr/libexec/ld*so
2.) If the following make variables are set:
LDSTATIC=
SHLINKDIR=/lib
SHLIBDIR=/lib
Then the behaviour becomes:
- Dynamic tools
- .so libraries used by /bin and /sbin are installed to /lib,
with symlinks from /usr/lib/lib*so to -> /lib/lib*so
where appropriate
- Shared linker is /lib/ld*so
3.) As per 2.), but add the following variable:
USE_SHLIBDIR=yes
This forces all .so's to be instaleld in /lib (with compat
symlinks), not just those tagged by their Makefiles to be.
Again, compat symlinks are installed
2001-12-28 04:32:37 +03:00
|
|
|
SHLIBDIR?= /usr/lib
|
|
|
|
.if ${USE_SHLIBDIR:Uno} == "yes"
|
|
|
|
_LIBSODIR?= ${SHLIBDIR}
|
|
|
|
.else
|
|
|
|
_LIBSODIR?= ${LIBDIR}
|
|
|
|
.endif
|
|
|
|
SHLINKDIR?= /usr/libexec
|
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}
|
|
|
|
|
1993-08-16 00:42:39 +04:00
|
|
|
COPY?= -c
|
2001-08-14 10:47:24 +04:00
|
|
|
PRESERVE?= ${UPDATE:D-p}
|
1999-08-16 17:57:03 +04:00
|
|
|
RENAME?= -r
|
2001-11-19 07:44:32 +03:00
|
|
|
HRDLINK?= -l h
|
|
|
|
SYMLINK?= -l s
|
|
|
|
|
2001-11-25 00:26:34 +03:00
|
|
|
.if defined(_SRC_TOP_OBJ_)
|
2001-11-19 07:44:32 +03:00
|
|
|
METALOG?= ${_SRC_TOP_OBJ_}/METALOG
|
2001-11-25 00:26:34 +03:00
|
|
|
.else
|
|
|
|
METALOG?= /dev/null
|
|
|
|
.endif
|
2001-11-19 07:44:32 +03:00
|
|
|
INSTPRIV?= ${UNPRIVED:D-U -M ${METALOG}}
|
1997-04-17 10:34:15 +04:00
|
|
|
STRIPFLAG?= -s
|
1993-07-10 07:56:10 +04:00
|
|
|
|
2001-11-05 22:45:25 +03:00
|
|
|
.if ${NEED_OWN_INSTALL_TARGET} == "yes"
|
2001-11-19 07:44:32 +03:00
|
|
|
INSTALL_DIR?= ${INSTALL} ${INSTPRIV} -d
|
|
|
|
INSTALL_FILE?= ${INSTALL} ${INSTPRIV} ${COPY} ${PRESERVE} ${RENAME}
|
2001-11-25 00:26:34 +03:00
|
|
|
INSTALL_LINK?= ${INSTALL} ${INSTPRIV} ${HRDLINK} ${RENAME}
|
|
|
|
INSTALL_SYMLINK?= ${INSTALL} ${INSTPRIV} ${SYMLINK} ${RENAME}
|
2001-11-19 07:44:32 +03:00
|
|
|
HOST_INSTALL_FILE?= ${INSTALL} ${COPY} ${PRESERVE} ${RENAME}
|
2001-11-05 22:45:25 +03:00
|
|
|
.endif
|
2001-11-02 08:21:47 +03:00
|
|
|
|
1993-07-10 07:56:10 +04:00
|
|
|
# Define SYS_INCLUDE to indicate whether you want symbolic links to the system
|
|
|
|
# source (``symlinks''), or a separate copy (``copies''); (latter useful
|
|
|
|
# in environments where it's not possible to keep /sys publicly readable)
|
1998-08-08 00:31:56 +04:00
|
|
|
#SYS_INCLUDE= symlinks
|
1993-10-04 22:52:53 +03:00
|
|
|
|
2002-01-29 22:17:49 +03:00
|
|
|
# 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", "a.out", or "COFF".
|
|
|
|
#
|
|
|
|
# All new-toolchain platforms are ELF.
|
|
|
|
.if defined(USE_NEW_TOOLCHAIN)
|
|
|
|
OBJECT_FMT= ELF
|
2002-02-15 13:20:24 +03:00
|
|
|
.elif ${MACHINE_ARCH} == "sh3eb" || ${MACHINE_ARCH} == "sh3el"
|
2002-01-29 22:17:49 +03:00
|
|
|
# SuperH defaults to COFF in its old toolchain.
|
|
|
|
OBJECT_FMT?= COFF
|
|
|
|
.else
|
|
|
|
# Everything else defaults to a.out.
|
|
|
|
OBJECT_FMT?= a.out
|
|
|
|
.endif
|
|
|
|
|
2000-08-03 00:04:45 +04:00
|
|
|
# The sh3 port is incomplete.
|
2002-02-04 11:49:04 +03:00
|
|
|
.if (${MACHINE_ARCH} == "sh3eb" || ${MACHINE_ARCH} == "sh3el") && \
|
|
|
|
!defined(HAVE_GCC3)
|
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
|
|
|
|
2001-07-13 16:44:22 +04:00
|
|
|
# The m68000 port is incomplete.
|
|
|
|
.if ${MACHINE_ARCH} == "m68000"
|
2001-12-12 02:25:23 +03:00
|
|
|
NOPIC= # defined
|
|
|
|
NOPROFILE= # defined
|
2001-07-13 16:44:22 +04:00
|
|
|
.endif
|
|
|
|
|
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>.
|
|
|
|
SHLIB_VERSION_FILE?= ${.CURDIR}/shlib_version
|
|
|
|
|
1998-05-22 20:43:42 +04:00
|
|
|
# GNU sources and packages sometimes see architecture names differently.
|
2001-07-21 20:56:07 +04:00
|
|
|
GNU_ARCH.arm26=arm
|
1998-05-22 20:43:42 +04:00
|
|
|
GNU_ARCH.arm32=arm
|
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
|
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
|
|
|
|
|
|
|
# In order to identify NetBSD to GNU packages, we sometimes need
|
|
|
|
# an "elf" tag for historically a.out platforms.
|
2001-06-02 06:22:35 +04:00
|
|
|
.if ${OBJECT_FMT} == "ELF" && \
|
2001-10-23 21:15:21 +04:00
|
|
|
(${MACHINE_GNU_ARCH} == "arm" || \
|
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")
|
2001-08-14 13:31:42 +04:00
|
|
|
MACHINE_GNU_PLATFORM=${MACHINE_GNU_ARCH}--netbsdelf
|
2001-06-02 05:53:29 +04:00
|
|
|
.else
|
2001-08-14 13:31:42 +04: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
|
|
|
|
|
|
|
# CPU model, derived from MACHINE_ARCH
|
2001-07-13 16:44:22 +04:00
|
|
|
MACHINE_CPU= ${MACHINE_ARCH:C/mipse[bl]/mips/:S/arm26/arm/:S/arm32/arm/:C/sh3e[bl]/sh3/:S/m68000/m68k/}
|
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
|
|
|
|
1999-02-12 04:10:06 +03:00
|
|
|
# Define MKxxx variables (which are either yes or no) for users
|
|
|
|
# to set in /etc/mk.conf and override on the make commandline.
|
|
|
|
# These should be tested with `== "no"' or `!= "no"'.
|
|
|
|
# The NOxxx variables should only be used by Makefiles.
|
|
|
|
#
|
|
|
|
|
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).
|
|
|
|
.for var in CRYPTO DOC KERBEROS LINKLIB LINT MAN NLS OBJ \
|
|
|
|
PIC PICINSTALL PROFILE SHARE
|
|
|
|
.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
|
|
|
|
2002-02-07 03:53:34 +03:00
|
|
|
.if defined(NOMAN)
|
|
|
|
NOHTML=
|
|
|
|
.endif
|
|
|
|
|
2001-12-12 02:25:23 +03:00
|
|
|
# MK* options which default to "yes".
|
2002-01-28 02:33:51 +03:00
|
|
|
.for var in BFD CATPAGES CRYPTO DOC GCC GDB IEEEFP INFO KERBEROS LINKLIB LINT \
|
2001-12-12 02:25:23 +03:00
|
|
|
MAN NLS OBJ PIC PICINSTALL PROFILE SHARE
|
|
|
|
MK${var}?= yes
|
|
|
|
.endfor
|
1999-02-12 04:10:06 +03:00
|
|
|
|
2001-12-12 02:25:23 +03:00
|
|
|
# MK* options which default to "no".
|
|
|
|
.for var in CRYPTO_IDEA CRYPTO_RC5 OBJDIRS SOFTFLOAT
|
|
|
|
MK${var}?= no
|
|
|
|
.endfor
|
1999-02-12 04:10:06 +03:00
|
|
|
|
2001-12-12 02:25:23 +03:00
|
|
|
# Force some options off if their dependencies are off.
|
|
|
|
.if ${MKCRYPTO} == "no"
|
|
|
|
MKKERBEROS:= no
|
1999-02-12 04:10:06 +03:00
|
|
|
.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
|
|
|
|
|
2001-12-12 02:25:23 +03:00
|
|
|
.if ${MKMAN} == "no"
|
|
|
|
MKCATPAGES:= no
|
1999-02-12 04:10:06 +03:00
|
|
|
.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
|
|
|
|
MKMAN:= no
|
|
|
|
MKNLS:= no
|
1999-02-12 15:38:44 +03:00
|
|
|
.endif
|
1999-02-12 04:10:06 +03:00
|
|
|
|
2002-01-01 02:06:34 +03:00
|
|
|
# x86-64 cannot currently use the in-tree toolchain, but does
|
|
|
|
# use the "new toolchain" build framework.
|
|
|
|
.if ${MACHINE_ARCH} == "x86_64"
|
|
|
|
MKBFD:= no
|
|
|
|
MKGDB:= no
|
|
|
|
MKGCC:= no
|
|
|
|
.endif
|
|
|
|
|
1998-04-13 16:03:07 +04:00
|
|
|
.endif # _BSD_OWN_MK_
|