Upgrading build system to new NetBSD revision

The tested targets are the followgin ones:
 * tools
 * distribution
 * sets
 * release

The remaining NetBSD targets have not been disabled nor tested
*at all*. Try them at your own risk, they may reboot the earth.

For all compliant Makefiles, objects and generated files are put in
MAKEOBJDIR, which means you can now keep objects between two branch
switching. Same for DESTDIR, please refer to build.sh options.

Regarding new or modifications of Makefiles a few things:
 * Read share/mk/bsd.README
 * If you add a subdirectory, add a Makefile in it, and have it called
   by the parent through the SUBDIR variable.
 * Do not add arbitrary inclusion which crosses to another branch of
   the hierarchy; If you can't do without it, put a comment on why.
   If possible, do not use inclusion at all.
 * Use as much as possible the infrastructure, it is here to make
   life easier, do not fight it.

Sets and package are now used to track files.
We have one set called "minix", composed of one package called "minix-sys"
This commit is contained in:
2012-09-12 09:37:05 +02:00
parent bdb3f57135
commit 9152e1c5a7
609 changed files with 113178 additions and 1553 deletions

View File

@@ -1,5 +1,5 @@
#! /usr/bin/env sh
# $NetBSD: build.sh,v 1.254 2012/02/26 20:32:40 tsutsui Exp $
# $NetBSD: build.sh,v 1.255 2012/08/05 04:39:09 matt Exp $
#
# Copyright (c) 2001-2011 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -554,6 +554,14 @@ getarch()
#
case "${MACHINE}" in
evbearm-e[bl])
makewrappermachine=${MACHINE}
# MACHINE_ARCH is "arm" or "armeb", not "armel"
MACHINE_ARCH=earm${MACHINE##*-}
MACHINE_ARCH=${MACHINE_ARCH%el}
MACHINE=evbarm
;;
evbarm-e[bl])
makewrappermachine=${MACHINE}
# MACHINE_ARCH is "arm" or "armeb", not "armel"
@@ -658,6 +666,11 @@ getarch()
MACHINE_ARCH=${MACHINE}
;;
i[4-6]86)
MACHINE=i386
MACHINE_ARCH=i386
;;
*)
bomb "Unknown target MACHINE: ${MACHINE}"
;;
@@ -671,7 +684,7 @@ validatearch()
#
case "${MACHINE_ARCH}" in
alpha|arm|armeb|hppa|i386|m68000|m68k|mipse[bl]|mips64e[bl]|powerpc|powerpc64|sh3e[bl]|sparc|sparc64|vax|x86_64|ia64)
alpha|arm|armeb|earm|earmeb|hppa|i386|m68000|m68k|mipse[bl]|mips64e[bl]|powerpc|powerpc64|sh3e[bl]|sparc|sparc64|vax|x86_64|ia64)
;;
"")
@@ -689,7 +702,11 @@ validatearch()
case "${MACHINE}" in
evbarm)
arches="arm armeb"
arches="arm armeb earm earmeb"
;;
cats|iyonix|netwinder|shark|zaurus)
arches="arm earm"
;;
algor|arc|cobalt|pmax)
@@ -1196,8 +1213,7 @@ parseoptions()
[ -z "${BUILDID}" ] || makeenv="${makeenv} BUILDID"
MAKEFLAGS="-de -m ${TOP}/share/mk ${MAKEFLAGS}"
MAKEFLAGS="${MAKEFLAGS} MKOBJDIRS=${MKOBJDIRS-yes}"
BUILDSH=1
export MAKEFLAGS MACHINE MACHINE_ARCH BUILDSH
export MAKEFLAGS MACHINE MACHINE_ARCH
}
# sanitycheck --
@@ -1521,7 +1537,7 @@ validatemakeparams()
if [ -z "${DESTDIR}" ] || [ "${DESTDIR}" = "/" ]; then
if ${do_build} || ${do_distribution} || ${do_release}; then
if ! ${do_build} || \
[ "${uname_s}" != "NetBSD" ] || \
[ "${uname_s}" != "Minix" ] || \
[ "${uname_m}" != "${MACHINE}" ]; then
bomb "DESTDIR must != / for cross builds, or ${progname} 'distribution' or 'release'."
fi
@@ -1657,7 +1673,7 @@ createmakewrapper()
eval cat <<EOF ${makewrapout}
#! ${HOST_SH}
# Set proper variables to allow easy "make" building of a NetBSD subtree.
# Generated from: \$NetBSD: build.sh,v 1.254 2012/02/26 20:32:40 tsutsui Exp $
# Generated from: \$NetBSD: build.sh,v 1.255 2012/08/05 04:39:09 matt Exp $
# with these arguments: ${_args}
#
@@ -1700,10 +1716,10 @@ make_in_dir()
buildtools()
{
# if [ "${MKOBJDIRS}" != "no" ]; then
# ${runcmd} "${makewrapper}" ${parallel} obj-tools ||
# bomb "Failed to make obj-tools"
# fi
if [ "${MKOBJDIRS}" != "no" ]; then
${runcmd} "${makewrapper}" ${parallel} obj-tools ||
bomb "Failed to make obj-tools"
fi
if [ "${MKUPDATE}" = "no" ]; then
make_in_dir tools cleandir
fi
@@ -2014,7 +2030,7 @@ main()
installmodules=*)
arg=${op#*=}
if [ "${arg}" = "/" ] && \
( [ "${uname_s}" != "NetBSD" ] || \
( [ "${uname_s}" != "Minix" ] || \
[ "${uname_m}" != "${MACHINE}" ] ); then
bomb "'${op}' must != / for cross builds."
fi
@@ -2024,7 +2040,7 @@ main()
install=*)
arg=${op#*=}
if [ "${arg}" = "/" ] && \
( [ "${uname_s}" != "NetBSD" ] || \
( [ "${uname_s}" != "Minix" ] || \
[ "${uname_m}" != "${MACHINE}" ] ); then
bomb "'${op}' must != / for cross builds."
fi