1998-08-31 01:08:08 +00:00
|
|
|
#
|
1999-08-28 01:35:59 +00:00
|
|
|
# $FreeBSD$
|
1998-08-31 01:08:08 +00:00
|
|
|
#
|
|
|
|
# Make command line options:
|
2004-12-21 12:21:26 +00:00
|
|
|
# -DNO_CLEANDIR run ${MAKE} clean, instead of ${MAKE} cleandir
|
|
|
|
# -DNO_CLEAN do not clean at all
|
2013-01-22 21:10:03 +00:00
|
|
|
# -DDB_FROM_SRC use the user/group databases in src/etc instead of
|
|
|
|
# the system database when installing.
|
2004-12-21 12:13:23 +00:00
|
|
|
# -DNO_SHARE do not go into share subdir
|
2009-12-16 02:54:34 +00:00
|
|
|
# -DKERNFAST define NO_KERNEL{CONFIG,CLEAN,DEPEND,OBJ}
|
2000-06-15 10:00:20 +00:00
|
|
|
# -DNO_KERNELCONFIG do not run config in ${MAKE} buildkernel
|
2001-01-22 23:29:13 +00:00
|
|
|
# -DNO_KERNELCLEAN do not run ${MAKE} clean in ${MAKE} buildkernel
|
2000-06-15 10:00:20 +00:00
|
|
|
# -DNO_KERNELDEPEND do not run ${MAKE} depend in ${MAKE} buildkernel
|
2009-12-16 02:54:34 +00:00
|
|
|
# -DNO_KERNELOBJ do not run ${MAKE} obj in ${MAKE} buildkernel
|
2000-08-07 14:35:49 +00:00
|
|
|
# -DNO_PORTSUPDATE do not update ports in ${MAKE} update
|
2013-01-22 21:10:03 +00:00
|
|
|
# -DNO_ROOT install without using root privilege
|
2000-08-07 14:35:49 +00:00
|
|
|
# -DNO_DOCUPDATE do not update doc in ${MAKE} update
|
2008-05-23 04:22:14 +00:00
|
|
|
# -DNO_CTF do not run the DTrace CTF conversion tools on built objects
|
1998-08-31 01:08:08 +00:00
|
|
|
# LOCAL_DIRS="list of dirs" to add additional dirs to the SUBDIR list
|
2014-06-24 15:57:48 +00:00
|
|
|
# LOCAL_ITOOLS="list of tools" to add additional tools to the ITOOLS list
|
2012-06-15 19:42:49 +00:00
|
|
|
# LOCAL_LIB_DIRS="list of dirs" to add additional dirs to libraries target
|
2012-10-18 12:32:51 +00:00
|
|
|
# LOCAL_MTREE="list of mtree files" to process to allow local directories
|
|
|
|
# to be created before files are installed
|
2012-01-05 21:50:50 +00:00
|
|
|
# LOCAL_TOOL_DIRS="list of dirs" to add additional dirs to the build-tools
|
|
|
|
# list
|
2013-01-22 21:10:03 +00:00
|
|
|
# METALOG="path to metadata log" to write permission and ownership
|
|
|
|
# when NO_ROOT is set. (default: ${DESTDIR}/METALOG)
|
2006-09-07 16:41:30 +00:00
|
|
|
# TARGET="machine" to crossbuild world for a different machine type
|
2010-04-14 18:56:07 +00:00
|
|
|
# TARGET_ARCH= may be required when a TARGET supports multiple endians
|
2012-01-30 20:19:28 +00:00
|
|
|
# BUILDENV_SHELL= shell to launch for the buildenv target (def:/bin/sh)
|
2013-02-03 10:26:24 +00:00
|
|
|
# WORLD_FLAGS= additional flags to pass to make(1) during buildworld
|
|
|
|
# KERNEL_FLAGS= additional flags to pass to make(1) during buildkernel
|
1998-08-31 01:08:08 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# The intended user-driven targets are:
|
|
|
|
# buildworld - rebuild *everything*, including glue to help do upgrades
|
|
|
|
# installworld- install everything built by "buildworld"
|
2006-05-26 18:10:06 +00:00
|
|
|
# doxygen - build API documentation of the kernel
|
2013-05-28 21:57:55 +00:00
|
|
|
# update - convenient way to update your source tree (eg: svn/svnup)
|
1998-08-31 01:08:08 +00:00
|
|
|
#
|
|
|
|
# Standard targets (not defined here) are documented in the makefiles in
|
|
|
|
# /usr/share/mk. These include:
|
|
|
|
# obj depend all install clean cleandepend cleanobj
|
|
|
|
|
2011-02-10 19:58:21 +00:00
|
|
|
.if !defined(TARGET) || !defined(TARGET_ARCH)
|
|
|
|
.error "Both TARGET and TARGET_ARCH must be defined."
|
|
|
|
.endif
|
|
|
|
|
2006-03-17 18:54:44 +00:00
|
|
|
.include <bsd.own.mk>
|
2010-06-24 16:28:52 +00:00
|
|
|
.include <bsd.arch.inc.mk>
|
2012-09-13 16:00:46 +00:00
|
|
|
.include <bsd.compiler.mk>
|
2008-09-19 16:14:42 +00:00
|
|
|
|
1998-08-31 01:08:08 +00:00
|
|
|
# We must do share/info early so that installation of info `dir'
|
|
|
|
# entries works correctly. Do it first since it is less likely to
|
|
|
|
# grow dependencies on include and lib than vice versa.
|
2004-02-13 21:52:08 +00:00
|
|
|
#
|
2006-11-13 05:52:11 +00:00
|
|
|
# We must do lib/ and libexec/ before bin/, because if installworld
|
2003-12-09 00:42:44 +00:00
|
|
|
# installs a new /bin/sh, the 'make' command will *immediately*
|
|
|
|
# use that new version. And the new (dynamically-linked) /bin/sh
|
|
|
|
# will expect to find appropriate libraries in /lib and /libexec.
|
2004-02-13 21:52:08 +00:00
|
|
|
#
|
2013-10-25 21:27:35 +00:00
|
|
|
SRCDIR?= ${.CURDIR}
|
2013-05-01 09:56:09 +00:00
|
|
|
.if defined(SUBDIR_OVERRIDE)
|
|
|
|
SUBDIR= ${SUBDIR_OVERRIDE}
|
|
|
|
.else
|
2006-11-13 05:52:11 +00:00
|
|
|
SUBDIR= share/info lib libexec
|
|
|
|
SUBDIR+=bin
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_GAMES} != "no"
|
2004-02-13 21:52:08 +00:00
|
|
|
SUBDIR+=games
|
2001-12-06 07:44:47 +00:00
|
|
|
.endif
|
2007-04-06 02:13:30 +00:00
|
|
|
.if ${MK_CDDL} != "no"
|
|
|
|
SUBDIR+=cddl
|
|
|
|
.endif
|
2006-11-13 05:52:11 +00:00
|
|
|
SUBDIR+=gnu include
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_KERBEROS} != "no"
|
2004-02-13 21:52:08 +00:00
|
|
|
SUBDIR+=kerberos5
|
1998-08-31 01:08:08 +00:00
|
|
|
.endif
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_RESCUE} != "no"
|
2004-02-13 21:52:08 +00:00
|
|
|
SUBDIR+=rescue
|
1998-08-31 01:08:08 +00:00
|
|
|
.endif
|
2004-02-13 21:52:08 +00:00
|
|
|
SUBDIR+=sbin
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_CRYPT} != "no"
|
2004-02-13 21:52:08 +00:00
|
|
|
SUBDIR+=secure
|
1998-08-31 01:08:08 +00:00
|
|
|
.endif
|
2004-12-21 12:13:23 +00:00
|
|
|
.if !defined(NO_SHARE)
|
2004-02-13 21:52:08 +00:00
|
|
|
SUBDIR+=share
|
2002-04-30 11:46:49 +00:00
|
|
|
.endif
|
2006-11-13 05:52:11 +00:00
|
|
|
SUBDIR+=sys usr.bin usr.sbin
|
2013-12-28 20:05:31 +00:00
|
|
|
.if ${MK_TESTS} != "no"
|
|
|
|
SUBDIR+= tests
|
|
|
|
.endif
|
2011-03-21 09:58:24 +00:00
|
|
|
.if ${MK_OFED} != "no"
|
|
|
|
SUBDIR+=contrib/ofed
|
|
|
|
.endif
|
2006-11-13 05:52:11 +00:00
|
|
|
#
|
|
|
|
# We must do etc/ last for install/distribute to work.
|
|
|
|
#
|
|
|
|
SUBDIR+=etc
|
2002-04-30 11:46:49 +00:00
|
|
|
|
1998-08-31 01:08:08 +00:00
|
|
|
# These are last, since it is nice to at least get the base system
|
|
|
|
# rebuilt before you do them.
|
2012-06-15 19:40:59 +00:00
|
|
|
.for _DIR in ${LOCAL_LIB_DIRS} ${LOCAL_DIRS}
|
2004-02-13 21:52:08 +00:00
|
|
|
.if exists(${.CURDIR}/${_DIR}/Makefile)
|
1998-08-31 01:08:08 +00:00
|
|
|
SUBDIR+= ${_DIR}
|
|
|
|
.endif
|
|
|
|
.endfor
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
.endif
|
|
|
|
|
2005-02-28 09:23:38 +00:00
|
|
|
.if defined(NOCLEAN)
|
|
|
|
NO_CLEAN= ${NOCLEAN}
|
|
|
|
.endif
|
2004-12-21 12:21:26 +00:00
|
|
|
.if defined(NO_CLEANDIR)
|
1998-08-31 01:08:08 +00:00
|
|
|
CLEANDIR= clean cleandepend
|
|
|
|
.else
|
|
|
|
CLEANDIR= cleandir
|
|
|
|
.endif
|
|
|
|
|
2012-01-06 00:34:27 +00:00
|
|
|
LOCAL_TOOL_DIRS?=
|
2012-01-05 21:50:50 +00:00
|
|
|
|
2012-01-30 20:19:28 +00:00
|
|
|
BUILDENV_SHELL?=/bin/sh
|
|
|
|
|
2013-05-28 23:43:47 +00:00
|
|
|
SVN?= /usr/local/bin/svn
|
2009-06-14 15:16:24 +00:00
|
|
|
SVNFLAGS?= -r HEAD
|
1998-08-31 01:08:08 +00:00
|
|
|
|
1999-12-10 10:48:20 +00:00
|
|
|
MAKEOBJDIRPREFIX?= /usr/obj
|
2003-05-04 04:14:10 +00:00
|
|
|
.if !defined(OSRELDATE)
|
2003-08-25 17:48:25 +00:00
|
|
|
.if exists(/usr/include/osreldate.h)
|
2003-05-15 17:59:32 +00:00
|
|
|
OSRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
|
|
|
|
/usr/include/osreldate.h
|
2003-08-25 17:48:25 +00:00
|
|
|
.else
|
2003-08-27 04:49:43 +00:00
|
|
|
OSRELDATE= 0
|
2003-08-25 17:48:25 +00:00
|
|
|
.endif
|
2003-05-04 04:14:10 +00:00
|
|
|
.endif
|
2006-09-07 16:41:30 +00:00
|
|
|
|
2008-05-23 04:22:14 +00:00
|
|
|
.if !defined(VERSION)
|
2013-10-25 21:27:35 +00:00
|
|
|
REVISION!= make -C ${SRCDIR}/release -V REVISION
|
|
|
|
BRANCH!= make -C ${SRCDIR}/release -V BRANCH
|
|
|
|
SRCRELDATE!= awk '/^\#define[[:space:]]*__FreeBSD_version/ { print $$3 }' \
|
|
|
|
${SRCDIR}/sys/sys/param.h
|
2013-11-24 23:30:23 +00:00
|
|
|
VERSION= FreeBSD ${REVISION}-${BRANCH:C/-p[0-9]+$//} ${TARGET_ARCH} ${SRCRELDATE}
|
2008-05-23 04:22:14 +00:00
|
|
|
.endif
|
|
|
|
|
2013-09-22 07:30:17 +00:00
|
|
|
KNOWN_ARCHES?= amd64 arm armeb/arm armv6/arm i386 i386/pc98 ia64 mips mipsel/mips mips64el/mips mips64/mips mipsn32el/mips mipsn32/mips powerpc powerpc64/powerpc sparc64
|
2006-09-07 16:41:30 +00:00
|
|
|
.if ${TARGET} == ${TARGET_ARCH}
|
|
|
|
_t= ${TARGET}
|
|
|
|
.else
|
|
|
|
_t= ${TARGET_ARCH}/${TARGET}
|
|
|
|
.endif
|
|
|
|
.for _t in ${_t}
|
|
|
|
.if empty(KNOWN_ARCHES:M${_t})
|
|
|
|
.error Unknown target ${TARGET_ARCH}:${TARGET}.
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
.if ${TARGET} == ${MACHINE}
|
2002-08-02 18:04:22 +00:00
|
|
|
TARGET_CPUTYPE?=${CPUTYPE}
|
2002-04-11 13:43:50 +00:00
|
|
|
.else
|
2002-07-31 03:56:03 +00:00
|
|
|
TARGET_CPUTYPE?=
|
2002-04-11 13:43:50 +00:00
|
|
|
.endif
|
2006-09-07 16:41:30 +00:00
|
|
|
|
2002-08-08 15:43:23 +00:00
|
|
|
.if !empty(TARGET_CPUTYPE)
|
|
|
|
_TARGET_CPUTYPE=${TARGET_CPUTYPE}
|
|
|
|
.else
|
|
|
|
_TARGET_CPUTYPE=dummy
|
|
|
|
.endif
|
Further fix the case mentioned in rev. 1.302. The
intent was (and still is) that if a user has say
CPUTYPE=i686 set in /etc/make.conf, we don't print
the assignment type warning unless TARGET_CPUTYPE
is overridden.
Unfortunately, the implementation was buggy, and
only recent changes to bsd.cpu.mk that swapped
canonical and alias values of some CPU types made
the bug apparent.
Here's what happens here.
- CPUTYPE=i686 is set in /etc/make.conf,
- bsd.cpu.mk reset it to "pentiumpro",
- Makefile.inc1 compares this canonical value
with the result of the following test,
make -f /dev/null CPUTYPE=pentiumpro -V CPUTYPE
and expects the result to be "pentiumpro" too,
but "i686" is returned, here's why. We have two
CPUTYPE variables, global, set to "i686" in
/etc/make.conf, and command-line (of a higher
precedence), set to "pentiumpro".
The following part of bsd.cpu.mk,
. elif ${CPUTYPE} == "i686"
CPUTYPE = pentiumpro
which is responsible for converting aliases to
canonical values, sees the value of the CPUTYPE
command-line variable first, "pentiumpro", and
no conversion is done -- the net effect is that
CPUTYPE global stays with its old value "i686",
and "make -V CPUTYPE" (which prints variables
in the global context) returns "i686".
The fix was to pass the CPUTYPE in the test above
as an environment variable instead of as a command
line variable, i.e.,
CPUTYPE=pentiumpro make -f /dev/null -V CPUTYPE
This time, CPUTYPE global is still set to "i686"
initially (by /etc/make.conf), and an envieronment
variable CPUTYPE (of a lower precedence) is set
to "pentiumpro". The .elif sees it's set to
"i686" and resets it to "pentiumpro", and so
"make -V" returns "pentiumpro".
NB: these various types of make(1) variables can
be very painful, especially when combined with
"make -V".
2004-12-22 22:00:01 +00:00
|
|
|
_CPUTYPE!= MAKEFLAGS= CPUTYPE=${_TARGET_CPUTYPE} ${MAKE} \
|
|
|
|
-f /dev/null -m ${.CURDIR}/share/mk -V CPUTYPE
|
2002-08-08 15:43:23 +00:00
|
|
|
.if ${_CPUTYPE} != ${_TARGET_CPUTYPE}
|
2002-08-02 18:04:22 +00:00
|
|
|
.error CPUTYPE global should be set with ?=.
|
|
|
|
.endif
|
Fix cross-building, etc:
1. To cross-build, one now needs to set TARGET_ARCH, and not the
MACHINE_ARCH. MACHINE_ARCH should never be changed manually!
2. Initialize DESTDIR= explicitly for bootstrap-tools, build-tools,
and cross-tools stages. This fixes broken header and library
dependencies problem. We build them in the host environment,
and obviously want them to depend on host headers and libraries.
The problem with broken header dependencies for bootstrap-tools
and cross-tools was already partially solved (see BOOTSTRAPPING
tests in bsd.prog.mk and bsd.lib.mk), but it was still there for
build-tools if the user ran "make world DESTDIR=/foo". Also,
for all of these stages, the library dependencies were broken
because of how bsd.libnames.mk define DPADD members.
We still provide a glue to install bootstrap- and cross-tools
under the ${WORLDTMP}.
Removed PATH overrides for bootstrap-, build-, and cross-tools
stages. There is just no reason why we would need to override
it, and the hacks to clean up the ${WORLDTMP} in the -DNOCLEAN
case are no longer needed with fixes from this step.
That is, we now never use ${WORLDTMP} headers and libraries,
and we don't use any ${WORLDTMP} installed binaries during
these stages. Again, these stages depend solely on the host
environment, including compiler, headers, and libraries.
3. Moved "miniperl" back from cross-tools (it has nothing to do
with a cross-compiler) to build-tools where it belongs. The
change from step 1 let to do this. Also, to make this work,
build-tools targets of "cc_tools" and "miniperl" were modified
to call "depend". Here follow the detailed explanations.
There are two categories of build tools, for now. In the first
category there are "cc_tools" and "miniperl". They occupy the
whole (sub)directory, and nothing needs to be done in this
subdirectory later during the "all" stage. They are also
constructed using system makefiles. We must build the .depend
early in the build-tools stage because:
1) They use (and depend on) the host environment.
2) If we don't do this in build-tools, the "depend" stage of
buildworld will do this for us; wrong library and header
dependencies will be recorded (DESTDIR=${WORLDTMP}) and,
what's worse, the "all" stage may then clobber the
build-architecture format tools (that we built in the
build-tools stage) with the target-architecture format
ones, breaking cross build.
In the second category there are all other build-tools. They
share their directory with the "main" module that needs them
in the "all" stage, and they don't show up themselves in the
.depend file. The portion of this fix was already committed
in gnu/usr.bin/cc/cc_tools/Makefile,v 1.52.
4. "libperl" is no longer a build tool, and "miniperl" is the
stand-alone application. I had to make this change because
build-tools and "all" stages share the same object directory.
Without this change, if we cross compile, libperl.a is first
built for the build architecture during the build-tools stage
(for the purposes of immediate linkage with "miniperl").
Later on, the "all" stage sees this library as up-to-date,
and doesn't rebuild it. The effect is that the wrong format
static libperl library is installed with installworld.
5. Fixed "includes" to install secure/lib/libtelnet headers if
required.
Reviewed by: bde
2001-09-29 13:17:54 +00:00
|
|
|
.if make(buildworld)
|
2005-12-03 05:11:07 +00:00
|
|
|
BUILD_ARCH!= uname -p
|
Fix cross-building, etc:
1. To cross-build, one now needs to set TARGET_ARCH, and not the
MACHINE_ARCH. MACHINE_ARCH should never be changed manually!
2. Initialize DESTDIR= explicitly for bootstrap-tools, build-tools,
and cross-tools stages. This fixes broken header and library
dependencies problem. We build them in the host environment,
and obviously want them to depend on host headers and libraries.
The problem with broken header dependencies for bootstrap-tools
and cross-tools was already partially solved (see BOOTSTRAPPING
tests in bsd.prog.mk and bsd.lib.mk), but it was still there for
build-tools if the user ran "make world DESTDIR=/foo". Also,
for all of these stages, the library dependencies were broken
because of how bsd.libnames.mk define DPADD members.
We still provide a glue to install bootstrap- and cross-tools
under the ${WORLDTMP}.
Removed PATH overrides for bootstrap-, build-, and cross-tools
stages. There is just no reason why we would need to override
it, and the hacks to clean up the ${WORLDTMP} in the -DNOCLEAN
case are no longer needed with fixes from this step.
That is, we now never use ${WORLDTMP} headers and libraries,
and we don't use any ${WORLDTMP} installed binaries during
these stages. Again, these stages depend solely on the host
environment, including compiler, headers, and libraries.
3. Moved "miniperl" back from cross-tools (it has nothing to do
with a cross-compiler) to build-tools where it belongs. The
change from step 1 let to do this. Also, to make this work,
build-tools targets of "cc_tools" and "miniperl" were modified
to call "depend". Here follow the detailed explanations.
There are two categories of build tools, for now. In the first
category there are "cc_tools" and "miniperl". They occupy the
whole (sub)directory, and nothing needs to be done in this
subdirectory later during the "all" stage. They are also
constructed using system makefiles. We must build the .depend
early in the build-tools stage because:
1) They use (and depend on) the host environment.
2) If we don't do this in build-tools, the "depend" stage of
buildworld will do this for us; wrong library and header
dependencies will be recorded (DESTDIR=${WORLDTMP}) and,
what's worse, the "all" stage may then clobber the
build-architecture format tools (that we built in the
build-tools stage) with the target-architecture format
ones, breaking cross build.
In the second category there are all other build-tools. They
share their directory with the "main" module that needs them
in the "all" stage, and they don't show up themselves in the
.depend file. The portion of this fix was already committed
in gnu/usr.bin/cc/cc_tools/Makefile,v 1.52.
4. "libperl" is no longer a build tool, and "miniperl" is the
stand-alone application. I had to make this change because
build-tools and "all" stages share the same object directory.
Without this change, if we cross compile, libperl.a is first
built for the build architecture during the build-tools stage
(for the purposes of immediate linkage with "miniperl").
Later on, the "all" stage sees this library as up-to-date,
and doesn't rebuild it. The effect is that the wrong format
static libperl library is installed with installworld.
5. Fixed "includes" to install secure/lib/libtelnet headers if
required.
Reviewed by: bde
2001-09-29 13:17:54 +00:00
|
|
|
.if ${MACHINE_ARCH} != ${BUILD_ARCH}
|
|
|
|
.error To cross-build, set TARGET_ARCH.
|
|
|
|
.endif
|
|
|
|
.endif
|
2010-09-08 19:53:16 +00:00
|
|
|
.if ${MACHINE} == ${TARGET} && ${MACHINE_ARCH} == ${TARGET_ARCH} && !defined(CROSS_BUILD_TESTING)
|
1999-12-11 17:05:36 +00:00
|
|
|
OBJTREE= ${MAKEOBJDIRPREFIX}
|
|
|
|
.else
|
2010-06-24 16:32:20 +00:00
|
|
|
OBJTREE= ${MAKEOBJDIRPREFIX}/${TARGET}.${TARGET_ARCH}
|
1999-12-11 17:05:36 +00:00
|
|
|
.endif
|
2005-03-02 16:40:51 +00:00
|
|
|
WORLDTMP= ${OBJTREE}${.CURDIR}/tmp
|
1999-12-23 19:18:28 +00:00
|
|
|
# /usr/games added for fortune which depend on strfile
|
2013-01-29 22:17:58 +00:00
|
|
|
BPATH= ${WORLDTMP}/legacy/usr/sbin:${WORLDTMP}/legacy/usr/bin:${WORLDTMP}/legacy/usr/games:${WORLDTMP}/legacy/bin
|
2003-04-13 11:42:55 +00:00
|
|
|
XPATH= ${WORLDTMP}/usr/sbin:${WORLDTMP}/usr/bin:${WORLDTMP}/usr/games
|
|
|
|
STRICTTMPPATH= ${BPATH}:${XPATH}
|
1998-10-17 11:56:20 +00:00
|
|
|
TMPPATH= ${STRICTTMPPATH}:${PATH}
|
1998-08-31 01:08:08 +00:00
|
|
|
|
Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:
1) ABI breakages should no longer affect installworld over the live system.
2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.
3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.
The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.
Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)
2007-10-31 09:26:42 +00:00
|
|
|
#
|
|
|
|
# Avoid running mktemp(1) unless actually needed.
|
|
|
|
# It may not be functional, e.g., due to new ABI
|
|
|
|
# when in the middle of installing over this system.
|
|
|
|
#
|
|
|
|
.if make(distributeworld) || make(installworld)
|
2001-12-23 22:49:06 +00:00
|
|
|
INSTALLTMP!= /usr/bin/mktemp -d -u -t install
|
Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:
1) ABI breakages should no longer affect installworld over the live system.
2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.
3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.
The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.
Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)
2007-10-31 09:26:42 +00:00
|
|
|
.endif
|
2000-07-19 04:41:59 +00:00
|
|
|
|
1999-12-20 10:32:11 +00:00
|
|
|
#
|
|
|
|
# Building a world goes through the following stages
|
|
|
|
#
|
2003-04-06 21:46:44 +00:00
|
|
|
# 1. legacy stage [BMAKE]
|
2003-04-06 21:23:02 +00:00
|
|
|
# This stage is responsible for creating compatibility
|
|
|
|
# shims that are needed by the bootstrap-tools,
|
|
|
|
# build-tools and cross-tools stages.
|
|
|
|
# 1. bootstrap-tools stage [BMAKE]
|
1999-12-20 10:32:11 +00:00
|
|
|
# This stage is responsible for creating programs that
|
|
|
|
# are needed for backward compatibility reasons. They
|
|
|
|
# are not built as cross-tools.
|
2003-04-06 21:23:02 +00:00
|
|
|
# 2. build-tools stage [TMAKE]
|
1999-12-20 10:32:11 +00:00
|
|
|
# This stage is responsible for creating the object
|
|
|
|
# tree and building any tools that are needed during
|
|
|
|
# the build process.
|
2003-04-06 21:23:02 +00:00
|
|
|
# 3. cross-tools stage [XMAKE]
|
1999-12-20 10:32:11 +00:00
|
|
|
# This stage is responsible for creating any tools that
|
|
|
|
# are needed for cross-builds. A cross-compiler is one
|
|
|
|
# of them.
|
2000-10-13 01:19:36 +00:00
|
|
|
# 4. world stage [WMAKE]
|
1999-12-20 10:32:11 +00:00
|
|
|
# This stage actually builds the world.
|
2000-10-13 01:19:36 +00:00
|
|
|
# 5. install stage (optional) [IMAKE]
|
1999-12-20 10:32:11 +00:00
|
|
|
# This stage installs a previously built world.
|
|
|
|
#
|
|
|
|
|
2003-04-13 15:43:29 +00:00
|
|
|
BOOTSTRAPPING?= 0
|
|
|
|
|
1999-12-20 10:32:11 +00:00
|
|
|
# Common environment for world related stages
|
|
|
|
CROSSENV= MAKEOBJDIRPREFIX=${OBJTREE} \
|
Fix cross-building, etc:
1. To cross-build, one now needs to set TARGET_ARCH, and not the
MACHINE_ARCH. MACHINE_ARCH should never be changed manually!
2. Initialize DESTDIR= explicitly for bootstrap-tools, build-tools,
and cross-tools stages. This fixes broken header and library
dependencies problem. We build them in the host environment,
and obviously want them to depend on host headers and libraries.
The problem with broken header dependencies for bootstrap-tools
and cross-tools was already partially solved (see BOOTSTRAPPING
tests in bsd.prog.mk and bsd.lib.mk), but it was still there for
build-tools if the user ran "make world DESTDIR=/foo". Also,
for all of these stages, the library dependencies were broken
because of how bsd.libnames.mk define DPADD members.
We still provide a glue to install bootstrap- and cross-tools
under the ${WORLDTMP}.
Removed PATH overrides for bootstrap-, build-, and cross-tools
stages. There is just no reason why we would need to override
it, and the hacks to clean up the ${WORLDTMP} in the -DNOCLEAN
case are no longer needed with fixes from this step.
That is, we now never use ${WORLDTMP} headers and libraries,
and we don't use any ${WORLDTMP} installed binaries during
these stages. Again, these stages depend solely on the host
environment, including compiler, headers, and libraries.
3. Moved "miniperl" back from cross-tools (it has nothing to do
with a cross-compiler) to build-tools where it belongs. The
change from step 1 let to do this. Also, to make this work,
build-tools targets of "cc_tools" and "miniperl" were modified
to call "depend". Here follow the detailed explanations.
There are two categories of build tools, for now. In the first
category there are "cc_tools" and "miniperl". They occupy the
whole (sub)directory, and nothing needs to be done in this
subdirectory later during the "all" stage. They are also
constructed using system makefiles. We must build the .depend
early in the build-tools stage because:
1) They use (and depend on) the host environment.
2) If we don't do this in build-tools, the "depend" stage of
buildworld will do this for us; wrong library and header
dependencies will be recorded (DESTDIR=${WORLDTMP}) and,
what's worse, the "all" stage may then clobber the
build-architecture format tools (that we built in the
build-tools stage) with the target-architecture format
ones, breaking cross build.
In the second category there are all other build-tools. They
share their directory with the "main" module that needs them
in the "all" stage, and they don't show up themselves in the
.depend file. The portion of this fix was already committed
in gnu/usr.bin/cc/cc_tools/Makefile,v 1.52.
4. "libperl" is no longer a build tool, and "miniperl" is the
stand-alone application. I had to make this change because
build-tools and "all" stages share the same object directory.
Without this change, if we cross compile, libperl.a is first
built for the build architecture during the build-tools stage
(for the purposes of immediate linkage with "miniperl").
Later on, the "all" stage sees this library as up-to-date,
and doesn't rebuild it. The effect is that the wrong format
static libperl library is installed with installworld.
5. Fixed "includes" to install secure/lib/libtelnet headers if
required.
Reviewed by: bde
2001-09-29 13:17:54 +00:00
|
|
|
MACHINE_ARCH=${TARGET_ARCH} \
|
2001-10-25 07:28:55 +00:00
|
|
|
MACHINE=${TARGET} \
|
2011-02-22 08:13:49 +00:00
|
|
|
CPUTYPE=${TARGET_CPUTYPE}
|
|
|
|
.if ${MK_GROFF} != "no"
|
|
|
|
CROSSENV+= GROFF_BIN_PATH=${WORLDTMP}/legacy/usr/bin \
|
|
|
|
GROFF_FONT_PATH=${WORLDTMP}/legacy/usr/share/groff_font \
|
|
|
|
GROFF_TMAC_PATH=${WORLDTMP}/legacy/usr/share/tmac
|
|
|
|
.endif
|
1999-12-09 16:40:27 +00:00
|
|
|
|
2003-04-06 21:23:02 +00:00
|
|
|
# bootstrap-tools stage
|
2004-08-25 22:06:29 +00:00
|
|
|
BMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \
|
2003-04-13 11:42:55 +00:00
|
|
|
PATH=${BPATH}:${PATH} \
|
2003-04-12 15:07:46 +00:00
|
|
|
WORLDTMP=${WORLDTMP} \
|
2008-05-23 04:22:14 +00:00
|
|
|
VERSION="${VERSION}" \
|
2012-09-13 16:00:46 +00:00
|
|
|
MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \
|
|
|
|
COMPILER_TYPE=${COMPILER_TYPE}
|
2003-04-05 20:30:30 +00:00
|
|
|
BMAKE= MAKEOBJDIRPREFIX=${WORLDTMP} \
|
2013-02-03 10:26:24 +00:00
|
|
|
${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
|
2004-08-25 22:06:29 +00:00
|
|
|
DESTDIR= \
|
2002-11-13 13:49:29 +00:00
|
|
|
BOOTSTRAPPING=${OSRELDATE} \
|
2009-02-21 15:04:31 +00:00
|
|
|
SSP_CFLAGS= \
|
2006-03-17 18:54:44 +00:00
|
|
|
-DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \
|
2011-11-29 19:46:17 +00:00
|
|
|
-DNO_PIC -DNO_PROFILE -DNO_SHARED \
|
2014-02-13 19:46:48 +00:00
|
|
|
-DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD -DNO_TESTS
|
1999-12-20 10:32:11 +00:00
|
|
|
|
2003-04-06 21:23:02 +00:00
|
|
|
# build-tools stage
|
2003-04-05 20:30:30 +00:00
|
|
|
TMAKE= MAKEOBJDIRPREFIX=${OBJTREE} \
|
2013-02-03 10:26:24 +00:00
|
|
|
${BMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
|
2006-09-08 10:09:02 +00:00
|
|
|
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
|
2004-08-25 22:06:29 +00:00
|
|
|
DESTDIR= \
|
2011-05-11 17:50:19 +00:00
|
|
|
BOOTSTRAPPING=${OSRELDATE} \
|
2009-02-21 15:04:31 +00:00
|
|
|
SSP_CFLAGS= \
|
2011-05-11 17:50:19 +00:00
|
|
|
-DNO_LINT \
|
2014-02-13 19:46:48 +00:00
|
|
|
-DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD -DNO_TESTS
|
1999-12-20 10:32:11 +00:00
|
|
|
|
2003-04-06 21:23:02 +00:00
|
|
|
# cross-tools stage
|
2006-03-17 18:54:44 +00:00
|
|
|
XMAKE= TOOLS_PREFIX=${WORLDTMP} ${BMAKE} \
|
2006-09-07 20:27:56 +00:00
|
|
|
TARGET=${TARGET} TARGET_ARCH=${TARGET_ARCH} \
|
2014-02-13 19:46:48 +00:00
|
|
|
-DWITHOUT_GDB -DNO_TESTS
|
1999-12-20 10:32:11 +00:00
|
|
|
|
2014-08-21 14:56:57 +00:00
|
|
|
# kernel-tools stage
|
|
|
|
KTMAKEENV= INSTALL="sh ${.CURDIR}/tools/install.sh" \
|
|
|
|
PATH=${BPATH}:${PATH} \
|
|
|
|
WORLDTMP=${WORLDTMP} \
|
|
|
|
VERSION="${VERSION}" \
|
|
|
|
COMPILER_TYPE=${COMPILER_TYPE}
|
|
|
|
KTMAKE= TOOLS_PREFIX=${WORLDTMP} MAKEOBJDIRPREFIX=${WORLDTMP} \
|
|
|
|
${KTMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 \
|
|
|
|
DESTDIR= \
|
|
|
|
BOOTSTRAPPING=${OSRELDATE} \
|
|
|
|
SSP_CFLAGS= \
|
|
|
|
-DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN \
|
|
|
|
-DNO_PIC -DNO_PROFILE -DNO_SHARED \
|
|
|
|
-DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF -DEARLY_BUILD
|
|
|
|
|
1999-12-20 10:32:11 +00:00
|
|
|
# world stage
|
|
|
|
WMAKEENV= ${CROSSENV} \
|
2003-09-07 14:15:40 +00:00
|
|
|
_SHLIBDIRPREFIX=${WORLDTMP} \
|
2012-05-07 09:00:30 +00:00
|
|
|
_LDSCRIPTROOT= \
|
2008-05-23 04:22:14 +00:00
|
|
|
VERSION="${VERSION}" \
|
2000-01-11 16:23:51 +00:00
|
|
|
INSTALL="sh ${.CURDIR}/tools/install.sh" \
|
1999-12-10 10:48:20 +00:00
|
|
|
PATH=${TMPPATH}
|
2013-06-14 22:32:47 +00:00
|
|
|
|
|
|
|
# make hierarchy
|
2013-08-30 01:32:47 +00:00
|
|
|
HMAKE= PATH=${TMPPATH} ${MAKE} LOCAL_MTREE=${LOCAL_MTREE:Q}
|
2013-06-14 22:32:47 +00:00
|
|
|
.if defined(NO_ROOT)
|
|
|
|
HMAKE+= PATH=${TMPPATH} METALOG=${METALOG} -DNO_ROOT
|
|
|
|
.endif
|
|
|
|
|
2010-04-22 09:30:02 +00:00
|
|
|
.if ${MK_CDDL} == "no"
|
2008-05-23 04:22:14 +00:00
|
|
|
WMAKEENV+= NO_CTF=1
|
|
|
|
.endif
|
2013-05-15 14:30:03 +00:00
|
|
|
|
|
|
|
.if defined(CROSS_TOOLCHAIN_PREFIX)
|
|
|
|
CROSS_COMPILER_PREFIX?=${CROSS_TOOLCHAIN_PREFIX}
|
|
|
|
CROSS_BINUTILS_PREFIX?=${CROSS_TOOLCHAIN_PREFIX}
|
|
|
|
.endif
|
|
|
|
XCOMPILERS= CC CXX CPP
|
|
|
|
.for COMPILER in ${XCOMPILERS}
|
|
|
|
.if defined(CROSS_COMPILER_PREFIX)
|
|
|
|
X${COMPILER}?= ${CROSS_COMPILER_PREFIX}${${COMPILER}}
|
|
|
|
.else
|
|
|
|
X${COMPILER}?= ${${COMPILER}}
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
XBINUTILS= AS AR LD NM OBJDUMP RANLIB STRINGS
|
|
|
|
.for BINUTIL in ${XBINUTILS}
|
|
|
|
.if defined(CROSS_BINUTILS_PREFIX)
|
|
|
|
X${BINUTIL}?= ${CROSS_BINUTILS_PREFIX}${${BINUTIL}}
|
|
|
|
.else
|
|
|
|
X${BINUTIL}?= ${${BINUTIL}}
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
WMAKEENV+= CC="${XCC} ${XFLAGS}" CXX="${XCXX} ${XFLAGS}" \
|
|
|
|
CPP="${XCPP} ${XFLAGS}" \
|
|
|
|
AS="${XAS}" AR="${XAR}" LD="${XLD}" NM=${XNM} \
|
|
|
|
OBJDUMP=${XOBJDUMP} RANLIB=${XRANLIB} STRINGS=${XSTRINGS}
|
|
|
|
|
|
|
|
.if ${XCC:T:Mgcc} == "gcc"
|
2012-09-13 16:00:46 +00:00
|
|
|
WMAKE_COMPILER_TYPE= gcc
|
2013-05-15 14:30:03 +00:00
|
|
|
.elif ${XCC:T:Mclang} == "clang"
|
2012-09-13 16:00:46 +00:00
|
|
|
WMAKE_COMPILER_TYPE= clang
|
|
|
|
.elif ${MK_CLANG_IS_CC} == "no"
|
|
|
|
WMAKE_COMPILER_TYPE= gcc
|
|
|
|
.else
|
|
|
|
WMAKE_COMPILER_TYPE= clang
|
|
|
|
.endif
|
2013-05-15 14:30:03 +00:00
|
|
|
IMAKE_COMPILER_TYPE= COMPILER_TYPE=${WMAKE_COMPILER_TYPE}
|
|
|
|
|
|
|
|
.if ${XCC:M/*}
|
|
|
|
XFLAGS= --sysroot=${WORLDTMP}
|
|
|
|
.if defined(CROSS_BINUTILS_PREFIX)
|
|
|
|
# In the case of xdev-build tools, CROSS_BINUTILS_PREFIX won't be a
|
|
|
|
# directory, but the compiler will look in the right place for it's
|
|
|
|
# tools so we don't need to tell it where to look.
|
|
|
|
.if exists(${CROSS_BINUTILS_PREFIX})
|
|
|
|
XFLAGS+= -B${CROSS_BINUTILS_PREFIX}
|
|
|
|
.endif
|
|
|
|
.else
|
|
|
|
XFLAGS+= -B${WORLDTMP}/usr/bin
|
|
|
|
.endif
|
|
|
|
.if ${TARGET_ARCH} != ${MACHINE_ARCH} && ${WMAKE_COMPILER_TYPE} == "clang"
|
|
|
|
.if (${TARGET_ARCH} == "arm" || ${TARGET_ARCH} == "armv6") && \
|
|
|
|
${MK_ARM_EABI} != "no"
|
|
|
|
TARGET_ABI= gnueabi
|
|
|
|
.else
|
|
|
|
TARGET_ABI= unknown
|
|
|
|
.endif
|
|
|
|
TARGET_TRIPLE?= ${TARGET_ARCH:C/amd64/x86_64/}-${TARGET_ABI}-freebsd10.0
|
|
|
|
XFLAGS+= -target ${TARGET_TRIPLE}
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
2012-09-13 16:00:46 +00:00
|
|
|
WMAKEENV+= COMPILER_TYPE=${WMAKE_COMPILER_TYPE}
|
2013-02-03 10:26:24 +00:00
|
|
|
WMAKE= ${WMAKEENV} ${MAKE} ${WORLD_FLAGS} -f Makefile.inc1 DESTDIR=${WORLDTMP}
|
1999-12-08 13:45:11 +00:00
|
|
|
|
2010-07-13 21:19:59 +00:00
|
|
|
.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64"
|
2004-11-06 03:14:26 +00:00
|
|
|
# 32 bit world
|
|
|
|
LIB32TMP= ${OBJTREE}${.CURDIR}/lib32
|
|
|
|
|
2010-07-13 21:19:59 +00:00
|
|
|
.if ${TARGET_ARCH} == "amd64"
|
2005-12-07 22:55:29 +00:00
|
|
|
.if empty(TARGET_CPUTYPE)
|
2008-08-19 14:23:26 +00:00
|
|
|
LIB32CPUFLAGS= -march=i686 -mmmx -msse -msse2
|
2005-12-07 17:41:10 +00:00
|
|
|
.else
|
2008-08-19 14:23:26 +00:00
|
|
|
LIB32CPUFLAGS= -march=${TARGET_CPUTYPE}
|
2005-12-07 17:41:10 +00:00
|
|
|
.endif
|
2010-07-13 21:19:59 +00:00
|
|
|
LIB32WMAKEENV= MACHINE=i386 MACHINE_ARCH=i386 \
|
2012-10-07 16:45:38 +00:00
|
|
|
MACHINE_CPU="i686 mmx sse sse2"
|
|
|
|
LIB32WMAKEFLAGS= \
|
|
|
|
AS="${AS} --32" \
|
|
|
|
LD="${LD} -m elf_i386_fbsd -Y P,${LIB32TMP}/usr/lib32"
|
2010-07-13 21:19:59 +00:00
|
|
|
|
|
|
|
.elif ${TARGET_ARCH} == "powerpc64"
|
|
|
|
.if empty(TARGET_CPUTYPE)
|
|
|
|
LIB32CPUFLAGS= -mcpu=powerpc
|
|
|
|
.else
|
|
|
|
LIB32CPUFLAGS= -mcpu=${TARGET_CPUTYPE}
|
|
|
|
.endif
|
2012-10-07 16:45:38 +00:00
|
|
|
LIB32WMAKEENV= MACHINE=powerpc MACHINE_ARCH=powerpc
|
|
|
|
LIB32WMAKEFLAGS= \
|
2011-11-19 19:25:57 +00:00
|
|
|
LD="${LD} -m elf32ppc_fbsd"
|
2010-07-13 21:19:59 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
|
|
|
|
LIB32FLAGS= -m32 ${LIB32CPUFLAGS} -DCOMPAT_32BIT \
|
2009-11-01 08:20:30 +00:00
|
|
|
-isystem ${LIB32TMP}/usr/include/ \
|
2004-11-06 03:14:26 +00:00
|
|
|
-L${LIB32TMP}/usr/lib32 \
|
|
|
|
-B${LIB32TMP}/usr/lib32
|
2013-05-21 16:58:23 +00:00
|
|
|
.if ${XCC:M/*}
|
|
|
|
LIB32FLAGS+= --sysroot=${WORLDTMP}
|
|
|
|
.endif
|
2004-11-06 03:14:26 +00:00
|
|
|
|
|
|
|
# Yes, the flags are redundant.
|
2010-07-13 21:19:59 +00:00
|
|
|
LIB32WMAKEENV+= MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \
|
2004-11-06 03:14:26 +00:00
|
|
|
_SHLIBDIRPREFIX=${LIB32TMP} \
|
2012-05-07 09:00:30 +00:00
|
|
|
_LDSCRIPTROOT=${LIB32TMP} \
|
2008-05-23 04:22:14 +00:00
|
|
|
VERSION="${VERSION}" \
|
2004-11-06 03:14:26 +00:00
|
|
|
INSTALL="sh ${.CURDIR}/tools/install.sh" \
|
|
|
|
PATH=${TMPPATH} \
|
|
|
|
LIBDIR=/usr/lib32 \
|
2012-09-13 16:00:46 +00:00
|
|
|
SHLIBDIR=/usr/lib32 \
|
2013-09-08 09:40:23 +00:00
|
|
|
LIBPRIVATEDIR=/usr/lib32/private \
|
2014-08-13 06:45:02 +00:00
|
|
|
COMPILER_TYPE=${WMAKE_COMPILER_TYPE} \
|
|
|
|
DTRACE="${DTRACE} -32"
|
2012-10-07 16:45:38 +00:00
|
|
|
LIB32WMAKEFLAGS+= \
|
2013-05-15 14:30:03 +00:00
|
|
|
CC="${XCC} ${LIB32FLAGS}" \
|
|
|
|
CXX="${XCXX} ${LIB32FLAGS}" \
|
2012-10-07 16:45:38 +00:00
|
|
|
DESTDIR=${LIB32TMP} \
|
|
|
|
-DCOMPAT_32BIT \
|
2013-01-17 17:27:10 +00:00
|
|
|
-DLIBRARIES_ONLY \
|
2012-10-07 16:45:38 +00:00
|
|
|
-DNO_CPU_CFLAGS \
|
|
|
|
-DNO_CTF \
|
2014-02-13 19:46:48 +00:00
|
|
|
-DNO_LINT \
|
|
|
|
-DNO_TESTS
|
2004-11-06 03:14:26 +00:00
|
|
|
|
2012-10-07 16:45:38 +00:00
|
|
|
LIB32WMAKE= ${LIB32WMAKEENV} ${MAKE} ${LIB32WMAKEFLAGS} \
|
2013-09-30 17:23:45 +00:00
|
|
|
-DWITHOUT_MAN -DWITHOUT_INFO -DWITHOUT_HTML
|
2013-01-15 00:12:34 +00:00
|
|
|
LIB32IMAKE= ${LIB32WMAKE:NINSTALL=*:NDESTDIR=*:N_LDSCRIPTROOT=*} -DNO_INCS \
|
|
|
|
${IMAKE_INSTALL}
|
2004-11-06 03:14:26 +00:00
|
|
|
.endif
|
|
|
|
|
2012-05-07 09:00:30 +00:00
|
|
|
IMAKEENV= ${CROSSENV:N_LDSCRIPTROOT=*}
|
2013-01-15 00:12:34 +00:00
|
|
|
IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 \
|
2013-05-15 14:30:03 +00:00
|
|
|
${IMAKE_INSTALL} ${IMAKE_MTREE} ${IMAKE_COMPILER_TYPE}
|
2004-08-09 11:38:41 +00:00
|
|
|
.if empty(.MAKEFLAGS:M-n)
|
Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:
1) ABI breakages should no longer affect installworld over the live system.
2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.
3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.
The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.
Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)
2007-10-31 09:26:42 +00:00
|
|
|
IMAKEENV+= PATH=${STRICTTMPPATH}:${INSTALLTMP} \
|
|
|
|
LD_LIBRARY_PATH=${INSTALLTMP} \
|
|
|
|
PATH_LOCALE=${INSTALLTMP}/locale
|
|
|
|
IMAKE+= __MAKE_SHELL=${INSTALLTMP}/sh
|
2004-08-09 11:38:41 +00:00
|
|
|
.else
|
Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:
1) ABI breakages should no longer affect installworld over the live system.
2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.
3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.
The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.
Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)
2007-10-31 09:26:42 +00:00
|
|
|
IMAKEENV+= PATH=${TMPPATH}:${INSTALLTMP}
|
2004-08-09 11:38:41 +00:00
|
|
|
.endif
|
2013-01-15 00:12:34 +00:00
|
|
|
.if defined(DB_FROM_SRC)
|
2013-01-22 21:10:03 +00:00
|
|
|
INSTALLFLAGS+= -N ${.CURDIR}/etc
|
|
|
|
MTREEFLAGS+= -N ${.CURDIR}/etc
|
|
|
|
.endif
|
2013-05-30 14:09:58 +00:00
|
|
|
_INSTALL_DDIR= ${DESTDIR}/${DISTDIR}
|
|
|
|
INSTALL_DDIR= ${_INSTALL_DDIR:S://:/:g:C:/$::}
|
2013-01-22 21:10:03 +00:00
|
|
|
.if defined(NO_ROOT)
|
|
|
|
METALOG?= ${DESTDIR}/${DISTDIR}/METALOG
|
|
|
|
IMAKE+= -DNO_ROOT METALOG=${METALOG}
|
2013-05-30 14:09:58 +00:00
|
|
|
INSTALLFLAGS+= -U -M ${METALOG} -D ${INSTALL_DDIR}
|
2013-01-22 21:10:03 +00:00
|
|
|
MTREEFLAGS+= -W
|
|
|
|
.endif
|
|
|
|
.if defined(DB_FROM_SRC) || defined(NO_ROOT)
|
|
|
|
IMAKE_INSTALL= INSTALL="install ${INSTALLFLAGS}"
|
|
|
|
IMAKE_MTREE= MTREE_CMD="nmtree ${MTREEFLAGS}"
|
2013-01-15 00:12:34 +00:00
|
|
|
.endif
|
1999-12-10 10:48:20 +00:00
|
|
|
|
2001-01-22 08:07:58 +00:00
|
|
|
# kernel stage
|
2002-09-17 01:49:00 +00:00
|
|
|
KMAKEENV= ${WMAKEENV}
|
2013-04-12 17:57:40 +00:00
|
|
|
KMAKE= ${KMAKEENV} ${MAKE} ${.MAKEFLAGS} ${KERNEL_FLAGS} KERNEL=${INSTKERNNAME}
|
2001-01-22 08:07:58 +00:00
|
|
|
|
1998-08-31 01:08:08 +00:00
|
|
|
#
|
|
|
|
# buildworld
|
|
|
|
#
|
|
|
|
# Attempt to rebuild the entire system, with reasonable chance of
|
|
|
|
# success, regardless of how old your existing system is.
|
|
|
|
#
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
_worldtmp:
|
2003-02-04 08:15:30 +00:00
|
|
|
.if ${.CURDIR:C/[^,]//g} != ""
|
|
|
|
# The m4 build of sendmail files doesn't like it if ',' is used
|
|
|
|
# anywhere in the path of it's files.
|
|
|
|
@echo
|
|
|
|
@echo "*** Error: path to source tree contains a comma ','"
|
|
|
|
@echo
|
2004-03-04 09:14:30 +00:00
|
|
|
false
|
2003-02-04 08:15:30 +00:00
|
|
|
.endif
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
1999-12-10 10:48:20 +00:00
|
|
|
@echo ">>> Rebuilding the temporary build tree"
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-12-21 12:21:26 +00:00
|
|
|
.if !defined(NO_CLEAN)
|
1998-08-31 01:08:08 +00:00
|
|
|
rm -rf ${WORLDTMP}
|
2010-07-13 21:19:59 +00:00
|
|
|
.if defined(LIB32TMP)
|
2005-08-05 23:48:58 +00:00
|
|
|
rm -rf ${LIB32TMP}
|
|
|
|
.endif
|
2002-04-11 14:49:32 +00:00
|
|
|
.else
|
2003-04-06 23:46:02 +00:00
|
|
|
rm -rf ${WORLDTMP}/legacy/usr/include
|
2008-02-05 15:41:58 +00:00
|
|
|
# XXX - These three can depend on any header file.
|
2002-04-11 14:49:32 +00:00
|
|
|
rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/ioctl.c
|
2008-02-05 08:56:18 +00:00
|
|
|
rm -f ${OBJTREE}${.CURDIR}/usr.bin/kdump/kdump_subr.c
|
2002-04-11 14:49:32 +00:00
|
|
|
rm -f ${OBJTREE}${.CURDIR}/usr.bin/truss/ioctl.c
|
1999-12-10 10:48:20 +00:00
|
|
|
.endif
|
2003-04-13 14:34:17 +00:00
|
|
|
.for _dir in \
|
2013-01-29 22:17:58 +00:00
|
|
|
lib usr legacy/bin legacy/usr
|
2003-04-13 14:34:17 +00:00
|
|
|
mkdir -p ${WORLDTMP}/${_dir}
|
1999-12-08 13:45:11 +00:00
|
|
|
.endfor
|
2009-03-15 13:14:06 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
|
|
|
-p ${WORLDTMP}/legacy/usr >/dev/null
|
2011-02-22 08:13:49 +00:00
|
|
|
.if ${MK_GROFF} != "no"
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.groff.dist \
|
|
|
|
-p ${WORLDTMP}/legacy/usr >/dev/null
|
|
|
|
.endif
|
2009-03-15 13:14:06 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
|
|
|
-p ${WORLDTMP}/usr >/dev/null
|
2003-05-18 20:22:26 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
|
2004-03-14 16:44:27 +00:00
|
|
|
-p ${WORLDTMP}/usr/include >/dev/null
|
2001-03-22 09:54:25 +00:00
|
|
|
ln -sf ${.CURDIR}/sys ${WORLDTMP}
|
2013-06-07 21:40:02 +00:00
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
|
|
|
# We could instead disable debug files for these build stages
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
|
|
|
|
-p ${WORLDTMP}/legacy/usr/lib >/dev/null
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
|
|
|
|
-p ${WORLDTMP}/usr/lib >/dev/null
|
|
|
|
.endif
|
2013-12-28 20:05:31 +00:00
|
|
|
.if ${MK_TESTS} != "no"
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
|
2013-12-28 23:08:58 +00:00
|
|
|
-p ${WORLDTMP}/usr >/dev/null
|
2013-12-28 20:05:31 +00:00
|
|
|
.endif
|
2012-10-18 12:32:51 +00:00
|
|
|
.for _mtree in ${LOCAL_MTREE}
|
|
|
|
mtree -deU -f ${.CURDIR}/${_mtree} -p ${WORLDTMP} > /dev/null
|
|
|
|
.endfor
|
2003-04-06 21:46:44 +00:00
|
|
|
_legacy:
|
2003-04-06 03:50:28 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2003-09-01 06:43:24 +00:00
|
|
|
@echo ">>> stage 1.1: legacy release compatibility shims"
|
2003-04-06 03:50:28 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-08-09 11:38:41 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${BMAKE} legacy
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
_bootstrap-tools:
|
1999-12-10 10:48:20 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2003-09-01 06:43:24 +00:00
|
|
|
@echo ">>> stage 1.2: bootstrap tools"
|
1999-12-10 10:48:20 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-08-09 11:38:41 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${BMAKE} bootstrap-tools
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
_cleanobj:
|
2004-12-21 12:21:26 +00:00
|
|
|
.if !defined(NO_CLEAN)
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2003-09-01 06:43:24 +00:00
|
|
|
@echo ">>> stage 2.1: cleaning up the object tree"
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-08-09 11:38:41 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${WMAKE} ${CLEANDIR:S/^/par-/}
|
2010-07-13 21:19:59 +00:00
|
|
|
.if defined(LIB32TMP)
|
2007-02-28 20:06:21 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${LIB32WMAKE} -f Makefile.inc1 ${CLEANDIR:S/^/par-/}
|
2005-08-05 23:48:58 +00:00
|
|
|
.endif
|
1999-01-04 12:05:59 +00:00
|
|
|
.endif
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
_obj:
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2003-09-01 06:43:24 +00:00
|
|
|
@echo ">>> stage 2.2: rebuilding the object tree"
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-08-09 11:38:41 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${WMAKE} par-obj
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
_build-tools:
|
o Add games/caesar to the list of bootstrap-tools so that a
buildworld doesn't break because the host doesn't have any
games installed,
o Add a new build stage: TMAKE. TMAKE builds all the build-tools
targets in the respective makefiles. Note that these targets
don't use the bootstrap tools,
o Add elf2exe to the bootstrap-tools when cross-building Alpha on
other platforms,
o Add ${WORLDTMP}/usr/games to TMPPATH,
o Remove ${WORLDTMP}/usr/bin even when NOCLEAN is defined. This
prevents using any bootstrap-tools previously installed. Most
importantly, it prevents using the cross-compiler when we still
need the native compiler.
The current stages are BMAKE, TMAKE, XMAKE and IMAKE in that order.
BMAKE builds bootstrap-tools that either solve compatibility problems
or are needed as cross-tools,
TMAKE builds the support tools necessary by some parts in the source
tree and also performs the cleandir and par-obj targets,
XMAKE builds the includes, libraries and everything (resp.), and
IMAKE installs the world. This stage needs further work if it's to be
used to install -current over -stable for example.
This is the last major update towards cross-building.
1999-12-16 13:47:34 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2003-09-01 06:43:24 +00:00
|
|
|
@echo ">>> stage 2.3: build tools"
|
o Add games/caesar to the list of bootstrap-tools so that a
buildworld doesn't break because the host doesn't have any
games installed,
o Add a new build stage: TMAKE. TMAKE builds all the build-tools
targets in the respective makefiles. Note that these targets
don't use the bootstrap tools,
o Add elf2exe to the bootstrap-tools when cross-building Alpha on
other platforms,
o Add ${WORLDTMP}/usr/games to TMPPATH,
o Remove ${WORLDTMP}/usr/bin even when NOCLEAN is defined. This
prevents using any bootstrap-tools previously installed. Most
importantly, it prevents using the cross-compiler when we still
need the native compiler.
The current stages are BMAKE, TMAKE, XMAKE and IMAKE in that order.
BMAKE builds bootstrap-tools that either solve compatibility problems
or are needed as cross-tools,
TMAKE builds the support tools necessary by some parts in the source
tree and also performs the cleandir and par-obj targets,
XMAKE builds the includes, libraries and everything (resp.), and
IMAKE installs the world. This stage needs further work if it's to be
used to install -current over -stable for example.
This is the last major update towards cross-building.
1999-12-16 13:47:34 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-08-09 11:38:41 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${TMAKE} build-tools
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
_cross-tools:
|
1999-11-24 06:04:11 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
1999-12-20 10:32:11 +00:00
|
|
|
@echo ">>> stage 3: cross tools"
|
1999-11-24 06:04:11 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-08-09 11:38:41 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${XMAKE} cross-tools
|
2014-08-21 14:56:57 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${XMAKE} kernel-tools
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
_includes:
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2003-11-03 21:09:47 +00:00
|
|
|
@echo ">>> stage 4.1: building includes"
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2013-05-30 15:25:54 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${WMAKE} SHARED=symlinks par-includes
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
_libraries:
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2003-09-01 06:43:24 +00:00
|
|
|
@echo ">>> stage 4.2: building libraries"
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-08-09 11:38:41 +00:00
|
|
|
${_+_}cd ${.CURDIR}; \
|
2006-03-17 18:54:44 +00:00
|
|
|
${WMAKE} -DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \
|
2014-02-13 19:46:48 +00:00
|
|
|
-DWITHOUT_MAN -DNO_PROFILE -DNO_TESTS libraries
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
_depend:
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2003-09-01 06:43:24 +00:00
|
|
|
@echo ">>> stage 4.3: make dependencies"
|
1999-12-20 10:32:11 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-08-09 11:38:41 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${WMAKE} par-depend
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
everything:
|
1999-12-20 10:32:11 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2004-03-19 17:57:07 +00:00
|
|
|
@echo ">>> stage 4.4: building everything"
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-08-09 11:38:41 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${WMAKE} par-all
|
2010-07-13 21:19:59 +00:00
|
|
|
.if defined(LIB32TMP)
|
2004-11-06 03:14:26 +00:00
|
|
|
build32:
|
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> stage 5.1: building 32 bit shim libraries"
|
|
|
|
@echo "--------------------------------------------------------------"
|
Add the BSD-licensed Citrus iconv to the base system with default off
setting. It can be built by setting the WITH_ICONV knob. While this
knob is unset, the library part, the binaries, the header file and
the metadata files will not be built or installed so it makes no impact
on the system if left turned off.
This work is based on the iconv implementation in NetBSD but a great
number of improvements and feature additions have been included:
- Some utilities have been added. There is a conversion table generator,
which can compare conversion tables to reference data generated by
GNU libiconv. This helps ensuring conversion compatibility.
- UTF-16 surrogate support and some endianness issues have been fixed.
- The rather chaotic Makefiles to build metadata have been refactored
and cleaned up, now it is easy to read and it is also easier to add
support for new encodings.
- A bunch of new encodings and encoding aliases have been added.
- Support for 1->2, 1->3 and 1->4 mappings, which is needed for
transliterating with flying accents as GNU does, like "u.
- Lots of warnings have been fixed, the major part of the code is
now WARNS=6 clean.
- New section 1 and section 5 manual pages have been added.
- Some GNU-specific calls have been implemented:
iconvlist(), iconvctl(), iconv_canonicalize(), iconv_open_into()
- Support for GNU's //IGNORE suffix has been added.
- The "-" argument for stdin is now recognized in iconv(1) as per POSIX.
- The Big5 conversion module has been fixed.
- The iconv.h header files is supposed to be compatible with the
GNU version, i.e. sources should build with base iconv.h and
GNU libiconv. It also includes a macro magic to deal with the
char ** and const char ** incompatibility.
- GNU compatibility: "" or "char" means the current local
encoding in use
- Various cleanups and style(9) fixes.
Approved by: delphij (mentor)
Obtained from: The NetBSD Project
Sponsored by: Google Summer of Code 2009
2011-02-25 00:04:39 +00:00
|
|
|
mkdir -p ${LIB32TMP}/usr/include
|
2009-03-15 13:14:06 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
|
|
|
-p ${LIB32TMP}/usr >/dev/null
|
2004-11-06 03:14:26 +00:00
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
|
|
|
|
-p ${LIB32TMP}/usr/include >/dev/null
|
2013-06-07 21:40:02 +00:00
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
|
|
|
|
-p ${LIB32TMP}/usr/lib >/dev/null
|
|
|
|
.endif
|
2005-08-05 23:48:58 +00:00
|
|
|
mkdir -p ${WORLDTMP}
|
2004-11-06 03:14:26 +00:00
|
|
|
ln -sf ${.CURDIR}/sys ${WORLDTMP}
|
|
|
|
.for _t in obj includes
|
2011-03-01 14:53:36 +00:00
|
|
|
cd ${.CURDIR}/include; ${LIB32WMAKE} DIRPRFX=include/ ${_t}
|
|
|
|
cd ${.CURDIR}/lib; ${LIB32WMAKE} DIRPRFX=lib/ ${_t}
|
2007-04-06 02:13:30 +00:00
|
|
|
.if ${MK_CDDL} != "no"
|
2011-03-01 14:53:36 +00:00
|
|
|
cd ${.CURDIR}/cddl/lib; ${LIB32WMAKE} DIRPRFX=cddl/lib/ ${_t}
|
2007-04-06 02:13:30 +00:00
|
|
|
.endif
|
2011-03-01 14:53:36 +00:00
|
|
|
cd ${.CURDIR}/gnu/lib; ${LIB32WMAKE} DIRPRFX=gnu/lib/ ${_t}
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_CRYPT} != "no"
|
2011-03-01 14:53:36 +00:00
|
|
|
cd ${.CURDIR}/secure/lib; ${LIB32WMAKE} DIRPRFX=secure/lib/ ${_t}
|
2004-11-06 03:14:26 +00:00
|
|
|
.endif
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_KERBEROS} != "no"
|
2011-03-01 14:53:36 +00:00
|
|
|
cd ${.CURDIR}/kerberos5/lib; ${LIB32WMAKE} DIRPRFX=kerberos5/lib ${_t}
|
2004-11-15 05:59:10 +00:00
|
|
|
.endif
|
2004-11-06 03:14:26 +00:00
|
|
|
.endfor
|
2006-05-17 09:33:15 +00:00
|
|
|
.for _dir in usr.bin/lex/lib
|
2011-03-01 14:53:36 +00:00
|
|
|
cd ${.CURDIR}/${_dir}; ${LIB32WMAKE} DIRPRFX=${_dir}/ obj
|
2004-12-01 23:23:14 +00:00
|
|
|
.endfor
|
2007-03-09 12:11:58 +00:00
|
|
|
.for _dir in lib/ncurses/ncurses lib/ncurses/ncursesw lib/libmagic
|
2004-11-06 03:14:26 +00:00
|
|
|
cd ${.CURDIR}/${_dir}; \
|
2012-11-30 20:50:34 +00:00
|
|
|
WORLDTMP=${WORLDTMP} \
|
|
|
|
MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \
|
2009-02-21 15:04:31 +00:00
|
|
|
MAKEOBJDIRPREFIX=${OBJTREE}/lib32 ${MAKE} SSP_CFLAGS= DESTDIR= \
|
During buildworld and buildkernel, define EARLY_BUILD in the earlier
stages (build-tools, cross-tools, etc) of the build, so we can detect in
bsd.*.mk whether to pass compiler-specific flags to ${CC}.
In particular, this commit will allow using WITH_CLANG_IS_CC when the
base compiler is still gcc, and when ${CC}, ${CXX} and ${CPP} are left
at their defaults. The early stages will then be built using gcc, and
no clang-specific flags will be passed to it. The later stages will be
built as usual.
The EARLY_BUILD define can also serve other uses, such as building the
world stage C++ executables with libc++ instead of libstdc++: during the
early build stages, we cannot assume libc++ is already available, so we
must still build with libstdc++ at that time.
MFC after: 1 week
2012-06-03 20:35:41 +00:00
|
|
|
DIRPRFX=${_dir}/ -DNO_LINT -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF \
|
|
|
|
-DEARLY_BUILD build-tools
|
2004-11-06 03:14:26 +00:00
|
|
|
.endfor
|
|
|
|
cd ${.CURDIR}; \
|
2007-02-28 20:06:21 +00:00
|
|
|
${LIB32WMAKE} -f Makefile.inc1 libraries
|
2004-11-06 03:14:26 +00:00
|
|
|
.for _t in obj depend all
|
2011-03-01 14:53:36 +00:00
|
|
|
cd ${.CURDIR}/libexec/rtld-elf; PROG=ld-elf32.so.1 ${LIB32WMAKE} \
|
|
|
|
DIRPRFX=libexec/rtld-elf/ ${_t}
|
|
|
|
cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32WMAKE} \
|
|
|
|
DIRPRFX=usr.bin/ldd ${_t}
|
2004-11-06 03:14:26 +00:00
|
|
|
.endfor
|
|
|
|
|
2005-06-16 18:16:14 +00:00
|
|
|
distribute32 install32:
|
2005-08-03 20:27:06 +00:00
|
|
|
cd ${.CURDIR}/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
|
2008-05-23 04:22:14 +00:00
|
|
|
.if ${MK_CDDL} != "no"
|
|
|
|
cd ${.CURDIR}/cddl/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
|
|
|
|
.endif
|
2005-08-03 20:27:06 +00:00
|
|
|
cd ${.CURDIR}/gnu/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_CRYPT} != "no"
|
2005-08-03 20:27:06 +00:00
|
|
|
cd ${.CURDIR}/secure/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
|
2008-11-12 04:43:55 +00:00
|
|
|
.endif
|
|
|
|
.if ${MK_KERBEROS} != "no"
|
|
|
|
cd ${.CURDIR}/kerberos5/lib; ${LIB32IMAKE} ${.TARGET:S/32$//}
|
2004-11-06 03:14:26 +00:00
|
|
|
.endif
|
2008-08-02 12:14:22 +00:00
|
|
|
cd ${.CURDIR}/libexec/rtld-elf; \
|
|
|
|
PROG=ld-elf32.so.1 ${LIB32IMAKE} ${.TARGET:S/32$//}
|
2008-08-01 21:52:41 +00:00
|
|
|
cd ${.CURDIR}/usr.bin/ldd; PROG=ldd32 ${LIB32IMAKE} ${.TARGET:S/32$//}
|
2004-11-06 03:14:26 +00:00
|
|
|
.endif
|
1998-08-31 01:08:08 +00:00
|
|
|
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
WMAKE_TGTS=
|
2002-05-18 18:17:13 +00:00
|
|
|
.if !defined(SUBDIR_OVERRIDE)
|
2003-04-06 21:46:44 +00:00
|
|
|
WMAKE_TGTS+= _worldtmp _legacy _bootstrap-tools
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
.endif
|
|
|
|
WMAKE_TGTS+= _cleanobj _obj _build-tools
|
2002-05-18 18:17:13 +00:00
|
|
|
.if !defined(SUBDIR_OVERRIDE)
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
WMAKE_TGTS+= _cross-tools
|
|
|
|
.endif
|
|
|
|
WMAKE_TGTS+= _includes _libraries _depend everything
|
2010-07-13 21:19:59 +00:00
|
|
|
.if defined(LIB32TMP) && ${MK_LIB32} != "no"
|
2004-11-06 03:14:26 +00:00
|
|
|
WMAKE_TGTS+= build32
|
|
|
|
.endif
|
Milestone #1 in cross-arch make releases.
Do not install games and profiled libraries to the ${CHROOTDIR}
with the initial installworld.
Eliminate the need in the second installworld. For that, make sure
_everything_ is built in the "world" environment, using the right
tool chain.
Added SUBDIR_OVERRIDE helper stuff to Makefile.inc1. Split the
buildworld process into stages, and skip some stages when
SUBDIR_OVERRIDE is set (used to build crypto, krb4, and krb5
dists).
Added NO_MAKEDB_RUN knob to Makefile.inc1 to avoid running
makewhatis(1) at the end of installworld (used when making crypto,
krb4, and krb5 dists).
In release/scripts/doFS.sh, ensure that the correct boot blocks are
used.
Moved the creation of the "crypto" dist from release.5 to
release.2.
In release.3 and doMFSKERN, build kernels in the "world"
environment. KERNELS now means "additional" kernels, GENERIC is
always built.
Ensure we build crunched binaries in the "world" environment.
Obfuscate release/Makefile some more (WMAKEENV) to achieve this.
Inline createBOOTMFS target.
Use already built GENERIC kernel modules to augment mfsfd's
/stand/modules. GC doMODULES as such.
Assorted fixes:
Get rid of the "afterdistribute" target by moving the single use
of it from sys/Makefile to etc/Makefile's "distribute".
Makefile.inc1: apparently "etc" no longer needs to be last for
"distribute" to succeed.
gnu/usr.bin/perl/library/Makefile.inc: do not override the
"install" and "distribute" targets, do it the "canonical" way.
release/scripts/{man,cat}pages-make.sh: make sure Perl manpages and
catpages appear in the right dists. Note that because Perl does
not respect the MANBUILDCAT (and NOMAN), this results in a loss of
/usr/share/perl/man/cat* empty directories. This will be fixed
soon.
Turn MAKE_KERBEROS4 into a plain boolean variable (if it is set it
means "make KerberosIV"), as documented in the make.conf(5)
manpage. Most of the userland makefiles did not test it for "YES"
anyway.
XXX Should specialized kerberized libpam versions be included into
the krb4 and krb5 dists? (libpam.a would be incorrect anyway if
both krb4 and krb5 dists were choosen.)
Make sure "games" dist is made before "catpages", otherwise games
catpages settle in the wrong dist.
Fast build machine provided by: Igor Kucherenko <kivvy@sunbay.com>
2002-04-26 17:55:27 +00:00
|
|
|
|
2006-09-07 19:36:16 +00:00
|
|
|
buildworld: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue
|
|
|
|
.ORDER: buildworld_prologue ${WMAKE_TGTS} buildworld_epilogue
|
1998-08-31 01:08:08 +00:00
|
|
|
|
2006-09-07 19:36:16 +00:00
|
|
|
buildworld_prologue:
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> World build started on `LC_ALL=C date`"
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
|
|
|
|
buildworld_epilogue:
|
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> World build completed on `LC_ALL=C date`"
|
|
|
|
@echo "--------------------------------------------------------------"
|
2006-06-06 16:24:54 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# We need to have this as a target because the indirection between Makefile
|
|
|
|
# and Makefile.inc1 causes the correct PATH to be used, rather than a
|
2006-06-06 18:07:58 +00:00
|
|
|
# modification of the current environment's PATH. In addition, we need
|
|
|
|
# to quote multiword values.
|
2007-05-26 20:17:19 +00:00
|
|
|
#
|
2006-06-06 16:24:54 +00:00
|
|
|
buildenvvars:
|
2006-06-06 18:07:58 +00:00
|
|
|
@echo ${WMAKEENV:Q}
|
2006-06-06 16:24:54 +00:00
|
|
|
|
2005-02-26 22:02:18 +00:00
|
|
|
buildenv:
|
|
|
|
@echo Entering world for ${TARGET_ARCH}:${TARGET}
|
2012-01-30 20:19:28 +00:00
|
|
|
@cd ${.CURDIR} && env ${WMAKEENV} ${BUILDENV_SHELL} || true
|
2005-02-26 22:02:18 +00:00
|
|
|
|
2005-07-07 00:58:41 +00:00
|
|
|
TOOLCHAIN_TGTS= ${WMAKE_TGTS:N_depend:Neverything:Nbuild32}
|
2004-04-13 13:42:01 +00:00
|
|
|
toolchain: ${TOOLCHAIN_TGTS}
|
|
|
|
kernel-toolchain: ${TOOLCHAIN_TGTS:N_includes:N_libraries}
|
2004-03-24 08:26:22 +00:00
|
|
|
|
2004-03-03 19:36:20 +00:00
|
|
|
#
|
2005-11-22 12:02:41 +00:00
|
|
|
# installcheck
|
|
|
|
#
|
|
|
|
# Checks to be sure system is ready for installworld/installkernel.
|
2004-03-03 19:36:20 +00:00
|
|
|
#
|
2013-09-18 00:33:24 +00:00
|
|
|
installcheck: _installcheck_world _installcheck_kernel
|
|
|
|
_installcheck_world:
|
|
|
|
_installcheck_kernel:
|
2004-03-03 19:36:20 +00:00
|
|
|
|
2005-11-07 15:03:04 +00:00
|
|
|
#
|
2013-01-15 00:12:34 +00:00
|
|
|
# Require DESTDIR to be set if installing for a different architecture or
|
|
|
|
# using the user/group database in the source tree.
|
2005-11-07 15:03:04 +00:00
|
|
|
#
|
2013-01-15 00:12:34 +00:00
|
|
|
.if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${TARGET} != ${MACHINE} || \
|
|
|
|
defined(DB_FROM_SRC)
|
2005-11-12 19:28:46 +00:00
|
|
|
.if !make(distributeworld)
|
2013-09-18 00:33:24 +00:00
|
|
|
_installcheck_world: __installcheck_DESTDIR
|
|
|
|
_installcheck_kernel: __installcheck_DESTDIR
|
|
|
|
__installcheck_DESTDIR:
|
2005-11-07 15:03:04 +00:00
|
|
|
.if !defined(DESTDIR) || empty(DESTDIR)
|
|
|
|
@echo "ERROR: Please set DESTDIR!"; \
|
|
|
|
false
|
|
|
|
.endif
|
|
|
|
.endif
|
2005-11-12 19:28:46 +00:00
|
|
|
.endif
|
2005-11-07 15:03:04 +00:00
|
|
|
|
2013-01-15 00:12:34 +00:00
|
|
|
.if !defined(DB_FROM_SRC)
|
2013-01-11 23:44:35 +00:00
|
|
|
#
|
|
|
|
# Check for missing UIDs/GIDs.
|
|
|
|
#
|
|
|
|
CHECK_UIDS= auditdistd
|
|
|
|
CHECK_GIDS= audit
|
|
|
|
.if ${MK_SENDMAIL} != "no"
|
|
|
|
CHECK_UIDS+= smmsp
|
|
|
|
CHECK_GIDS+= smmsp
|
|
|
|
.endif
|
|
|
|
.if ${MK_PF} != "no"
|
|
|
|
CHECK_UIDS+= proxy
|
|
|
|
CHECK_GIDS+= proxy authpf
|
|
|
|
.endif
|
2013-09-17 12:59:37 +00:00
|
|
|
.if ${MK_UNBOUND} != "no"
|
|
|
|
CHECK_UIDS+= unbound
|
|
|
|
CHECK_GIDS+= unbound
|
|
|
|
.endif
|
2013-09-18 00:33:24 +00:00
|
|
|
_installcheck_world: __installcheck_UGID
|
|
|
|
__installcheck_UGID:
|
2013-01-11 23:44:35 +00:00
|
|
|
.for uid in ${CHECK_UIDS}
|
|
|
|
@if ! `id -u ${uid} >/dev/null 2>&1`; then \
|
|
|
|
echo "ERROR: Required ${uid} user is missing, see /usr/src/UPDATING."; \
|
|
|
|
false; \
|
|
|
|
fi
|
|
|
|
.endfor
|
|
|
|
.for gid in ${CHECK_GIDS}
|
|
|
|
@if ! `find / -prune -group ${gid} >/dev/null 2>&1`; then \
|
|
|
|
echo "ERROR: Required ${gid} group is missing, see /usr/src/UPDATING."; \
|
|
|
|
false; \
|
|
|
|
fi
|
|
|
|
.endfor
|
2013-01-15 00:12:34 +00:00
|
|
|
.endif
|
2013-01-11 23:44:35 +00:00
|
|
|
|
Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:
1) ABI breakages should no longer affect installworld over the live system.
2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.
3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.
The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.
Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)
2007-10-31 09:26:42 +00:00
|
|
|
#
|
|
|
|
# Required install tools to be saved in a scratch dir for safety.
|
|
|
|
#
|
2009-03-13 10:09:08 +00:00
|
|
|
.if ${MK_INFO} != "no"
|
|
|
|
_install-info= install-info
|
|
|
|
.endif
|
2009-10-28 07:05:32 +00:00
|
|
|
.if ${MK_ZONEINFO} != "no"
|
2013-01-11 18:37:51 +00:00
|
|
|
_zoneinfo= zic tzsetup
|
2009-10-28 07:05:32 +00:00
|
|
|
.endif
|
2009-03-13 10:09:08 +00:00
|
|
|
|
2013-02-09 23:17:28 +00:00
|
|
|
.if exists(/usr/sbin/nmtree)
|
|
|
|
_nmtree_itools= nmtree
|
|
|
|
.endif
|
|
|
|
|
Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:
1) ABI breakages should no longer affect installworld over the live system.
2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.
3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.
The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.
Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)
2007-10-31 09:26:42 +00:00
|
|
|
ITOOLS= [ awk cap_mkdb cat chflags chmod chown \
|
2013-01-22 21:10:03 +00:00
|
|
|
date echo egrep find grep id install ${_install-info} \
|
2013-01-29 21:48:10 +00:00
|
|
|
ln lockf make mkdir mtree ${_nmtree_itools} mv pwd_mkdb \
|
2014-06-24 15:57:48 +00:00
|
|
|
rm sed sh sysctl test true uname wc ${_zoneinfo} \
|
|
|
|
${LOCAL_ITOOLS}
|
Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:
1) ABI breakages should no longer affect installworld over the live system.
2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.
3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.
The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.
Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)
2007-10-31 09:26:42 +00:00
|
|
|
|
2002-05-14 08:30:40 +00:00
|
|
|
#
|
|
|
|
# distributeworld
|
|
|
|
#
|
|
|
|
# Distributes everything compiled by a `buildworld'.
|
1998-08-31 01:08:08 +00:00
|
|
|
#
|
|
|
|
# installworld
|
|
|
|
#
|
|
|
|
# Installs everything compiled by a 'buildworld'.
|
|
|
|
#
|
2011-03-02 14:39:26 +00:00
|
|
|
|
|
|
|
# Non-base distributions produced by the base system
|
2012-09-03 18:17:21 +00:00
|
|
|
EXTRA_DISTRIBUTIONS= doc
|
|
|
|
.if ${MK_GAMES} != "no"
|
|
|
|
EXTRA_DISTRIBUTIONS+= games
|
|
|
|
.endif
|
2011-03-02 14:39:26 +00:00
|
|
|
.if defined(LIB32TMP) && ${MK_LIB32} != "no"
|
|
|
|
EXTRA_DISTRIBUTIONS+= lib32
|
|
|
|
.endif
|
2014-08-19 23:33:51 +00:00
|
|
|
.if ${MK_TESTS} != "no"
|
|
|
|
EXTRA_DISTRIBUTIONS+= tests
|
|
|
|
.endif
|
2011-03-02 14:39:26 +00:00
|
|
|
|
2013-01-22 21:10:03 +00:00
|
|
|
MTREE_MAGIC?= mtree 2.0
|
|
|
|
|
2013-09-18 00:33:24 +00:00
|
|
|
distributeworld installworld: _installcheck_world
|
2000-07-19 04:41:59 +00:00
|
|
|
mkdir -p ${INSTALLTMP}
|
2007-12-04 12:55:27 +00:00
|
|
|
progs=$$(for prog in ${ITOOLS}; do \
|
2007-10-15 13:50:46 +00:00
|
|
|
if progpath=`which $$prog`; then \
|
2007-12-04 12:55:27 +00:00
|
|
|
echo $$progpath; \
|
2007-10-15 13:50:46 +00:00
|
|
|
else \
|
Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:
1) ABI breakages should no longer affect installworld over the live system.
2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.
3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.
The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.
Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)
2007-10-31 09:26:42 +00:00
|
|
|
echo "Required tool $$prog not found in PATH." >&2; \
|
2007-10-15 13:50:46 +00:00
|
|
|
exit 1; \
|
|
|
|
fi; \
|
2007-12-04 12:55:27 +00:00
|
|
|
done); \
|
|
|
|
libs=$$(ldd -f "%o %p\n" -f "%o %p\n" $$progs 2>/dev/null | sort -u | \
|
|
|
|
while read line; do \
|
|
|
|
set -- $$line; \
|
|
|
|
if [ "$$2 $$3" != "not found" ]; then \
|
|
|
|
echo $$2; \
|
|
|
|
else \
|
|
|
|
echo "Required library $$1 not found." >&2; \
|
|
|
|
exit 1; \
|
|
|
|
fi; \
|
|
|
|
done); \
|
|
|
|
cp $$libs $$progs ${INSTALLTMP}
|
Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:
1) ABI breakages should no longer affect installworld over the live system.
2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.
3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.
The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.
Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)
2007-10-31 09:26:42 +00:00
|
|
|
cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale
|
2013-01-22 21:10:03 +00:00
|
|
|
.if defined(NO_ROOT)
|
|
|
|
echo "#${MTREE_MAGIC}" > ${METALOG}
|
|
|
|
.endif
|
2011-03-02 14:39:26 +00:00
|
|
|
.if make(distributeworld)
|
|
|
|
.for dist in ${EXTRA_DISTRIBUTIONS}
|
|
|
|
-mkdir ${DESTDIR}/${DISTDIR}/${dist}
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.root.dist \
|
|
|
|
-p ${DESTDIR}/${DISTDIR}/${dist} >/dev/null
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
|
|
|
-p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
|
|
|
|
-p ${DESTDIR}/${DISTDIR}/${dist}/usr/include >/dev/null
|
2013-06-07 21:40:02 +00:00
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
|
|
|
|
-p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib >/dev/null
|
|
|
|
.endif
|
2014-08-19 23:33:51 +00:00
|
|
|
.if ${MK_TESTS} != "no" && ${dist} == "tests"
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
|
|
|
|
-p ${DESTDIR}/${DISTDIR}/${dist}/usr >/dev/null
|
|
|
|
.endif
|
2013-01-22 21:10:03 +00:00
|
|
|
.if defined(NO_ROOT)
|
|
|
|
${IMAKEENV} nmtree -C -f ${.CURDIR}/etc/mtree/BSD.root.dist | \
|
|
|
|
sed -e 's#^\./#./${dist}/#' >> ${METALOG}
|
|
|
|
${IMAKEENV} nmtree -C -f ${.CURDIR}/etc/mtree/BSD.usr.dist | \
|
|
|
|
sed -e 's#^\./#./${dist}/usr/#' >> ${METALOG}
|
|
|
|
${IMAKEENV} nmtree -C -f ${.CURDIR}/etc/mtree/BSD.include.dist | \
|
|
|
|
sed -e 's#^\./#./${dist}/usr/include/#' >> ${METALOG}
|
|
|
|
.endif
|
2011-03-02 14:39:26 +00:00
|
|
|
.endfor
|
|
|
|
-mkdir ${DESTDIR}/${DISTDIR}/base
|
2013-01-22 21:10:03 +00:00
|
|
|
cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \
|
|
|
|
METALOG=${METALOG} ${IMAKE_INSTALL} ${IMAKE_MTREE} \
|
|
|
|
DISTBASE=/base DESTDIR=${DESTDIR}/${DISTDIR}/base \
|
2013-08-30 01:32:47 +00:00
|
|
|
LOCAL_MTREE=${LOCAL_MTREE:Q} distrib-dirs
|
2011-03-02 14:39:26 +00:00
|
|
|
.endif
|
Decouple the install tools from the main system as much as possible.
I.e., not only copy them to a scratch dir, but also make them use saved
copies of libraries and locale files. That gives us several benefits:
1) ABI breakages should no longer affect installworld over the live system.
2) It becomes safe to run installworld while still running the old kernel.
However, it can be reasonable to save the old /rescue before that to be
able to run the old reboot(8), as the new binaries are rather likely to
fail with the old kernel. Anyhow, it's now possible to upgrade a system
in a single reboot _reliably_.
3) With a bit of hackery around rtld(8), it becomes possible to do destructive
cross-installs, e.g., i386->amd64 over the live system.
The only shared item left between the old and new systems is rtld(8),
which cannot be run from a saved copy easily because its full
pathname is stored in the respective field of each ELF executable.
(In theory, that field could be overridden, e.g., from the environment,
but this can lead to security issues.) That's why a destructive
cross-install isn't possible w/o hackery yet.
Fruitful ideas by: ru
Reviewed by: ru
Tested with: audit(4)
2007-10-31 09:26:42 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${IMAKE} re${.TARGET:S/world$//}; \
|
|
|
|
${IMAKEENV} rm -rf ${INSTALLTMP}
|
2011-03-02 14:39:26 +00:00
|
|
|
.if make(distributeworld)
|
|
|
|
.for dist in ${EXTRA_DISTRIBUTIONS}
|
2013-06-05 22:27:49 +00:00
|
|
|
find ${DESTDIR}/${DISTDIR}/${dist} -mindepth 1 -empty -delete
|
2011-03-02 14:39:26 +00:00
|
|
|
.endfor
|
2013-01-22 21:10:03 +00:00
|
|
|
.if defined(NO_ROOT)
|
|
|
|
.for dist in base ${EXTRA_DISTRIBUTIONS}
|
|
|
|
@# For each file that exists in this dist, print the corresponding
|
|
|
|
@# line from the METALOG. This relies on the fact that
|
|
|
|
@# a line containing only the filename will sort immediatly before
|
|
|
|
@# the relevant mtree line.
|
|
|
|
cd ${DESTDIR}/${DISTDIR}; \
|
|
|
|
find ./${dist} | sort -u ${METALOG} - | \
|
|
|
|
awk 'BEGIN { print "#${MTREE_MAGIC}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}\//, "./"); print } }' > \
|
|
|
|
${DESTDIR}/${DISTDIR}/${dist}.meta
|
|
|
|
.endfor
|
2013-07-23 19:34:09 +00:00
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
|
|
|
. for dist in base ${EXTRA_DISTRIBUTIONS}
|
|
|
|
@# For each file that exists in this dist, print the corresponding
|
|
|
|
@# line from the METALOG. This relies on the fact that
|
|
|
|
@# a line containing only the filename will sort immediatly before
|
|
|
|
@# the relevant mtree line.
|
|
|
|
cd ${DESTDIR}/${DISTDIR}; \
|
|
|
|
find ./${dist}/usr/lib/debug | sort -u ${METALOG} - | \
|
|
|
|
awk 'BEGIN { print "#${MTREE_MAGIC}" } !/ type=/ { file = $$1 } / type=/ { if ($$1 == file) { sub(/^\.\/${dist}\//, "./"); print } }' > \
|
|
|
|
${DESTDIR}/${DISTDIR}/${dist}.debug.meta
|
|
|
|
. endfor
|
|
|
|
.endif
|
2013-01-22 21:10:03 +00:00
|
|
|
.endif
|
2011-03-02 14:39:26 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
packageworld:
|
|
|
|
.for dist in base ${EXTRA_DISTRIBUTIONS}
|
2013-01-22 21:10:03 +00:00
|
|
|
.if defined(NO_ROOT)
|
|
|
|
${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
|
|
|
|
tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz \
|
2013-07-23 19:34:09 +00:00
|
|
|
--exclude usr/lib/debug \
|
2013-01-22 21:10:03 +00:00
|
|
|
@${DESTDIR}/${DISTDIR}/${dist}.meta
|
|
|
|
.else
|
2011-03-02 14:39:26 +00:00
|
|
|
${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
|
2013-07-23 19:34:09 +00:00
|
|
|
tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.txz \
|
|
|
|
--exclude usr/lib/debug .
|
2013-01-22 21:10:03 +00:00
|
|
|
.endif
|
2011-03-02 14:39:26 +00:00
|
|
|
.endfor
|
1998-08-31 01:08:08 +00:00
|
|
|
|
2013-07-23 19:34:09 +00:00
|
|
|
.if ${MK_DEBUG_FILES} != "no"
|
|
|
|
. for dist in base ${EXTRA_DISTRIBUTIONS}
|
|
|
|
. if defined(NO_ROOT)
|
|
|
|
${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
|
|
|
|
tar cvJf ${DESTDIR}/${DISTDIR}/${dist}.debug.txz \
|
|
|
|
@${DESTDIR}/${DISTDIR}/${dist}.debug.meta
|
|
|
|
. else
|
|
|
|
${_+_}cd ${DESTDIR}/${DISTDIR}/${dist}; \
|
|
|
|
tar cvJfL ${DESTDIR}/${DISTDIR}/${dist}.debug.txz \
|
|
|
|
usr/lib/debug
|
|
|
|
. endif
|
|
|
|
. endfor
|
|
|
|
.endif
|
|
|
|
|
1998-08-31 01:08:08 +00:00
|
|
|
#
|
|
|
|
# reinstall
|
|
|
|
#
|
|
|
|
# If you have a build server, you can NFS mount the source and obj directories
|
|
|
|
# and do a 'make reinstall' on the *client* to install new binaries from the
|
|
|
|
# most recent server build.
|
|
|
|
#
|
2014-10-23 01:06:00 +00:00
|
|
|
reinstall: .MAKE
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
1998-09-17 16:32:00 +00:00
|
|
|
@echo ">>> Making hierarchy"
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2012-10-18 12:32:51 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 \
|
2013-08-30 01:32:47 +00:00
|
|
|
LOCAL_MTREE=${LOCAL_MTREE:Q} hierarchy
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2004-03-19 17:57:07 +00:00
|
|
|
@echo ">>> Installing everything"
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-08-09 11:38:41 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install
|
2010-07-13 21:19:59 +00:00
|
|
|
.if defined(LIB32TMP) && ${MK_LIB32} != "no"
|
2004-11-06 03:14:26 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 install32
|
|
|
|
.endif
|
1998-08-31 01:08:08 +00:00
|
|
|
|
2014-10-23 01:06:00 +00:00
|
|
|
redistribute: .MAKE
|
2002-04-30 11:50:01 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-03-19 17:57:07 +00:00
|
|
|
@echo ">>> Distributing everything"
|
2002-04-30 11:50:01 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2004-08-09 11:38:41 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute
|
2010-07-13 21:19:59 +00:00
|
|
|
.if defined(LIB32TMP) && ${MK_LIB32} != "no"
|
2008-08-02 12:14:22 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${MAKE} -f Makefile.inc1 distribute32 \
|
|
|
|
DISTRIBUTION=lib32
|
2005-06-16 18:16:14 +00:00
|
|
|
.endif
|
2000-11-21 04:37:30 +00:00
|
|
|
|
2014-10-23 01:06:00 +00:00
|
|
|
distrib-dirs distribution: .MAKE
|
2013-01-15 00:12:34 +00:00
|
|
|
cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \
|
2013-01-22 21:10:03 +00:00
|
|
|
${IMAKE_INSTALL} ${IMAKE_MTREE} METALOG=${METALOG} ${.TARGET}
|
2005-02-27 12:11:35 +00:00
|
|
|
|
2000-01-09 17:56:40 +00:00
|
|
|
#
|
|
|
|
# buildkernel and installkernel
|
|
|
|
#
|
|
|
|
# Which kernels to build and/or install is specified by setting
|
2001-01-22 07:29:48 +00:00
|
|
|
# KERNCONF. If not defined a GENERIC kernel is built/installed.
|
2001-10-25 07:28:55 +00:00
|
|
|
# Only the existing (depending TARGET) config files are used
|
2000-01-09 17:56:40 +00:00
|
|
|
# for building kernels and only the first of these is designated
|
|
|
|
# as the one being installed.
|
|
|
|
#
|
2001-10-25 07:28:55 +00:00
|
|
|
# Note that we have to use TARGET instead of TARGET_ARCH when
|
Fix cross-building, etc:
1. To cross-build, one now needs to set TARGET_ARCH, and not the
MACHINE_ARCH. MACHINE_ARCH should never be changed manually!
2. Initialize DESTDIR= explicitly for bootstrap-tools, build-tools,
and cross-tools stages. This fixes broken header and library
dependencies problem. We build them in the host environment,
and obviously want them to depend on host headers and libraries.
The problem with broken header dependencies for bootstrap-tools
and cross-tools was already partially solved (see BOOTSTRAPPING
tests in bsd.prog.mk and bsd.lib.mk), but it was still there for
build-tools if the user ran "make world DESTDIR=/foo". Also,
for all of these stages, the library dependencies were broken
because of how bsd.libnames.mk define DPADD members.
We still provide a glue to install bootstrap- and cross-tools
under the ${WORLDTMP}.
Removed PATH overrides for bootstrap-, build-, and cross-tools
stages. There is just no reason why we would need to override
it, and the hacks to clean up the ${WORLDTMP} in the -DNOCLEAN
case are no longer needed with fixes from this step.
That is, we now never use ${WORLDTMP} headers and libraries,
and we don't use any ${WORLDTMP} installed binaries during
these stages. Again, these stages depend solely on the host
environment, including compiler, headers, and libraries.
3. Moved "miniperl" back from cross-tools (it has nothing to do
with a cross-compiler) to build-tools where it belongs. The
change from step 1 let to do this. Also, to make this work,
build-tools targets of "cc_tools" and "miniperl" were modified
to call "depend". Here follow the detailed explanations.
There are two categories of build tools, for now. In the first
category there are "cc_tools" and "miniperl". They occupy the
whole (sub)directory, and nothing needs to be done in this
subdirectory later during the "all" stage. They are also
constructed using system makefiles. We must build the .depend
early in the build-tools stage because:
1) They use (and depend on) the host environment.
2) If we don't do this in build-tools, the "depend" stage of
buildworld will do this for us; wrong library and header
dependencies will be recorded (DESTDIR=${WORLDTMP}) and,
what's worse, the "all" stage may then clobber the
build-architecture format tools (that we built in the
build-tools stage) with the target-architecture format
ones, breaking cross build.
In the second category there are all other build-tools. They
share their directory with the "main" module that needs them
in the "all" stage, and they don't show up themselves in the
.depend file. The portion of this fix was already committed
in gnu/usr.bin/cc/cc_tools/Makefile,v 1.52.
4. "libperl" is no longer a build tool, and "miniperl" is the
stand-alone application. I had to make this change because
build-tools and "all" stages share the same object directory.
Without this change, if we cross compile, libperl.a is first
built for the build architecture during the build-tools stage
(for the purposes of immediate linkage with "miniperl").
Later on, the "all" stage sees this library as up-to-date,
and doesn't rebuild it. The effect is that the wrong format
static libperl library is installed with installworld.
5. Fixed "includes" to install secure/lib/libtelnet headers if
required.
Reviewed by: bde
2001-09-29 13:17:54 +00:00
|
|
|
# we're in kernel-land. Since only TARGET_ARCH is (expected) to
|
2001-10-25 07:28:55 +00:00
|
|
|
# be set to cross-build, we have to make sure TARGET is set
|
2000-01-09 17:56:40 +00:00
|
|
|
# properly.
|
|
|
|
|
2009-01-15 04:19:03 +00:00
|
|
|
.if defined(KERNFAST)
|
|
|
|
NO_KERNELCLEAN= t
|
|
|
|
NO_KERNELCONFIG= t
|
|
|
|
NO_KERNELDEPEND= t
|
2009-12-16 02:54:34 +00:00
|
|
|
NO_KERNELOBJ= t
|
2009-01-23 18:23:16 +00:00
|
|
|
# Shortcut for KERNCONF=Blah -DKERNFAST is now KERNFAST=Blah
|
|
|
|
.if !defined(KERNCONF) && ${KERNFAST} != "1"
|
|
|
|
KERNCONF=${KERNFAST}
|
|
|
|
.endif
|
2009-01-15 04:19:03 +00:00
|
|
|
.endif
|
2010-07-13 21:19:59 +00:00
|
|
|
.if ${TARGET_ARCH} == "powerpc64"
|
|
|
|
KERNCONF?= GENERIC64
|
|
|
|
.else
|
2001-01-22 07:29:48 +00:00
|
|
|
KERNCONF?= GENERIC
|
2001-01-23 09:52:50 +00:00
|
|
|
.endif
|
2000-09-03 02:58:39 +00:00
|
|
|
INSTKERNNAME?= kernel
|
2000-01-09 17:56:40 +00:00
|
|
|
|
2003-04-16 21:05:06 +00:00
|
|
|
KERNSRCDIR?= ${.CURDIR}/sys
|
|
|
|
KRNLCONFDIR= ${KERNSRCDIR}/${TARGET}/conf
|
|
|
|
KRNLOBJDIR= ${OBJTREE}${KERNSRCDIR}
|
2001-08-27 12:01:46 +00:00
|
|
|
KERNCONFDIR?= ${KRNLCONFDIR}
|
2000-01-09 17:56:40 +00:00
|
|
|
|
|
|
|
BUILDKERNELS=
|
|
|
|
INSTALLKERNEL=
|
2001-01-22 07:29:48 +00:00
|
|
|
.for _kernel in ${KERNCONF}
|
2001-08-27 12:01:46 +00:00
|
|
|
.if exists(${KERNCONFDIR}/${_kernel})
|
2000-01-09 17:56:40 +00:00
|
|
|
BUILDKERNELS+= ${_kernel}
|
|
|
|
.if empty(INSTALLKERNEL)
|
|
|
|
INSTALLKERNEL= ${_kernel}
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
2014-04-12 15:06:15 +00:00
|
|
|
buildkernel ${WMAKE_TGTS} ${.ALLTARGETS:M_*}: .MAKE
|
|
|
|
|
2000-01-09 17:56:40 +00:00
|
|
|
#
|
|
|
|
# buildkernel
|
|
|
|
#
|
|
|
|
# Builds all kernels defined by BUILDKERNELS.
|
|
|
|
#
|
|
|
|
buildkernel:
|
2000-10-25 04:31:32 +00:00
|
|
|
.if empty(BUILDKERNELS)
|
2005-02-27 11:48:45 +00:00
|
|
|
@echo "ERROR: Missing kernel configuration file(s) (${KERNCONF})."; \
|
2004-03-04 09:14:30 +00:00
|
|
|
false
|
2000-10-25 04:31:32 +00:00
|
|
|
.endif
|
2000-01-09 17:56:40 +00:00
|
|
|
@echo
|
2001-01-21 23:44:41 +00:00
|
|
|
.for _kernel in ${BUILDKERNELS}
|
2000-01-09 17:56:40 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2001-03-02 16:52:14 +00:00
|
|
|
@echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
|
2000-01-09 17:56:40 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo "===> ${_kernel}"
|
2000-04-27 09:20:18 +00:00
|
|
|
mkdir -p ${KRNLOBJDIR}
|
2000-06-15 10:00:20 +00:00
|
|
|
.if !defined(NO_KERNELCONFIG)
|
2004-03-18 10:17:03 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> stage 1: configuring the kernel"
|
|
|
|
@echo "--------------------------------------------------------------"
|
2000-01-09 17:56:40 +00:00
|
|
|
cd ${KRNLCONFDIR}; \
|
|
|
|
PATH=${TMPPATH} \
|
2001-08-27 12:01:46 +00:00
|
|
|
config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
|
2014-05-11 20:44:58 +00:00
|
|
|
-I '${KERNCONFDIR}' '${KERNCONFDIR}/${_kernel}'
|
2001-01-22 23:10:01 +00:00
|
|
|
.endif
|
2004-12-21 12:21:26 +00:00
|
|
|
.if !defined(NO_CLEAN) && !defined(NO_KERNELCLEAN)
|
2004-03-18 10:17:03 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> stage 2.1: cleaning up the object tree"
|
|
|
|
@echo "--------------------------------------------------------------"
|
2005-11-22 11:31:03 +00:00
|
|
|
cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} ${CLEANDIR}
|
2000-06-15 10:00:20 +00:00
|
|
|
.endif
|
2009-12-16 02:54:34 +00:00
|
|
|
.if !defined(NO_KERNELOBJ)
|
2004-03-18 10:17:03 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> stage 2.2: rebuilding the object tree"
|
|
|
|
@echo "--------------------------------------------------------------"
|
2005-11-22 11:31:03 +00:00
|
|
|
cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} obj
|
2009-12-16 02:54:34 +00:00
|
|
|
.endif
|
2004-03-18 10:17:03 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> stage 2.3: build tools"
|
|
|
|
@echo "--------------------------------------------------------------"
|
2014-08-21 14:56:57 +00:00
|
|
|
${_+_}cd ${.CURDIR}; ${KTMAKE} kernel-tools
|
2000-06-15 10:00:20 +00:00
|
|
|
.if !defined(NO_KERNELDEPEND)
|
2004-03-18 10:17:03 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> stage 3.1: making dependencies"
|
|
|
|
@echo "--------------------------------------------------------------"
|
2005-11-22 11:31:03 +00:00
|
|
|
cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} depend -DNO_MODULES_OBJ
|
2000-06-15 10:00:20 +00:00
|
|
|
.endif
|
2004-03-18 10:17:03 +00:00
|
|
|
@echo
|
|
|
|
@echo "--------------------------------------------------------------"
|
2013-05-28 21:29:05 +00:00
|
|
|
@echo ">>> stage 3.2: building everything"
|
2004-03-18 10:17:03 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2013-05-28 21:29:05 +00:00
|
|
|
cd ${KRNLOBJDIR}/${_kernel}; ${KMAKE} all -DNO_MODULES_OBJ
|
2001-01-21 23:44:41 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2001-03-02 16:52:14 +00:00
|
|
|
@echo ">>> Kernel build for ${_kernel} completed on `LC_ALL=C date`"
|
2001-01-21 23:44:41 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2000-01-09 17:56:40 +00:00
|
|
|
.endfor
|
|
|
|
|
|
|
|
#
|
2004-03-04 09:14:30 +00:00
|
|
|
# installkernel, etc.
|
2000-01-09 17:56:40 +00:00
|
|
|
#
|
|
|
|
# Install the kernel defined by INSTALLKERNEL
|
|
|
|
#
|
2004-03-03 19:36:20 +00:00
|
|
|
installkernel installkernel.debug \
|
2013-09-18 00:33:24 +00:00
|
|
|
reinstallkernel reinstallkernel.debug: _installcheck_kernel
|
2003-02-07 07:29:57 +00:00
|
|
|
.if empty(INSTALLKERNEL)
|
2005-02-27 11:48:45 +00:00
|
|
|
@echo "ERROR: No kernel \"${KERNCONF}\" to install."; \
|
2004-03-04 09:14:30 +00:00
|
|
|
false
|
2003-02-07 07:29:57 +00:00
|
|
|
.endif
|
2004-03-13 15:46:34 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2011-05-05 00:43:55 +00:00
|
|
|
@echo ">>> Installing kernel ${INSTALLKERNEL}"
|
2004-03-13 15:46:34 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2000-09-17 21:02:58 +00:00
|
|
|
cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
|
2002-12-02 14:03:40 +00:00
|
|
|
${CROSSENV} PATH=${TMPPATH} \
|
2013-01-29 21:48:10 +00:00
|
|
|
${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//}
|
2000-09-03 02:58:39 +00:00
|
|
|
|
2011-03-02 14:39:26 +00:00
|
|
|
distributekernel distributekernel.debug:
|
|
|
|
.if empty(INSTALLKERNEL)
|
|
|
|
@echo "ERROR: No kernel \"${KERNCONF}\" to install."; \
|
|
|
|
false
|
2013-05-16 18:37:14 +00:00
|
|
|
.endif
|
|
|
|
mkdir -p ${DESTDIR}/${DISTDIR}
|
|
|
|
.if defined(NO_ROOT)
|
|
|
|
echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.premeta
|
2011-03-02 14:39:26 +00:00
|
|
|
.endif
|
|
|
|
cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
|
2013-05-16 18:37:14 +00:00
|
|
|
${IMAKEENV} ${IMAKE_INSTALL:S/METALOG/kernel.premeta/} \
|
|
|
|
${IMAKE_MTREE} PATH=${TMPPATH} ${MAKE} KERNEL=${INSTKERNNAME} \
|
2013-05-30 14:09:58 +00:00
|
|
|
DESTDIR=${INSTALL_DDIR}/kernel \
|
2011-03-02 14:39:26 +00:00
|
|
|
${.TARGET:S/distributekernel/install/}
|
2013-05-20 21:16:38 +00:00
|
|
|
.if defined(NO_ROOT)
|
2013-05-16 18:37:14 +00:00
|
|
|
sed -e 's|^./kernel|.|' ${DESTDIR}/${DISTDIR}/kernel.premeta > \
|
|
|
|
${DESTDIR}/${DISTDIR}/kernel.meta
|
2013-05-20 21:16:38 +00:00
|
|
|
.endif
|
2012-01-15 08:36:25 +00:00
|
|
|
.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//}
|
2013-05-16 18:37:14 +00:00
|
|
|
.if defined(NO_ROOT)
|
|
|
|
echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta
|
|
|
|
.endif
|
2012-01-15 08:36:25 +00:00
|
|
|
cd ${KRNLOBJDIR}/${_kernel}; \
|
2013-05-16 18:37:14 +00:00
|
|
|
${IMAKEENV} ${IMAKE_INSTALL:S/METALOG/kernel.${_kernel}.premeta/} \
|
|
|
|
${IMAKE_MTREE} PATH=${TMPPATH} ${MAKE} \
|
2012-01-15 08:36:25 +00:00
|
|
|
KERNEL=${INSTKERNNAME}.${_kernel} \
|
2013-05-30 14:09:58 +00:00
|
|
|
DESTDIR=${INSTALL_DDIR}/kernel.${_kernel} \
|
2012-01-15 08:36:25 +00:00
|
|
|
${.TARGET:S/distributekernel/install/}
|
2013-09-24 19:09:21 +00:00
|
|
|
.if defined(NO_ROOT)
|
2013-05-16 18:37:14 +00:00
|
|
|
sed -e 's|^./kernel|.|' \
|
|
|
|
${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta > \
|
|
|
|
${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta
|
2013-09-24 19:09:21 +00:00
|
|
|
.endif
|
2012-01-15 08:36:25 +00:00
|
|
|
.endfor
|
2011-03-02 14:39:26 +00:00
|
|
|
|
|
|
|
packagekernel:
|
2013-05-16 18:37:14 +00:00
|
|
|
.if defined(NO_ROOT)
|
|
|
|
cd ${DESTDIR}/${DISTDIR}/kernel; \
|
|
|
|
tar cvJf ${DESTDIR}/${DISTDIR}/kernel.txz \
|
|
|
|
@${DESTDIR}/${DISTDIR}/kernel.meta
|
|
|
|
.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//}
|
|
|
|
cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \
|
|
|
|
tar cvJf ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz \
|
|
|
|
@${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta
|
|
|
|
.endfor
|
|
|
|
.else
|
2012-01-15 08:36:25 +00:00
|
|
|
cd ${DESTDIR}/${DISTDIR}/kernel; \
|
2011-03-02 14:39:26 +00:00
|
|
|
tar cvJf ${DESTDIR}/${DISTDIR}/kernel.txz .
|
2012-01-15 08:36:25 +00:00
|
|
|
.for _kernel in ${BUILDKERNELS:S/${INSTALLKERNEL}//}
|
|
|
|
cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \
|
|
|
|
tar cvJf ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz .
|
|
|
|
.endfor
|
2013-05-16 18:37:14 +00:00
|
|
|
.endif
|
2011-03-02 14:39:26 +00:00
|
|
|
|
2006-05-26 18:10:06 +00:00
|
|
|
#
|
|
|
|
# doxygen
|
|
|
|
#
|
|
|
|
# Build the API documentation with doxygen
|
|
|
|
#
|
|
|
|
doxygen:
|
|
|
|
@if [ ! -x `/usr/bin/which doxygen` ]; then \
|
|
|
|
echo "You need doxygen (devel/doxygen) to generate the API documentation of the kernel." | /usr/bin/fmt; \
|
|
|
|
exit 1; \
|
|
|
|
fi
|
2006-08-02 15:26:15 +00:00
|
|
|
cd ${.CURDIR}/tools/kerneldoc/subsys && ${MAKE} obj all
|
2006-05-26 18:10:06 +00:00
|
|
|
|
1998-08-31 01:08:08 +00:00
|
|
|
#
|
|
|
|
# update
|
|
|
|
#
|
2013-05-28 21:57:55 +00:00
|
|
|
# Update the source tree(s), by running svn/svnup to update to the
|
1998-08-31 01:08:08 +00:00
|
|
|
# latest copy.
|
|
|
|
#
|
|
|
|
update:
|
2013-05-28 23:43:47 +00:00
|
|
|
.if (defined(CVS_UPDATE) || defined(SUP_UPDATE)) && !defined(SVN_UPDATE)
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2013-05-28 23:43:47 +00:00
|
|
|
@echo "CVS_UPDATE and SUP_UPDATE are no longer supported."
|
|
|
|
@echo "Please see: https://wiki.freebsd.org/CvsIsDeprecated"
|
1998-08-31 01:08:08 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
2013-05-28 23:43:47 +00:00
|
|
|
@exit 1
|
2009-06-14 15:16:24 +00:00
|
|
|
.endif
|
|
|
|
.if defined(SVN_UPDATE)
|
2013-05-28 23:43:47 +00:00
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@echo ">>> Updating ${.CURDIR} using Subversion"
|
|
|
|
@echo "--------------------------------------------------------------"
|
|
|
|
@(cd ${.CURDIR} && ${SVN} update ${SVNFLAGS})
|
1998-08-31 01:08:08 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# ------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# From here onwards are utility targets used by the 'make world' and
|
|
|
|
# related targets. If your 'world' breaks, you may like to try to fix
|
|
|
|
# the problem and manually run the following targets to attempt to
|
|
|
|
# complete the build. Beware, this is *not* guaranteed to work, you
|
|
|
|
# need to have a pretty good grip on the current state of the system
|
|
|
|
# to attempt to manually finish it. If in doubt, 'make world' again.
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
2003-04-06 21:46:44 +00:00
|
|
|
# legacy: Build compatibility shims for the next three targets
|
1998-08-31 01:08:08 +00:00
|
|
|
#
|
2003-04-06 21:46:44 +00:00
|
|
|
legacy:
|
2012-05-16 04:21:21 +00:00
|
|
|
.if ${BOOTSTRAPPING} < 700055 && ${BOOTSTRAPPING} != 0
|
|
|
|
@echo "ERROR: Source upgrades from versions prior to 7.0 not supported."; \
|
2008-01-23 22:21:36 +00:00
|
|
|
false
|
|
|
|
.endif
|
2003-04-06 03:50:28 +00:00
|
|
|
.for _tool in tools/build
|
2004-09-07 15:19:40 +00:00
|
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,includes,depend,all,install)"; \
|
2013-06-30 15:00:07 +00:00
|
|
|
cd ${.CURDIR}/${_tool} && \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ obj && \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy includes && \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ depend && \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ all && \
|
2003-04-06 21:46:44 +00:00
|
|
|
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install
|
2003-04-06 03:50:28 +00:00
|
|
|
.endfor
|
|
|
|
|
2003-04-06 21:33:49 +00:00
|
|
|
#
|
|
|
|
# bootstrap-tools: Build tools needed for compatibility
|
|
|
|
#
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_GAMES} != "no"
|
2003-04-06 21:33:49 +00:00
|
|
|
_strfile= games/fortune/strfile
|
|
|
|
.endif
|
|
|
|
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_CXX} != "no"
|
2005-02-27 11:22:58 +00:00
|
|
|
_gperf= gnu/usr.bin/gperf
|
2003-04-30 10:58:52 +00:00
|
|
|
.endif
|
2011-02-22 08:13:49 +00:00
|
|
|
|
|
|
|
.if ${MK_GROFF} != "no"
|
|
|
|
_groff= gnu/usr.bin/groff
|
2003-05-31 21:29:38 +00:00
|
|
|
.endif
|
2003-04-30 10:58:52 +00:00
|
|
|
|
2014-09-09 20:36:56 +00:00
|
|
|
.if ${MK_VT} != "no"
|
|
|
|
_vtfontcvt= usr.bin/vtfontcvt
|
|
|
|
.endif
|
|
|
|
|
2012-05-19 02:08:52 +00:00
|
|
|
.if ${BOOTSTRAPPING} < 800022
|
|
|
|
_ar= usr.bin/ar
|
|
|
|
.endif
|
|
|
|
|
2012-05-16 04:21:21 +00:00
|
|
|
.if ${BOOTSTRAPPING} < 800013
|
|
|
|
_mklocale= usr.bin/mklocale
|
|
|
|
.endif
|
|
|
|
|
2009-10-21 19:39:34 +00:00
|
|
|
.if ${BOOTSTRAPPING} < 900002
|
|
|
|
_sed= usr.bin/sed
|
|
|
|
.endif
|
|
|
|
|
2013-05-21 19:32:35 +00:00
|
|
|
.if ${BOOTSTRAPPING} < 1000002
|
2014-08-25 17:31:06 +00:00
|
|
|
_m4= usr.bin/m4
|
2013-05-21 19:32:35 +00:00
|
|
|
.endif
|
|
|
|
|
2012-05-22 15:59:07 +00:00
|
|
|
.if ${BOOTSTRAPPING} < 1000013
|
2013-02-25 22:25:56 +00:00
|
|
|
_yacc= lib/liby \
|
|
|
|
usr.bin/yacc
|
2009-12-31 00:07:26 +00:00
|
|
|
.endif
|
|
|
|
|
2013-05-24 15:53:13 +00:00
|
|
|
.if ${BOOTSTRAPPING} < 1000014
|
|
|
|
_crunch= usr.sbin/crunch
|
|
|
|
.endif
|
|
|
|
|
2013-01-21 23:12:50 +00:00
|
|
|
.if ${BOOTSTRAPPING} < 1000026
|
2013-01-15 00:12:34 +00:00
|
|
|
_nmtree= lib/libnetbsd \
|
|
|
|
usr.sbin/nmtree
|
|
|
|
.endif
|
|
|
|
|
2013-01-29 22:17:58 +00:00
|
|
|
.if ${BOOTSTRAPPING} < 1000027
|
|
|
|
_cat= bin/cat
|
|
|
|
.endif
|
|
|
|
|
2014-08-14 12:16:03 +00:00
|
|
|
.if ${BOOTSTRAPPING} < 1000033
|
|
|
|
_lex= usr.bin/lex
|
|
|
|
.endif
|
|
|
|
|
2011-08-11 10:29:10 +00:00
|
|
|
.if ${BOOTSTRAPPING} >= 900040 && ${BOOTSTRAPPING} < 900041
|
|
|
|
_awk= usr.bin/awk
|
|
|
|
.endif
|
|
|
|
|
2014-08-29 18:26:55 +00:00
|
|
|
.if ${MK_BSNMP} != "no"
|
2006-03-31 14:10:35 +00:00
|
|
|
_gensnmptree= usr.sbin/bsnmpd/gensnmptree
|
|
|
|
.endif
|
|
|
|
|
2011-11-10 20:15:35 +00:00
|
|
|
.if ${MK_CLANG} != "no"
|
|
|
|
_clang_tblgen= \
|
|
|
|
lib/clang/libllvmsupport \
|
|
|
|
lib/clang/libllvmtablegen \
|
|
|
|
usr.bin/clang/tblgen \
|
|
|
|
usr.bin/clang/clang-tblgen
|
|
|
|
.endif
|
|
|
|
|
2012-03-24 05:30:13 +00:00
|
|
|
# dtrace tools are required for older bootstrap env and cross-build
|
2011-05-11 17:50:19 +00:00
|
|
|
.if ${MK_CDDL} != "no" && \
|
2013-06-13 18:26:04 +00:00
|
|
|
((${BOOTSTRAPPING} < 1000034 && \
|
|
|
|
!(${BOOTSTRAPPING} >= 901505 && ${BOOTSTRAPPING} < 999999)) \
|
2012-05-16 04:21:21 +00:00
|
|
|
|| (${MACHINE} != ${TARGET} || ${MACHINE_ARCH} != ${TARGET_ARCH}))
|
2008-05-23 04:22:14 +00:00
|
|
|
_dtrace_tools= cddl/usr.bin/sgsmsg cddl/lib/libctf lib/libelf \
|
|
|
|
lib/libdwarf cddl/usr.bin/ctfconvert cddl/usr.bin/ctfmerge
|
|
|
|
.endif
|
|
|
|
|
2014-05-16 15:56:34 +00:00
|
|
|
# Default to building the GPL DTC, but build the BSDL one if users explicitly
|
2013-01-22 17:49:51 +00:00
|
|
|
# request it.
|
2013-01-22 19:40:26 +00:00
|
|
|
_dtc= usr.bin/dtc
|
2013-01-22 17:49:51 +00:00
|
|
|
.if ${MK_GPL_DTC} != "no"
|
2010-06-13 13:02:43 +00:00
|
|
|
_dtc= gnu/usr.bin/dtc
|
|
|
|
.endif
|
|
|
|
|
2012-03-22 08:48:42 +00:00
|
|
|
.if ${MK_KERBEROS} != "no"
|
|
|
|
_kerberos5_bootstrap_tools= \
|
|
|
|
kerberos5/tools/make-roken \
|
|
|
|
kerberos5/lib/libroken \
|
|
|
|
kerberos5/lib/libvers \
|
|
|
|
kerberos5/tools/asn1_compile \
|
2013-05-11 13:44:11 +00:00
|
|
|
kerberos5/tools/slc \
|
|
|
|
usr.bin/compile_et
|
2012-03-22 08:48:42 +00:00
|
|
|
.endif
|
|
|
|
|
2011-05-11 17:50:19 +00:00
|
|
|
# Please document (add comment) why something is in 'bootstrap-tools'.
|
|
|
|
# Try to bound the building of the bootstrap-tool to just the
|
|
|
|
# FreeBSD versions that need the tool built at this stage of the build.
|
2013-07-06 00:13:08 +00:00
|
|
|
bootstrap-tools: .MAKE
|
2003-07-01 12:57:53 +00:00
|
|
|
.for _tool in \
|
2011-11-10 20:15:35 +00:00
|
|
|
${_clang_tblgen} \
|
2012-03-22 08:48:42 +00:00
|
|
|
${_kerberos5_bootstrap_tools} \
|
2008-05-23 04:22:14 +00:00
|
|
|
${_dtrace_tools} \
|
2003-07-01 12:57:53 +00:00
|
|
|
${_strfile} \
|
|
|
|
${_gperf} \
|
|
|
|
${_groff} \
|
2012-05-19 02:08:52 +00:00
|
|
|
${_ar} \
|
2010-06-13 13:02:43 +00:00
|
|
|
${_dtc} \
|
2011-08-11 10:29:10 +00:00
|
|
|
${_awk} \
|
2013-01-29 22:17:58 +00:00
|
|
|
${_cat} \
|
2005-02-19 10:25:42 +00:00
|
|
|
usr.bin/lorder \
|
2010-05-20 20:15:56 +00:00
|
|
|
usr.bin/makewhatis \
|
2012-05-16 04:21:21 +00:00
|
|
|
${_mklocale} \
|
2003-07-01 12:57:53 +00:00
|
|
|
usr.bin/rpcgen \
|
2009-10-21 19:39:34 +00:00
|
|
|
${_sed} \
|
2009-12-31 00:07:26 +00:00
|
|
|
${_yacc} \
|
2013-05-21 19:32:35 +00:00
|
|
|
${_m4} \
|
2012-05-22 15:59:07 +00:00
|
|
|
${_lex} \
|
2013-02-14 08:32:07 +00:00
|
|
|
lib/libmd \
|
2003-07-01 12:57:53 +00:00
|
|
|
usr.bin/xinstall \
|
2006-03-09 12:55:02 +00:00
|
|
|
${_gensnmptree} \
|
2013-01-15 00:12:34 +00:00
|
|
|
usr.sbin/config \
|
2013-05-24 15:53:13 +00:00
|
|
|
${_crunch} \
|
2014-09-09 20:36:56 +00:00
|
|
|
${_nmtree} \
|
|
|
|
${_vtfontcvt}
|
2004-09-07 15:19:40 +00:00
|
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
|
2013-06-30 15:00:07 +00:00
|
|
|
cd ${.CURDIR}/${_tool} && \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ obj && \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ depend && \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ all && \
|
2003-04-13 11:42:55 +00:00
|
|
|
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX}/legacy install
|
1999-12-08 13:45:11 +00:00
|
|
|
.endfor
|
1999-11-24 06:04:11 +00:00
|
|
|
|
o Add games/caesar to the list of bootstrap-tools so that a
buildworld doesn't break because the host doesn't have any
games installed,
o Add a new build stage: TMAKE. TMAKE builds all the build-tools
targets in the respective makefiles. Note that these targets
don't use the bootstrap tools,
o Add elf2exe to the bootstrap-tools when cross-building Alpha on
other platforms,
o Add ${WORLDTMP}/usr/games to TMPPATH,
o Remove ${WORLDTMP}/usr/bin even when NOCLEAN is defined. This
prevents using any bootstrap-tools previously installed. Most
importantly, it prevents using the cross-compiler when we still
need the native compiler.
The current stages are BMAKE, TMAKE, XMAKE and IMAKE in that order.
BMAKE builds bootstrap-tools that either solve compatibility problems
or are needed as cross-tools,
TMAKE builds the support tools necessary by some parts in the source
tree and also performs the cleandir and par-obj targets,
XMAKE builds the includes, libraries and everything (resp.), and
IMAKE installs the world. This stage needs further work if it's to be
used to install -current over -stable for example.
This is the last major update towards cross-building.
1999-12-16 13:47:34 +00:00
|
|
|
#
|
1999-12-20 10:32:11 +00:00
|
|
|
# build-tools: Build special purpose build tools
|
o Add games/caesar to the list of bootstrap-tools so that a
buildworld doesn't break because the host doesn't have any
games installed,
o Add a new build stage: TMAKE. TMAKE builds all the build-tools
targets in the respective makefiles. Note that these targets
don't use the bootstrap tools,
o Add elf2exe to the bootstrap-tools when cross-building Alpha on
other platforms,
o Add ${WORLDTMP}/usr/games to TMPPATH,
o Remove ${WORLDTMP}/usr/bin even when NOCLEAN is defined. This
prevents using any bootstrap-tools previously installed. Most
importantly, it prevents using the cross-compiler when we still
need the native compiler.
The current stages are BMAKE, TMAKE, XMAKE and IMAKE in that order.
BMAKE builds bootstrap-tools that either solve compatibility problems
or are needed as cross-tools,
TMAKE builds the support tools necessary by some parts in the source
tree and also performs the cleandir and par-obj targets,
XMAKE builds the includes, libraries and everything (resp.), and
IMAKE installs the world. This stage needs further work if it's to be
used to install -current over -stable for example.
This is the last major update towards cross-building.
1999-12-16 13:47:34 +00:00
|
|
|
#
|
2004-12-21 12:13:23 +00:00
|
|
|
.if !defined(NO_SHARE)
|
o Add games/caesar to the list of bootstrap-tools so that a
buildworld doesn't break because the host doesn't have any
games installed,
o Add a new build stage: TMAKE. TMAKE builds all the build-tools
targets in the respective makefiles. Note that these targets
don't use the bootstrap tools,
o Add elf2exe to the bootstrap-tools when cross-building Alpha on
other platforms,
o Add ${WORLDTMP}/usr/games to TMPPATH,
o Remove ${WORLDTMP}/usr/bin even when NOCLEAN is defined. This
prevents using any bootstrap-tools previously installed. Most
importantly, it prevents using the cross-compiler when we still
need the native compiler.
The current stages are BMAKE, TMAKE, XMAKE and IMAKE in that order.
BMAKE builds bootstrap-tools that either solve compatibility problems
or are needed as cross-tools,
TMAKE builds the support tools necessary by some parts in the source
tree and also performs the cleandir and par-obj targets,
XMAKE builds the includes, libraries and everything (resp.), and
IMAKE installs the world. This stage needs further work if it's to be
used to install -current over -stable for example.
This is the last major update towards cross-building.
1999-12-16 13:47:34 +00:00
|
|
|
_share= share/syscons/scrnmaps
|
|
|
|
.endif
|
|
|
|
|
2012-11-20 03:21:26 +00:00
|
|
|
.if ${MK_GCC} != "no"
|
2012-02-29 22:58:51 +00:00
|
|
|
_gcc_tools= gnu/usr.bin/cc/cc_tools
|
|
|
|
.endif
|
|
|
|
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_RESCUE} != "no"
|
2003-07-11 17:01:58 +00:00
|
|
|
_rescue= rescue/rescue
|
|
|
|
.endif
|
|
|
|
|
2013-07-06 00:13:08 +00:00
|
|
|
build-tools: .MAKE
|
2003-07-01 12:57:53 +00:00
|
|
|
.for _tool in \
|
|
|
|
bin/csh \
|
|
|
|
bin/sh \
|
2003-07-11 17:01:58 +00:00
|
|
|
${_rescue} \
|
2012-01-05 21:50:50 +00:00
|
|
|
${LOCAL_TOOL_DIRS} \
|
2007-01-20 07:48:10 +00:00
|
|
|
lib/ncurses/ncurses \
|
2007-03-09 12:11:58 +00:00
|
|
|
lib/ncurses/ncursesw \
|
2003-07-01 12:57:53 +00:00
|
|
|
${_share} \
|
|
|
|
usr.bin/awk \
|
2004-08-09 10:51:01 +00:00
|
|
|
lib/libmagic \
|
Add the BSD-licensed Citrus iconv to the base system with default off
setting. It can be built by setting the WITH_ICONV knob. While this
knob is unset, the library part, the binaries, the header file and
the metadata files will not be built or installed so it makes no impact
on the system if left turned off.
This work is based on the iconv implementation in NetBSD but a great
number of improvements and feature additions have been included:
- Some utilities have been added. There is a conversion table generator,
which can compare conversion tables to reference data generated by
GNU libiconv. This helps ensuring conversion compatibility.
- UTF-16 surrogate support and some endianness issues have been fixed.
- The rather chaotic Makefiles to build metadata have been refactored
and cleaned up, now it is easy to read and it is also easier to add
support for new encodings.
- A bunch of new encodings and encoding aliases have been added.
- Support for 1->2, 1->3 and 1->4 mappings, which is needed for
transliterating with flying accents as GNU does, like "u.
- Lots of warnings have been fixed, the major part of the code is
now WARNS=6 clean.
- New section 1 and section 5 manual pages have been added.
- Some GNU-specific calls have been implemented:
iconvlist(), iconvctl(), iconv_canonicalize(), iconv_open_into()
- Support for GNU's //IGNORE suffix has been added.
- The "-" argument for stdin is now recognized in iconv(1) as per POSIX.
- The Big5 conversion module has been fixed.
- The iconv.h header files is supposed to be compatible with the
GNU version, i.e. sources should build with base iconv.h and
GNU libiconv. It also includes a macro magic to deal with the
char ** and const char ** incompatibility.
- GNU compatibility: "" or "char" means the current local
encoding in use
- Various cleanups and style(9) fixes.
Approved by: delphij (mentor)
Obtained from: The NetBSD Project
Sponsored by: Google Summer of Code 2009
2011-02-25 00:04:39 +00:00
|
|
|
usr.bin/mkesdb_static \
|
2013-08-11 20:03:12 +00:00
|
|
|
usr.bin/mkcsmapper_static \
|
|
|
|
usr.bin/vi/catalog
|
2004-09-07 15:19:40 +00:00
|
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,build-tools)"; \
|
2013-06-30 15:00:07 +00:00
|
|
|
cd ${.CURDIR}/${_tool} && \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ obj && \
|
2003-02-24 20:09:16 +00:00
|
|
|
${MAKE} DIRPRFX=${_tool}/ build-tools
|
o Add games/caesar to the list of bootstrap-tools so that a
buildworld doesn't break because the host doesn't have any
games installed,
o Add a new build stage: TMAKE. TMAKE builds all the build-tools
targets in the respective makefiles. Note that these targets
don't use the bootstrap tools,
o Add elf2exe to the bootstrap-tools when cross-building Alpha on
other platforms,
o Add ${WORLDTMP}/usr/games to TMPPATH,
o Remove ${WORLDTMP}/usr/bin even when NOCLEAN is defined. This
prevents using any bootstrap-tools previously installed. Most
importantly, it prevents using the cross-compiler when we still
need the native compiler.
The current stages are BMAKE, TMAKE, XMAKE and IMAKE in that order.
BMAKE builds bootstrap-tools that either solve compatibility problems
or are needed as cross-tools,
TMAKE builds the support tools necessary by some parts in the source
tree and also performs the cleandir and par-obj targets,
XMAKE builds the includes, libraries and everything (resp.), and
IMAKE installs the world. This stage needs further work if it's to be
used to install -current over -stable for example.
This is the last major update towards cross-building.
1999-12-16 13:47:34 +00:00
|
|
|
.endfor
|
2004-01-31 08:15:57 +00:00
|
|
|
.for _tool in \
|
2012-03-22 08:48:42 +00:00
|
|
|
${_gcc_tools}
|
2004-09-07 15:19:40 +00:00
|
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all)"; \
|
2013-06-30 15:00:07 +00:00
|
|
|
cd ${.CURDIR}/${_tool} && \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ obj && \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ depend && \
|
2004-01-31 08:15:57 +00:00
|
|
|
${MAKE} DIRPRFX=${_tool}/ all
|
|
|
|
.endfor
|
o Add games/caesar to the list of bootstrap-tools so that a
buildworld doesn't break because the host doesn't have any
games installed,
o Add a new build stage: TMAKE. TMAKE builds all the build-tools
targets in the respective makefiles. Note that these targets
don't use the bootstrap tools,
o Add elf2exe to the bootstrap-tools when cross-building Alpha on
other platforms,
o Add ${WORLDTMP}/usr/games to TMPPATH,
o Remove ${WORLDTMP}/usr/bin even when NOCLEAN is defined. This
prevents using any bootstrap-tools previously installed. Most
importantly, it prevents using the cross-compiler when we still
need the native compiler.
The current stages are BMAKE, TMAKE, XMAKE and IMAKE in that order.
BMAKE builds bootstrap-tools that either solve compatibility problems
or are needed as cross-tools,
TMAKE builds the support tools necessary by some parts in the source
tree and also performs the cleandir and par-obj targets,
XMAKE builds the includes, libraries and everything (resp.), and
IMAKE installs the world. This stage needs further work if it's to be
used to install -current over -stable for example.
This is the last major update towards cross-building.
1999-12-16 13:47:34 +00:00
|
|
|
|
2014-08-21 14:56:57 +00:00
|
|
|
#
|
|
|
|
# kernel-tools: Build kernel-building tools
|
|
|
|
#
|
|
|
|
kernel-tools: .MAKE
|
|
|
|
mkdir -p ${MAKEOBJDIRPREFIX}/usr
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
|
|
|
-p ${MAKEOBJDIRPREFIX}/usr >/dev/null
|
|
|
|
|
1999-12-20 10:32:11 +00:00
|
|
|
#
|
|
|
|
# cross-tools: Build cross-building tools
|
|
|
|
#
|
2014-04-12 15:06:15 +00:00
|
|
|
.if !defined(TARGET_ARCH) && defined(XDEV_ARCH)
|
|
|
|
TARGET_ARCH= ${XDEV_ARCH}
|
|
|
|
.endif
|
2012-05-16 04:21:21 +00:00
|
|
|
.if ${TARGET_ARCH} != ${MACHINE_ARCH} || ${BOOTSTRAPPING} < 800035
|
2005-12-07 20:01:12 +00:00
|
|
|
.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "i386"
|
2003-07-01 12:57:53 +00:00
|
|
|
_btxld= usr.sbin/btxld
|
|
|
|
.endif
|
2008-04-15 05:14:42 +00:00
|
|
|
.endif
|
|
|
|
.if ${TARGET_ARCH} != ${MACHINE_ARCH}
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_RESCUE} != "no" || defined(RELEASEDIR)
|
2003-07-01 12:25:11 +00:00
|
|
|
_crunchide= usr.sbin/crunch/crunchide
|
|
|
|
.endif
|
2005-12-07 20:01:12 +00:00
|
|
|
.if ${TARGET_ARCH} == "i386" && defined(RELEASEDIR)
|
2003-07-01 12:57:53 +00:00
|
|
|
_kgzip= usr.sbin/kgzip
|
|
|
|
.endif
|
2005-12-07 20:01:12 +00:00
|
|
|
.endif
|
2002-03-20 18:25:50 +00:00
|
|
|
|
2013-05-15 14:30:03 +00:00
|
|
|
.if ${XAS:M/*} == "" && ${MK_BINUTILS} != "no"
|
2011-05-19 05:13:25 +00:00
|
|
|
_binutils= gnu/usr.bin/binutils
|
|
|
|
.endif
|
|
|
|
|
2013-05-15 14:30:03 +00:00
|
|
|
# If an full path to an external cross compiler is given, don't build
|
|
|
|
# a cross compiler.
|
|
|
|
.if ${XCC:M/*} == "" && ${MK_CROSS_COMPILER} != "no"
|
2013-11-01 16:48:30 +00:00
|
|
|
.if ${MK_CLANG_IS_CC} != "no" || ${CC:T:Mclang} == "clang"
|
2011-11-09 19:00:27 +00:00
|
|
|
_clang= usr.bin/clang
|
2011-11-10 20:15:35 +00:00
|
|
|
_clang_libs= lib/clang
|
2013-10-31 14:07:00 +00:00
|
|
|
.else
|
2011-05-19 05:13:25 +00:00
|
|
|
_cc= gnu/usr.bin/cc
|
|
|
|
.endif
|
2013-11-01 16:48:30 +00:00
|
|
|
|
|
|
|
# The boot2 for pc98 requires gcc.
|
|
|
|
.if ${TARGET} == "pc98"
|
|
|
|
_cc= gnu/usr.bin/cc
|
|
|
|
.endif
|
2013-05-15 14:30:03 +00:00
|
|
|
.endif
|
2011-05-19 05:13:25 +00:00
|
|
|
|
2013-07-06 00:13:08 +00:00
|
|
|
cross-tools: .MAKE
|
2003-07-01 12:57:53 +00:00
|
|
|
.for _tool in \
|
2010-08-21 15:39:06 +00:00
|
|
|
${_clang_libs} \
|
|
|
|
${_clang} \
|
2011-05-19 05:13:25 +00:00
|
|
|
${_binutils} \
|
|
|
|
${_cc} \
|
2003-07-01 12:57:53 +00:00
|
|
|
usr.bin/xlint/lint1 usr.bin/xlint/lint2 usr.bin/xlint/xlint \
|
|
|
|
${_btxld} \
|
|
|
|
${_crunchide} \
|
|
|
|
${_kgzip}
|
2004-09-07 15:19:40 +00:00
|
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
|
2013-06-30 15:00:07 +00:00
|
|
|
cd ${.CURDIR}/${_tool} && \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ obj && \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ depend && \
|
|
|
|
${MAKE} DIRPRFX=${_tool}/ all && \
|
2002-05-12 16:01:00 +00:00
|
|
|
${MAKE} DIRPRFX=${_tool}/ DESTDIR=${MAKEOBJDIRPREFIX} install
|
1999-12-20 10:32:11 +00:00
|
|
|
.endfor
|
|
|
|
|
1999-11-24 06:04:11 +00:00
|
|
|
#
|
1999-12-08 13:45:11 +00:00
|
|
|
# hierarchy - ensure that all the needed directories are present
|
1999-11-24 06:04:11 +00:00
|
|
|
#
|
2014-10-23 01:06:00 +00:00
|
|
|
hierarchy hier: .MAKE
|
2013-06-14 22:32:47 +00:00
|
|
|
cd ${.CURDIR}/etc && ${HMAKE} distrib-dirs
|
1998-08-31 01:08:08 +00:00
|
|
|
|
|
|
|
#
|
1999-12-08 13:45:11 +00:00
|
|
|
# libraries - build all libraries, and install them under ${DESTDIR}.
|
1999-11-24 06:04:11 +00:00
|
|
|
#
|
2002-04-12 19:46:25 +00:00
|
|
|
# The list of libraries with dependents (${_prebuild_libs}) and their
|
|
|
|
# interdependencies (__L) are built automatically by the
|
|
|
|
# ${.CURDIR}/tools/make_libdeps.sh script.
|
1998-08-31 01:08:08 +00:00
|
|
|
#
|
2013-07-06 00:13:08 +00:00
|
|
|
libraries: .MAKE
|
|
|
|
cd ${.CURDIR} && \
|
|
|
|
${MAKE} -f Makefile.inc1 _prereq_libs && \
|
|
|
|
${MAKE} -f Makefile.inc1 _startup_libs && \
|
|
|
|
${MAKE} -f Makefile.inc1 _prebuild_libs && \
|
|
|
|
${MAKE} -f Makefile.inc1 _generic_libs
|
2002-04-12 19:46:25 +00:00
|
|
|
|
2007-05-19 03:34:59 +00:00
|
|
|
#
|
|
|
|
# static libgcc.a prerequisite for shared libc
|
|
|
|
#
|
2010-11-11 15:48:27 +00:00
|
|
|
_prereq_libs= gnu/lib/libssp/libssp_nonshared gnu/lib/libgcc lib/libcompiler_rt
|
2007-05-19 03:34:59 +00:00
|
|
|
|
2002-04-16 14:38:15 +00:00
|
|
|
# These dependencies are not automatically generated:
|
|
|
|
#
|
2007-05-19 03:34:59 +00:00
|
|
|
# gnu/lib/csu, gnu/lib/libgcc, lib/csu and lib/libc must be built before
|
|
|
|
# all shared libraries for ELF.
|
2002-04-16 14:38:15 +00:00
|
|
|
#
|
2007-05-19 03:34:59 +00:00
|
|
|
_startup_libs= gnu/lib/csu
|
2010-08-24 16:29:09 +00:00
|
|
|
.if exists(${.CURDIR}/lib/csu/${MACHINE_ARCH}-elf)
|
|
|
|
_startup_libs+= lib/csu/${MACHINE_ARCH}-elf
|
2010-08-28 15:03:11 +00:00
|
|
|
.elif exists(${.CURDIR}/lib/csu/${MACHINE_ARCH})
|
|
|
|
_startup_libs+= lib/csu/${MACHINE_ARCH}
|
1998-08-31 01:08:08 +00:00
|
|
|
.else
|
2010-06-24 17:53:25 +00:00
|
|
|
_startup_libs+= lib/csu/${MACHINE_CPUARCH}
|
1998-08-31 01:08:08 +00:00
|
|
|
.endif
|
2007-05-19 03:34:59 +00:00
|
|
|
_startup_libs+= gnu/lib/libgcc
|
2010-11-11 15:48:27 +00:00
|
|
|
_startup_libs+= lib/libcompiler_rt
|
2007-05-19 03:34:59 +00:00
|
|
|
_startup_libs+= lib/libc
|
2013-11-20 20:24:59 +00:00
|
|
|
_startup_libs+= lib/libc_nonshared
|
2011-11-26 03:26:06 +00:00
|
|
|
.if ${MK_LIBCPLUSPLUS} != "no"
|
2011-11-25 20:59:04 +00:00
|
|
|
_startup_libs+= lib/libcxxrt
|
|
|
|
.endif
|
2007-05-19 03:34:59 +00:00
|
|
|
|
|
|
|
gnu/lib/libgcc__L: lib/libc__L
|
2013-11-20 20:24:59 +00:00
|
|
|
gnu/lib/libgcc__L: lib/libc_nonshared__L
|
2012-03-17 22:12:09 +00:00
|
|
|
.if ${MK_LIBCPLUSPLUS} != "no"
|
|
|
|
lib/libcxxrt__L: gnu/lib/libgcc__L
|
|
|
|
.endif
|
1998-08-31 01:08:08 +00:00
|
|
|
|
2012-03-22 08:48:42 +00:00
|
|
|
_prebuild_libs= ${_kerberos5_lib_libasn1} \
|
|
|
|
${_kerberos5_lib_libhdb} \
|
|
|
|
${_kerberos5_lib_libheimbase} \
|
2011-09-27 07:14:12 +00:00
|
|
|
${_kerberos5_lib_libheimntlm} \
|
2012-03-22 08:48:42 +00:00
|
|
|
${_kerberos5_lib_libheimsqlite} \
|
|
|
|
${_kerberos5_lib_libheimipcc} \
|
2010-01-26 10:00:26 +00:00
|
|
|
${_kerberos5_lib_libhx509} ${_kerberos5_lib_libkrb5} \
|
|
|
|
${_kerberos5_lib_libroken} \
|
2012-03-22 08:48:42 +00:00
|
|
|
${_kerberos5_lib_libwind} \
|
2013-12-28 23:08:58 +00:00
|
|
|
${_lib_atf} \
|
2012-03-23 03:16:35 +00:00
|
|
|
lib/libbz2 ${_libcom_err} lib/libcrypt \
|
2013-04-20 08:13:35 +00:00
|
|
|
lib/libelf lib/libexpat \
|
2010-01-26 10:00:26 +00:00
|
|
|
${_lib_libgssapi} ${_lib_libipx} \
|
2010-05-10 15:28:44 +00:00
|
|
|
lib/libkiconv lib/libkvm lib/liblzma lib/libmd \
|
2007-03-09 12:11:58 +00:00
|
|
|
lib/ncurses/ncurses lib/ncurses/ncursesw \
|
2011-11-24 13:18:58 +00:00
|
|
|
lib/libopie lib/libpam ${_lib_libthr} \
|
2010-01-21 16:56:27 +00:00
|
|
|
lib/libradius lib/libsbuf lib/libtacplus \
|
2012-07-30 23:14:24 +00:00
|
|
|
${_cddl_lib_libumem} ${_cddl_lib_libnvpair} \
|
2014-05-27 18:22:52 +00:00
|
|
|
${_cddl_lib_libavl} \
|
2013-03-05 08:09:53 +00:00
|
|
|
${_cddl_lib_libzfs_core} \
|
2009-12-11 14:15:55 +00:00
|
|
|
lib/libutil ${_lib_libypclnt} lib/libz lib/msun \
|
2013-09-10 22:26:11 +00:00
|
|
|
${_secure_lib_libcrypto} ${_lib_libldns} \
|
|
|
|
${_secure_lib_libssh} ${_secure_lib_libssl}
|
2014-05-26 22:27:14 +00:00
|
|
|
.if ${MK_GNUCXX} != no
|
|
|
|
_prebuild_libs+= gnu/lib/libstdc++ gnu/lib/libsupc++
|
|
|
|
gnu/lib/libstdc++__L: lib/msun__L
|
|
|
|
.endif
|
2002-07-01 17:51:43 +00:00
|
|
|
|
2014-02-13 19:46:48 +00:00
|
|
|
.if defined(WITH_ATF) || ${MK_TESTS} != "no"
|
|
|
|
.if !defined(WITH_ATF)
|
|
|
|
# Ensure that the ATF libraries will be built during make libraries, even
|
|
|
|
# though they will have -DNO_TESTS
|
|
|
|
MAKE+= -DWITH_ATF
|
|
|
|
.endif
|
2013-12-28 23:08:58 +00:00
|
|
|
_lib_atf= lib/atf
|
2012-10-22 01:18:41 +00:00
|
|
|
.endif
|
|
|
|
|
2008-03-29 17:44:40 +00:00
|
|
|
.if ${MK_LIBTHR} != "no"
|
|
|
|
_lib_libthr= lib/libthr
|
2007-10-01 18:22:32 +00:00
|
|
|
.endif
|
|
|
|
|
2011-03-21 09:58:24 +00:00
|
|
|
.if ${MK_OFED} != "no"
|
|
|
|
_ofed_lib= contrib/ofed/usr.lib/
|
|
|
|
.endif
|
|
|
|
|
|
|
|
_generic_libs= ${_cddl_lib} gnu/lib ${_kerberos5_lib} lib ${_secure_lib} usr.bin/lex/lib ${_ofed_lib}
|
2012-06-15 19:40:59 +00:00
|
|
|
.for _DIR in ${LOCAL_LIB_DIRS}
|
|
|
|
.if exists(${.CURDIR}/${_DIR}/Makefile)
|
|
|
|
_generic_libs+= ${_DIR}
|
|
|
|
.endif
|
|
|
|
.endfor
|
2002-04-16 14:38:15 +00:00
|
|
|
|
2006-10-07 19:26:46 +00:00
|
|
|
lib/libopie__L lib/libtacplus__L: lib/libmd__L
|
2002-04-16 14:38:15 +00:00
|
|
|
|
2007-04-06 02:13:30 +00:00
|
|
|
.if ${MK_CDDL} != "no"
|
2011-02-27 19:44:10 +00:00
|
|
|
_cddl_lib_libumem= cddl/lib/libumem
|
2012-07-30 23:14:24 +00:00
|
|
|
_cddl_lib_libnvpair= cddl/lib/libnvpair
|
2014-05-27 18:22:52 +00:00
|
|
|
_cddl_lib_libavl= cddl/lib/libavl
|
2013-03-05 08:09:53 +00:00
|
|
|
_cddl_lib_libzfs_core= cddl/lib/libzfs_core
|
2007-04-06 02:13:30 +00:00
|
|
|
_cddl_lib= cddl/lib
|
2013-03-05 22:51:11 +00:00
|
|
|
cddl/lib/libzfs_core__L: cddl/lib/libnvpair__L
|
2007-04-06 02:13:30 +00:00
|
|
|
.endif
|
|
|
|
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_CRYPT} != "no"
|
|
|
|
.if ${MK_OPENSSL} != "no"
|
2006-10-07 19:26:46 +00:00
|
|
|
_secure_lib_libcrypto= secure/lib/libcrypto
|
|
|
|
_secure_lib_libssl= secure/lib/libssl
|
2005-11-10 18:07:07 +00:00
|
|
|
lib/libradius__L secure/lib/libssl__L: secure/lib/libcrypto__L
|
2013-09-10 22:26:11 +00:00
|
|
|
.if ${MK_LDNS} != "no"
|
|
|
|
_lib_libldns= lib/libldns
|
|
|
|
lib/libldns__L: secure/lib/libcrypto__L
|
|
|
|
.endif
|
2010-01-23 19:29:42 +00:00
|
|
|
.if ${MK_OPENSSH} != "no"
|
|
|
|
_secure_lib_libssh= secure/lib/libssh
|
|
|
|
secure/lib/libssh__L: lib/libz__L secure/lib/libcrypto__L lib/libcrypt__L
|
2013-09-10 22:26:11 +00:00
|
|
|
.if ${MK_LDNS} != "no"
|
|
|
|
secure/lib/libssh__L: lib/libldns__L
|
|
|
|
.endif
|
2010-01-23 19:29:42 +00:00
|
|
|
.if ${MK_KERBEROS_SUPPORT} != "no"
|
2010-01-26 10:00:26 +00:00
|
|
|
secure/lib/libssh__L: lib/libgssapi__L kerberos5/lib/libkrb5__L \
|
|
|
|
kerberos5/lib/libhx509__L kerberos5/lib/libasn1__L lib/libcom_err__L \
|
|
|
|
lib/libmd__L kerberos5/lib/libroken__L
|
2004-05-12 07:02:17 +00:00
|
|
|
.endif
|
1999-12-17 11:23:56 +00:00
|
|
|
.endif
|
2002-06-21 08:54:03 +00:00
|
|
|
.endif
|
2006-10-07 19:26:46 +00:00
|
|
|
_secure_lib= secure/lib
|
2002-04-16 14:38:15 +00:00
|
|
|
.endif
|
1999-12-17 11:23:56 +00:00
|
|
|
|
2011-09-27 07:14:12 +00:00
|
|
|
.if ${MK_KERBEROS} != "no"
|
|
|
|
kerberos5/lib/libasn1__L: lib/libcom_err__L kerberos5/lib/libroken__L
|
|
|
|
kerberos5/lib/libhdb__L: kerberos5/lib/libasn1__L lib/libcom_err__L \
|
2012-03-22 08:48:42 +00:00
|
|
|
kerberos5/lib/libkrb5__L kerberos5/lib/libroken__L \
|
|
|
|
kerberos5/lib/libwind__L kerberos5/lib/libheimsqlite__L
|
|
|
|
kerberos5/lib/libheimntlm__L: secure/lib/libcrypto__L kerberos5/lib/libkrb5__L \
|
|
|
|
kerberos5/lib/libroken__L lib/libcom_err__L
|
2011-09-27 07:14:12 +00:00
|
|
|
kerberos5/lib/libhx509__L: kerberos5/lib/libasn1__L lib/libcom_err__L \
|
2012-03-22 08:48:42 +00:00
|
|
|
secure/lib/libcrypto__L kerberos5/lib/libroken__L kerberos5/lib/libwind__L
|
2011-09-27 07:14:12 +00:00
|
|
|
kerberos5/lib/libkrb5__L: kerberos5/lib/libasn1__L lib/libcom_err__L \
|
|
|
|
lib/libcrypt__L secure/lib/libcrypto__L kerberos5/lib/libhx509__L \
|
2012-03-22 08:48:42 +00:00
|
|
|
kerberos5/lib/libroken__L kerberos5/lib/libwind__L \
|
|
|
|
kerberos5/lib/libheimbase__L kerberos5/lib/libheimipcc__L
|
2011-09-27 07:14:12 +00:00
|
|
|
kerberos5/lib/libroken__L: lib/libcrypt__L
|
2012-03-22 08:48:42 +00:00
|
|
|
kerberos5/lib/libwind__L: kerberos5/lib/libroken__L lib/libcom_err__L
|
|
|
|
kerberos5/lib/libheimbase__L: lib/libthr__L
|
|
|
|
kerberos5/lib/libheimipcc__L: kerberos5/lib/libroken__L kerberos5/lib/libheimbase__L lib/libthr__L
|
|
|
|
kerberos5/lib/libheimsqlite__L: lib/libthr__L
|
2011-09-27 07:14:12 +00:00
|
|
|
.endif
|
|
|
|
|
2010-01-23 19:29:42 +00:00
|
|
|
.if ${MK_GSSAPI} != "no"
|
|
|
|
_lib_libgssapi= lib/libgssapi
|
|
|
|
.endif
|
|
|
|
|
2006-10-07 19:26:46 +00:00
|
|
|
.if ${MK_IPX} != "no"
|
|
|
|
_lib_libipx= lib/libipx
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if ${MK_KERBEROS} != "no"
|
|
|
|
_kerberos5_lib= kerberos5/lib
|
|
|
|
_kerberos5_lib_libasn1= kerberos5/lib/libasn1
|
2011-09-27 07:14:12 +00:00
|
|
|
_kerberos5_lib_libhdb= kerberos5/lib/libhdb
|
2012-03-22 08:48:42 +00:00
|
|
|
_kerberos5_lib_libheimbase= kerberos5/lib/libheimbase
|
2006-10-07 19:26:46 +00:00
|
|
|
_kerberos5_lib_libkrb5= kerberos5/lib/libkrb5
|
2008-05-07 13:53:12 +00:00
|
|
|
_kerberos5_lib_libhx509= kerberos5/lib/libhx509
|
2006-10-07 19:26:46 +00:00
|
|
|
_kerberos5_lib_libroken= kerberos5/lib/libroken
|
2008-05-07 13:53:12 +00:00
|
|
|
_kerberos5_lib_libheimntlm= kerberos5/lib/libheimntlm
|
2012-03-22 08:48:42 +00:00
|
|
|
_kerberos5_lib_libheimsqlite= kerberos5/lib/libheimsqlite
|
|
|
|
_kerberos5_lib_libheimipcc= kerberos5/lib/libheimipcc
|
|
|
|
_kerberos5_lib_libwind= kerberos5/lib/libwind
|
2012-03-23 03:16:35 +00:00
|
|
|
_libcom_err= lib/libcom_err
|
2004-04-27 15:00:29 +00:00
|
|
|
.endif
|
|
|
|
|
2006-03-17 18:54:44 +00:00
|
|
|
.if ${MK_NIS} != "no"
|
2006-10-07 19:26:46 +00:00
|
|
|
_lib_libypclnt= lib/libypclnt
|
2004-11-13 20:40:32 +00:00
|
|
|
.endif
|
|
|
|
|
2006-10-07 19:26:46 +00:00
|
|
|
.if ${MK_OPENSSL} == "no"
|
2011-05-17 19:11:47 +00:00
|
|
|
lib/libradius__L: lib/libmd__L
|
2006-10-07 19:26:46 +00:00
|
|
|
.endif
|
2002-04-16 14:38:15 +00:00
|
|
|
|
2007-05-19 03:34:59 +00:00
|
|
|
.for _lib in ${_prereq_libs}
|
2013-07-06 00:13:08 +00:00
|
|
|
${_lib}__PL: .PHONY .MAKE
|
2007-05-19 03:34:59 +00:00
|
|
|
.if exists(${.CURDIR}/${_lib})
|
|
|
|
${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \
|
2013-06-30 15:00:07 +00:00
|
|
|
cd ${.CURDIR}/${_lib} && \
|
2013-12-28 20:05:31 +00:00
|
|
|
${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ obj && \
|
|
|
|
${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ depend && \
|
|
|
|
${MAKE} -DNO_TESTS -DNO_PROFILE -DNO_PIC \
|
|
|
|
DIRPRFX=${_lib}/ all && \
|
|
|
|
${MAKE} -DNO_TESTS -DNO_PROFILE -DNO_PIC \
|
|
|
|
DIRPRFX=${_lib}/ install
|
2007-05-19 03:34:59 +00:00
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
2011-11-24 13:18:58 +00:00
|
|
|
.for _lib in ${_startup_libs} ${_prebuild_libs:Nlib/libpam} ${_generic_libs}
|
2013-07-06 00:13:08 +00:00
|
|
|
${_lib}__L: .PHONY .MAKE
|
1999-11-24 06:04:11 +00:00
|
|
|
.if exists(${.CURDIR}/${_lib})
|
2006-08-24 17:02:26 +00:00
|
|
|
${_+_}@${ECHODIR} "===> ${_lib} (obj,depend,all,install)"; \
|
2013-06-30 15:00:07 +00:00
|
|
|
cd ${.CURDIR}/${_lib} && \
|
2013-12-28 20:05:31 +00:00
|
|
|
${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ obj && \
|
|
|
|
${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ depend && \
|
|
|
|
${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ all && \
|
|
|
|
${MAKE} -DNO_TESTS DIRPRFX=${_lib}/ install
|
1999-01-07 06:26:33 +00:00
|
|
|
.endif
|
1999-07-07 04:46:46 +00:00
|
|
|
.endfor
|
1998-09-01 00:39:02 +00:00
|
|
|
|
2011-11-24 13:18:58 +00:00
|
|
|
# libpam is special: we need to build static PAM modules before
|
|
|
|
# static PAM library, and dynamic PAM library before dynamic PAM
|
|
|
|
# modules.
|
2013-07-06 00:13:08 +00:00
|
|
|
lib/libpam__L: .PHONY .MAKE
|
2011-11-24 13:18:58 +00:00
|
|
|
${_+_}@${ECHODIR} "===> lib/libpam (obj,depend,all,install)"; \
|
2013-06-30 15:00:07 +00:00
|
|
|
cd ${.CURDIR}/lib/libpam && \
|
2013-12-28 20:05:31 +00:00
|
|
|
${MAKE} -DNO_TESTS DIRPRFX=lib/libpam/ obj && \
|
|
|
|
${MAKE} -DNO_TESTS DIRPRFX=lib/libpam/ depend && \
|
|
|
|
${MAKE} -DNO_TESTS DIRPRFX=lib/libpam/ \
|
|
|
|
-D_NO_LIBPAM_SO_YET all && \
|
|
|
|
${MAKE} -DNO_TESTS DIRPRFX=lib/libpam/ \
|
|
|
|
-D_NO_LIBPAM_SO_YET install
|
2011-11-24 13:18:58 +00:00
|
|
|
|
2007-05-26 20:17:19 +00:00
|
|
|
_prereq_libs: ${_prereq_libs:S/$/__PL/}
|
2002-04-12 19:46:25 +00:00
|
|
|
_startup_libs: ${_startup_libs:S/$/__L/}
|
|
|
|
_prebuild_libs: ${_prebuild_libs:S/$/__L/}
|
|
|
|
_generic_libs: ${_generic_libs:S/$/__L/}
|
|
|
|
|
2003-04-01 11:39:04 +00:00
|
|
|
.for __target in all clean cleandepend cleandir depend includes obj
|
1998-08-31 01:08:08 +00:00
|
|
|
.for entry in ${SUBDIR}
|
2013-07-06 00:13:08 +00:00
|
|
|
${entry}.${__target}__D: .PHONY .MAKE
|
2013-06-30 15:00:07 +00:00
|
|
|
${_+_}@set -e; if test -d ${.CURDIR}/${entry}.${MACHINE_ARCH}; then \
|
2004-09-07 15:19:40 +00:00
|
|
|
${ECHODIR} "===> ${DIRPRFX}${entry}.${MACHINE_ARCH} (${__target})"; \
|
1998-08-31 20:48:13 +00:00
|
|
|
edir=${entry}.${MACHINE_ARCH}; \
|
1998-08-31 01:08:08 +00:00
|
|
|
cd ${.CURDIR}/$${edir}; \
|
|
|
|
else \
|
2004-09-07 15:19:40 +00:00
|
|
|
${ECHODIR} "===> ${DIRPRFX}${entry} (${__target})"; \
|
1998-08-31 01:08:08 +00:00
|
|
|
edir=${entry}; \
|
|
|
|
cd ${.CURDIR}/$${edir}; \
|
|
|
|
fi; \
|
|
|
|
${MAKE} ${__target} DIRPRFX=${DIRPRFX}$${edir}/
|
|
|
|
.endfor
|
|
|
|
par-${__target}: ${SUBDIR:S/$/.${__target}__D/}
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
.include <bsd.subdir.mk>
|
2005-07-23 14:23:30 +00:00
|
|
|
|
2007-05-16 08:46:35 +00:00
|
|
|
.if make(check-old) || make(check-old-dirs) || \
|
|
|
|
make(check-old-files) || make(check-old-libs) || \
|
|
|
|
make(delete-old) || make(delete-old-dirs) || \
|
|
|
|
make(delete-old-files) || make(delete-old-libs)
|
2005-07-30 18:02:20 +00:00
|
|
|
|
2005-07-23 14:23:30 +00:00
|
|
|
#
|
|
|
|
# check for / delete old files section
|
|
|
|
#
|
|
|
|
|
|
|
|
.include "ObsoleteFiles.inc"
|
|
|
|
|
|
|
|
OLD_LIBS_MESSAGE="Please be sure no application still uses those libraries, \
|
|
|
|
else you can not start such an application. Consult UPDATING for more \
|
|
|
|
information regarding how to cope with the removal/revision bump of a \
|
|
|
|
specific library."
|
|
|
|
|
|
|
|
.if !defined(BATCH_DELETE_OLD_FILES)
|
|
|
|
RM_I=-i
|
2005-07-30 18:02:20 +00:00
|
|
|
.else
|
|
|
|
RM_I=-v
|
2005-07-23 14:23:30 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
delete-old-files:
|
|
|
|
@echo ">>> Removing old files (only deletes safe to delete libs)"
|
|
|
|
# Ask for every old file if the user really wants to remove it.
|
2005-08-23 07:58:55 +00:00
|
|
|
# It's annoying, but better safe than sorry.
|
2011-04-01 20:59:23 +00:00
|
|
|
# NB: We cannot pass the list of OLD_FILES as a parameter because the
|
|
|
|
# argument list will get too long. Using .for/.endfor make "loops" will make
|
|
|
|
# the Makefile parser segfault.
|
|
|
|
@exec 3<&0; \
|
2013-11-03 07:31:54 +00:00
|
|
|
cd ${.CURDIR}; \
|
2011-04-01 20:59:23 +00:00
|
|
|
${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
|
2013-10-01 22:53:27 +00:00
|
|
|
-V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \
|
2011-04-01 20:59:23 +00:00
|
|
|
while read file; do \
|
2007-05-16 08:37:40 +00:00
|
|
|
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
|
2007-05-19 20:34:29 +00:00
|
|
|
chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \
|
2011-04-01 20:59:23 +00:00
|
|
|
rm ${RM_I} "${DESTDIR}/$${file}" <&3; \
|
2006-02-18 16:58:21 +00:00
|
|
|
fi; \
|
2007-05-16 20:16:06 +00:00
|
|
|
done
|
2005-08-07 13:47:25 +00:00
|
|
|
# Remove catpages without corresponding manpages.
|
2010-01-14 23:27:23 +00:00
|
|
|
@exec 3<&0; \
|
2005-11-12 19:31:30 +00:00
|
|
|
find ${DESTDIR}/usr/share/man/cat* ! -type d | \
|
|
|
|
sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \
|
|
|
|
while read catpage; do \
|
|
|
|
read manpage; \
|
|
|
|
if [ ! -e "$${manpage}" ]; then \
|
2011-04-01 20:59:23 +00:00
|
|
|
rm ${RM_I} $${catpage} <&3; \
|
2005-11-12 19:31:30 +00:00
|
|
|
fi; \
|
2005-08-07 13:47:25 +00:00
|
|
|
done
|
2005-07-23 14:23:30 +00:00
|
|
|
@echo ">>> Old files removed"
|
|
|
|
|
|
|
|
check-old-files:
|
|
|
|
@echo ">>> Checking for old files"
|
2013-11-03 07:31:54 +00:00
|
|
|
@cd ${.CURDIR}; \
|
|
|
|
${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
|
2011-04-01 20:59:23 +00:00
|
|
|
-V OLD_FILES -V "OLD_FILES:Musr/share/*.gz:R" | xargs -n1 | \
|
|
|
|
while read file; do \
|
2007-05-16 08:37:40 +00:00
|
|
|
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
|
2007-05-13 18:15:50 +00:00
|
|
|
echo "${DESTDIR}/$${file}"; \
|
|
|
|
fi; \
|
2007-05-16 20:16:06 +00:00
|
|
|
done
|
2005-08-07 13:47:25 +00:00
|
|
|
# Check for catpages without corresponding manpages.
|
2005-11-12 19:31:30 +00:00
|
|
|
@find ${DESTDIR}/usr/share/man/cat* ! -type d | \
|
|
|
|
sed -ep -e's:${DESTDIR}/usr/share/man/cat:${DESTDIR}/usr/share/man/man:' | \
|
|
|
|
while read catpage; do \
|
|
|
|
read manpage; \
|
|
|
|
if [ ! -e "$${manpage}" ]; then \
|
2011-04-01 20:59:23 +00:00
|
|
|
echo $${catpage}; \
|
2005-11-12 19:31:30 +00:00
|
|
|
fi; \
|
2005-08-07 13:47:25 +00:00
|
|
|
done
|
2005-07-23 14:23:30 +00:00
|
|
|
|
|
|
|
delete-old-libs:
|
|
|
|
@echo ">>> Removing old libraries"
|
|
|
|
@echo "${OLD_LIBS_MESSAGE}" | fmt
|
2011-04-01 20:59:23 +00:00
|
|
|
@exec 3<&0; \
|
2013-11-03 07:31:54 +00:00
|
|
|
cd ${.CURDIR}; \
|
2011-04-01 20:59:23 +00:00
|
|
|
${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
|
|
|
|
-V OLD_LIBS | xargs -n1 | \
|
|
|
|
while read file; do \
|
2007-05-16 08:37:40 +00:00
|
|
|
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
|
2007-05-19 20:34:29 +00:00
|
|
|
chflags noschg "${DESTDIR}/$${file}" 2>/dev/null || true; \
|
2011-04-01 20:59:23 +00:00
|
|
|
rm ${RM_I} "${DESTDIR}/$${file}" <&3; \
|
2006-02-18 16:58:21 +00:00
|
|
|
fi; \
|
2013-10-24 11:35:50 +00:00
|
|
|
for ext in debug symbols; do \
|
|
|
|
if ! [ -e "${DESTDIR}/$${file}" ] && [ -f \
|
|
|
|
"${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \
|
|
|
|
rm ${RM_I} "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" \
|
|
|
|
<&3; \
|
|
|
|
fi; \
|
|
|
|
done; \
|
2007-05-16 20:16:06 +00:00
|
|
|
done
|
2005-07-23 14:23:30 +00:00
|
|
|
@echo ">>> Old libraries removed"
|
|
|
|
|
|
|
|
check-old-libs:
|
|
|
|
@echo ">>> Checking for old libraries"
|
2013-11-03 07:31:54 +00:00
|
|
|
@cd ${.CURDIR}; \
|
|
|
|
${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
|
2011-04-01 20:59:23 +00:00
|
|
|
-V OLD_LIBS | xargs -n1 | \
|
|
|
|
while read file; do \
|
2007-05-16 08:37:40 +00:00
|
|
|
if [ -f "${DESTDIR}/$${file}" -o -L "${DESTDIR}/$${file}" ]; then \
|
2007-05-13 18:15:50 +00:00
|
|
|
echo "${DESTDIR}/$${file}"; \
|
|
|
|
fi; \
|
2013-10-24 11:35:50 +00:00
|
|
|
for ext in debug symbols; do \
|
|
|
|
if [ -f "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}" ]; then \
|
|
|
|
echo "${DESTDIR}${DEBUGDIR}/$${file}.$${ext}"; \
|
|
|
|
fi; \
|
|
|
|
done; \
|
2007-05-16 20:16:06 +00:00
|
|
|
done
|
2005-07-23 14:23:30 +00:00
|
|
|
|
|
|
|
delete-old-dirs:
|
|
|
|
@echo ">>> Removing old directories"
|
2013-11-03 07:31:54 +00:00
|
|
|
@cd ${.CURDIR}; \
|
|
|
|
${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
|
2013-10-01 22:53:27 +00:00
|
|
|
-V OLD_DIRS | xargs -n1 | sort -r | \
|
2011-04-01 20:59:23 +00:00
|
|
|
while read dir; do \
|
2007-05-16 08:37:40 +00:00
|
|
|
if [ -d "${DESTDIR}/$${dir}" ]; then \
|
|
|
|
rmdir -v "${DESTDIR}/$${dir}" || true; \
|
|
|
|
elif [ -L "${DESTDIR}/$${dir}" ]; then \
|
|
|
|
echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \
|
2006-02-18 16:58:21 +00:00
|
|
|
fi; \
|
2007-05-16 20:16:06 +00:00
|
|
|
done
|
2005-07-23 14:23:30 +00:00
|
|
|
@echo ">>> Old directories removed"
|
|
|
|
|
|
|
|
check-old-dirs:
|
|
|
|
@echo ">>> Checking for old directories"
|
2013-11-03 07:31:54 +00:00
|
|
|
@cd ${.CURDIR}; \
|
|
|
|
${MAKE} -f ${.CURDIR}/Makefile.inc1 ${.MAKEFLAGS} ${.TARGET} \
|
2011-04-01 20:59:23 +00:00
|
|
|
-V OLD_DIRS | xargs -n1 | \
|
|
|
|
while read dir; do \
|
2007-05-16 08:37:40 +00:00
|
|
|
if [ -d "${DESTDIR}/$${dir}" ]; then \
|
|
|
|
echo "${DESTDIR}/$${dir}"; \
|
|
|
|
elif [ -L "${DESTDIR}/$${dir}" ]; then \
|
|
|
|
echo "${DESTDIR}/$${dir} is a link, please remove everything manually."; \
|
2006-02-18 16:58:21 +00:00
|
|
|
fi; \
|
2007-05-16 20:16:06 +00:00
|
|
|
done
|
2005-07-23 14:23:30 +00:00
|
|
|
|
|
|
|
delete-old: delete-old-files delete-old-dirs
|
|
|
|
@echo "To remove old libraries run '${MAKE} delete-old-libs'."
|
|
|
|
|
|
|
|
check-old: check-old-files check-old-libs check-old-dirs
|
|
|
|
@echo "To remove old files and directories run '${MAKE} delete-old'."
|
|
|
|
@echo "To remove old libraries run '${MAKE} delete-old-libs'."
|
|
|
|
|
2005-07-30 18:02:20 +00:00
|
|
|
.endif
|
|
|
|
|
2006-03-18 14:30:23 +00:00
|
|
|
#
|
|
|
|
# showconfig - show build configuration.
|
|
|
|
#
|
|
|
|
showconfig:
|
2012-10-07 17:48:38 +00:00
|
|
|
@${MAKE} -n -f bsd.own.mk -V dummy -dg1 2>&1 | grep ^MK_ | sort
|
2009-03-13 07:23:58 +00:00
|
|
|
|
2011-02-11 02:37:47 +00:00
|
|
|
.if !empty(KRNLOBJDIR) && !empty(KERNCONF)
|
|
|
|
DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF}/
|
|
|
|
|
|
|
|
.if !defined(FDT_DTS_FILE) || empty(FDT_DTS_FILE)
|
|
|
|
.if exists(${KERNCONFDIR}/${KERNCONF})
|
|
|
|
FDT_DTS_FILE!= awk 'BEGIN {FS="="} /^makeoptions[[:space:]]+FDT_DTS_FILE/ {print $$2}' \
|
2014-05-11 20:44:58 +00:00
|
|
|
'${KERNCONFDIR}/${KERNCONF}' ; echo
|
2011-02-11 02:37:47 +00:00
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !defined(DTBOUTPUTPATH) || !exists(${DTBOUTPUTPATH})
|
|
|
|
DTBOUTPUTPATH= ${.CURDIR}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# Build 'standalone' Device Tree Blob
|
|
|
|
#
|
|
|
|
builddtb:
|
MFC r262626, r262626, r264979, r265154, r265162, r265163, r267319, r270863,
r270991, r271045:
Enhancements related to compiling FDT data...
- Use proper include path for dtc as well as cpp.
- Call cpp with -P to avoid printing line markings.
- Allow FDT_DTS_FILE to be a list, either in the makedtb target, or in a
kernel config file.
- Add the dts include directory to the -I list when doing arm builds.
- Invoke make_dtb with MACHINE defined for cross building friendliness.
- Allow the make_dtb script to work outside of a "make buildkernel"
context by setting MACHINE from uname -m if it's not set already.
- Use sh -c '...' to launch the dtb build scripts with env prepended,
otherwise it tries to treat the env var stuff as a script file name.
2014-10-27 00:47:55 +00:00
|
|
|
@PATH=${TMPPATH} MACHINE=${TARGET} \
|
2014-05-16 15:56:34 +00:00
|
|
|
${.CURDIR}/sys/tools/fdt/make_dtb.sh ${.CURDIR}/sys \
|
MFC r262626, r262626, r264979, r265154, r265162, r265163, r267319, r270863,
r270991, r271045:
Enhancements related to compiling FDT data...
- Use proper include path for dtc as well as cpp.
- Call cpp with -P to avoid printing line markings.
- Allow FDT_DTS_FILE to be a list, either in the makedtb target, or in a
kernel config file.
- Add the dts include directory to the -I list when doing arm builds.
- Invoke make_dtb with MACHINE defined for cross building friendliness.
- Allow the make_dtb script to work outside of a "make buildkernel"
context by setting MACHINE from uname -m if it's not set already.
- Use sh -c '...' to launch the dtb build scripts with env prepended,
otherwise it tries to treat the env var stuff as a script file name.
2014-10-27 00:47:55 +00:00
|
|
|
"${FDT_DTS_FILE}" ${DTBOUTPUTPATH}
|
2009-03-13 07:23:58 +00:00
|
|
|
|
|
|
|
###############
|
|
|
|
|
|
|
|
.if defined(XDEV) && defined(XDEV_ARCH)
|
|
|
|
|
2011-02-11 02:37:47 +00:00
|
|
|
.if ${XDEV} == ${MACHINE} && ${XDEV_ARCH} == ${MACHINE_ARCH}
|
|
|
|
XDEV_CPUTYPE?=${CPUTYPE}
|
|
|
|
.else
|
|
|
|
XDEV_CPUTYPE?=${TARGET_CPUTYPE}
|
|
|
|
.endif
|
|
|
|
|
2009-03-13 07:23:58 +00:00
|
|
|
NOFUN=-DNO_FSCHG -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT \
|
2011-11-29 19:46:17 +00:00
|
|
|
-DWITHOUT_MAN -DWITHOUT_NLS -DNO_PROFILE \
|
2014-02-13 19:46:48 +00:00
|
|
|
-DWITHOUT_KERBEROS -DWITHOUT_RESCUE -DNO_TESTS -DNO_WARNS \
|
2011-02-11 02:37:47 +00:00
|
|
|
TARGET=${XDEV} TARGET_ARCH=${XDEV_ARCH} \
|
|
|
|
CPUTYPE=${XDEV_CPUTYPE}
|
2011-02-11 04:03:39 +00:00
|
|
|
|
|
|
|
XDDIR=${XDEV_ARCH}-freebsd
|
2014-04-12 15:06:15 +00:00
|
|
|
XDTP?=/usr/${XDDIR}
|
|
|
|
.if ${XDTP:N/*}
|
|
|
|
.error XDTP variable should be an absolute path
|
|
|
|
.endif
|
|
|
|
|
2013-02-04 09:34:25 +00:00
|
|
|
CDBENV=MAKEOBJDIRPREFIX=${MAKEOBJDIRPREFIX}/${XDDIR} \
|
|
|
|
INSTALL="sh ${.CURDIR}/tools/install.sh"
|
2009-03-13 07:23:58 +00:00
|
|
|
CDENV= ${CDBENV} \
|
2013-03-31 08:54:04 +00:00
|
|
|
_SHLIBDIRPREFIX=${XDDESTDIR} \
|
2014-04-12 15:06:15 +00:00
|
|
|
TOOLS_PREFIX=${XDTP}
|
2013-03-31 08:54:04 +00:00
|
|
|
CD2CFLAGS=-isystem ${XDDESTDIR}/usr/include -L${XDDESTDIR}/usr/lib \
|
2014-04-12 15:06:15 +00:00
|
|
|
--sysroot=${XDDESTDIR}/ -B${XDDESTDIR}/usr/libexec \
|
|
|
|
-B${XDDESTDIR}/usr/bin -B${XDDESTDIR}/usr/lib
|
|
|
|
CD2ENV=${CDENV} CC="${CC} ${CD2CFLAGS}" CXX="${CXX} ${CD2CFLAGS}" \
|
|
|
|
CPP="${CPP} ${CD2CFLAGS}" \
|
2009-03-13 07:23:58 +00:00
|
|
|
MACHINE=${XDEV} MACHINE_ARCH=${XDEV_ARCH}
|
|
|
|
|
2013-03-31 08:31:06 +00:00
|
|
|
CDTMP= ${MAKEOBJDIRPREFIX}/${XDDIR}/${.CURDIR}/tmp
|
|
|
|
CDMAKE=${CDENV} PATH=${CDTMP}/usr/bin:${PATH} ${MAKE} ${NOFUN}
|
2013-12-13 17:00:25 +00:00
|
|
|
CD2MAKE=${CD2ENV} PATH=${CDTMP}/usr/bin:${XDDESTDIR}/usr/bin:${PATH} ${MAKE} ${NOFUN}
|
|
|
|
XDDESTDIR=${DESTDIR}/${XDTP}
|
2009-03-15 23:52:13 +00:00
|
|
|
.if !defined(OSREL)
|
|
|
|
OSREL!= uname -r | sed -e 's/[-(].*//'
|
|
|
|
.endif
|
2009-03-13 07:23:58 +00:00
|
|
|
|
|
|
|
.ORDER: xdev-build xdev-install
|
|
|
|
xdev: xdev-build xdev-install
|
|
|
|
|
2013-03-31 08:31:06 +00:00
|
|
|
.ORDER: _xb-worldtmp _xb-bootstrap-tools _xb-build-tools _xb-cross-tools
|
|
|
|
xdev-build: _xb-worldtmp _xb-bootstrap-tools _xb-build-tools _xb-cross-tools
|
|
|
|
|
|
|
|
_xb-worldtmp:
|
|
|
|
mkdir -p ${CDTMP}/usr
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
|
|
|
-p ${CDTMP}/usr >/dev/null
|
|
|
|
|
|
|
|
_xb-bootstrap-tools:
|
|
|
|
.for _tool in \
|
|
|
|
${_clang_tblgen}
|
|
|
|
${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \
|
2013-06-30 15:00:07 +00:00
|
|
|
cd ${.CURDIR}/${_tool} && \
|
|
|
|
${CDMAKE} DIRPRFX=${_tool}/ obj && \
|
|
|
|
${CDMAKE} DIRPRFX=${_tool}/ depend && \
|
|
|
|
${CDMAKE} DIRPRFX=${_tool}/ all && \
|
2013-03-31 08:31:06 +00:00
|
|
|
${CDMAKE} DIRPRFX=${_tool}/ DESTDIR=${CDTMP} install
|
|
|
|
.endfor
|
2009-03-13 07:23:58 +00:00
|
|
|
|
|
|
|
_xb-build-tools:
|
2011-02-11 04:03:39 +00:00
|
|
|
${_+_}@cd ${.CURDIR}; \
|
2009-03-13 07:23:58 +00:00
|
|
|
${CDBENV} ${MAKE} -f Makefile.inc1 ${NOFUN} build-tools
|
|
|
|
|
|
|
|
_xb-cross-tools:
|
|
|
|
.for _tool in \
|
2014-04-12 15:06:15 +00:00
|
|
|
${_binutils} \
|
2013-03-31 08:31:06 +00:00
|
|
|
usr.bin/ar \
|
|
|
|
${_clang_libs} \
|
2014-04-12 15:06:15 +00:00
|
|
|
${_clang} \
|
|
|
|
${_cc}
|
2009-03-13 07:23:58 +00:00
|
|
|
${_+_}@${ECHODIR} "===> xdev ${_tool} (obj,depend,all)"; \
|
2013-06-30 15:00:07 +00:00
|
|
|
cd ${.CURDIR}/${_tool} && \
|
|
|
|
${CDMAKE} DIRPRFX=${_tool}/ obj && \
|
|
|
|
${CDMAKE} DIRPRFX=${_tool}/ depend && \
|
2009-03-13 07:23:58 +00:00
|
|
|
${CDMAKE} DIRPRFX=${_tool}/ all
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
_xi-mtree:
|
|
|
|
${_+_}@${ECHODIR} "mtree populating ${XDDESTDIR}"
|
|
|
|
mkdir -p ${XDDESTDIR}
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.root.dist \
|
|
|
|
-p ${XDDESTDIR} >/dev/null
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.usr.dist \
|
|
|
|
-p ${XDDESTDIR}/usr >/dev/null
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.include.dist \
|
|
|
|
-p ${XDDESTDIR}/usr/include >/dev/null
|
2014-07-24 20:16:45 +00:00
|
|
|
.if ${MK_TESTS} != "no"
|
|
|
|
mtree -deU -f ${.CURDIR}/etc/mtree/BSD.tests.dist \
|
|
|
|
-p ${XDDESTDIR}/usr >/dev/null
|
|
|
|
.endif
|
2009-03-13 07:23:58 +00:00
|
|
|
|
2012-04-26 23:12:52 +00:00
|
|
|
.ORDER: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries _xi-links
|
|
|
|
xdev-install: xdev-build _xi-mtree _xi-cross-tools _xi-includes _xi-libraries _xi-links
|
2009-03-13 07:23:58 +00:00
|
|
|
|
|
|
|
_xi-cross-tools:
|
|
|
|
@echo "_xi-cross-tools"
|
|
|
|
.for _tool in \
|
2014-04-12 15:06:15 +00:00
|
|
|
${_binutils} \
|
2013-03-31 08:31:06 +00:00
|
|
|
usr.bin/ar \
|
2014-04-12 15:06:15 +00:00
|
|
|
${_clang_libs} \
|
|
|
|
${_clang} \
|
|
|
|
${_cc}
|
2009-03-13 07:23:58 +00:00
|
|
|
${_+_}@${ECHODIR} "===> xdev ${_tool} (install)"; \
|
|
|
|
cd ${.CURDIR}/${_tool}; \
|
|
|
|
${CDMAKE} DIRPRFX=${_tool}/ install DESTDIR=${XDDESTDIR}
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
_xi-includes:
|
|
|
|
${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 par-includes \
|
|
|
|
DESTDIR=${XDDESTDIR}
|
|
|
|
|
|
|
|
_xi-libraries:
|
|
|
|
${_+_}cd ${.CURDIR}; ${CD2MAKE} -f Makefile.inc1 libraries \
|
|
|
|
DESTDIR=${XDDESTDIR}
|
|
|
|
|
|
|
|
_xi-links:
|
|
|
|
${_+_}cd ${XDDESTDIR}/usr/bin; \
|
2013-12-13 17:00:25 +00:00
|
|
|
mkdir -p ../../../../usr/bin; \
|
2009-03-13 07:23:58 +00:00
|
|
|
for i in *; do \
|
|
|
|
ln -sf ../../${XDTP}/usr/bin/$$i \
|
|
|
|
../../../../usr/bin/${XDDIR}-$$i; \
|
|
|
|
ln -sf ../../${XDTP}/usr/bin/$$i \
|
|
|
|
../../../../usr/bin/${XDDIR}${OSREL}-$$i; \
|
|
|
|
done
|
2011-11-26 00:30:39 +00:00
|
|
|
.else
|
2013-03-27 15:03:18 +00:00
|
|
|
xdev xdev-build xdev-install:
|
2011-11-26 00:30:39 +00:00
|
|
|
@echo "*** Error: Both XDEV and XDEV_ARCH must be defined for \"${.TARGET}\" target"
|
2009-03-13 07:23:58 +00:00
|
|
|
.endif
|