Commit Graph

130 Commits

Author SHA1 Message Date
jmc bd789f7eba Add a change requested in PR#15548 and append the args passed to build.sh
into the comments in the make wrapper.
2004-07-02 04:25:24 +00:00
wiz 40726f5f0d Document -h. From Karsten Kruse in PR 25974. 2004-06-25 15:03:39 +00:00
cl 885c0b6fc9 ``build.sh -m xen-i386 release'' now builds a release for NetBSD/xen
for i386.  The resulting release consists of:
- NetBSD/xen for i386 kernel, loader and docuemntation
- NetBSD/i386 userland sets
2004-05-12 16:56:41 +00:00
lukem d0ca5ded84 Add
-x		set MKX11=yes
	-X x11src	set X11SRCDIR to x11src
2004-02-06 23:19:30 +00:00
lukem c77dab9416 highlight that the noisyless level is the MAKEVERBOSE level 2004-02-04 11:23:40 +00:00
lukem 1710dac7b6 tweak usage message.
when performing "sets", highlight that DESTDIR should be
pre-populated.  suggested by glen mccready.
2003-11-14 12:38:12 +00:00
lukem b60bb5a7dd Now that MKUPDATE and MKUNPRIVED are "normalized" with getmakevar(),
test with  "${MKxxx}" = "no"  instead of  -z "${MKxxx}"

Ignore errors when running pwd -P.  (GNU coreutils incorrectly complains)


Both problems pointed out in private email from Christian Limpach.
2003-11-12 15:51:45 +00:00
lukem f87ba55ff9 Always use `/bin/pwd -P` to get the "TOP" of the source tree, so that
MAKEOBJDIR (and other parameters) work correctly with symlinks, amd(8), etc.
Should fix PR [bin/23313], and possibly others.
2003-10-31 01:46:39 +00:00
lukem 301dd07e78 Explain why make is being rebuilt.
Patch from Hubert Feyrer in [toolchain/23156].
2003-10-26 03:12:21 +00:00
lukem 5daa33014e Improve how build.sh -N and MAKEVERBOSE interoperate;
rather than adding '-s' to make's command line in the makewrapper,
use the .SILENT target based on MAKEVERBOSE's value.

This means that you can do:
	./build.sh -N 1 makewrapper

	$TOOLDIR/bin/nbmake-$MACHINE
	#  runs at MAKEVERBOSE==1, with command lines suppressed

	$TOOLDIR/bin/nbmake-$MACHINE MAKEVERBOSE=2
	#  runs at MAKEVERBOSE==2 for this invocation, with command lines shown
2003-10-26 02:17:46 +00:00
lukem 371e58334b "Normalise" MKOBJDIRS MKUPDATE MKUNPRIVED with getmakevar() before
trying to use them internally to build.sh.
Fixes issue where build.sh would run "make cleandir" if MKUPDATE=yes was
set in mk.conf and -u wasn't given to build.sh.
2003-10-26 02:00:37 +00:00
lukem 070871b5fc Implement build -N noisy, which sets MAKEVERBOSE to noisy and adds
`-s' to MAKEFLAGS for noisy < 2.
2003-10-25 03:46:09 +00:00
matt daa035e3e8 Teach build.sh about the ibmnws port. 2003-10-19 03:37:36 +00:00
lukem e72c726f88 Revert part of previous commit and do NOT explicitly set BSDSRCDIR in the
makewrapper, as doing so can break various builds.

(Setting NETBSDSRCDIR isn't strictly necessary either, but AFAICT, it
shouldn't hurt)
2003-09-24 00:24:53 +00:00
jmmv 0de57ce6ff Set BSDSRCDIR and NETBSDSRCDIR in the make wrapper, so we always get the
right source directories (in case they are defined in mk.conf using '?=').
2003-09-20 10:14:41 +00:00
jmmv 2e336929ff Pass '-de' to make(1) to get the expected behavior ("failed target" and
"failed command" messages).
2003-09-10 18:05:52 +00:00
lukem 58cb3cd0a2 in getkernelconf(), remove check for non-empty $makeobjdir, as it's not
performed elsewhere in similar code, and causes problems if you run "kernel="
without an operation that performs "make obj" in sys/ beforehand.
2003-08-16 11:46:44 +00:00
jmc d9556f9ecc Fix 2 remaining places items are depending on execute permissions coming out
from a cvs checkout on scripts.
2003-08-11 19:26:04 +00:00
sommerfeld 22a1b1038e Improve usage for -U so others won't make the mistake I just made. 2003-08-10 16:20:37 +00:00
lukem 13b0ffec63 Add build.sh -Z var, to unset a variable and ensure it's unset in makewrapper.
For -M MAKEOBJDIRPREFIX, unset MAKEOBJDIR.
For -O MAKEOBJDIR, unset MAKEOBJDIRPREFIX.
2003-07-29 10:07:15 +00:00
lukem 1b9a8aed24 Add missing "cd ${TOP}" to buildtools(). Problem identified by John Nemeth
in private mail.

Remove some debugging messages that crept in a little while ago.
2003-07-28 12:33:42 +00:00
lukem 833a10cf56 * set & export LC_ALL=C, so that end-user use of non `C' LC_COLLATE locales
won't cause expressions such as `echo [0-9a-z]*` to match "CVS"
* add getmakeenv(var, value), and use appropriatly.
2003-07-20 09:26:49 +00:00
lukem 1553f8efd9 Replace UNPRIVED=yes with MKUNPRIVED=yes.
Replace UPDATE=yes with MKUPDATE=yes.
2003-07-18 08:30:07 +00:00
lukem f17ac45381 add "params" operation 2003-07-16 13:21:47 +00:00
lukem ccfdea7ffb Broaden the scope of when "make obj NOSUBDIR=" will be run in tools/
to be at any time that build.sh is run without -o, because we need
the objdir of the top-level to exist if build.sh is going to provide
a default DESTDIR/RELEASEDIR, and with the previous code, if
MAKEOBJDIRPREFIX was used and the objdir of the source tree didn't
exist, build.sh would incorrectly determine the DESTDIR.
(mmm, obscure bugs).
2003-05-26 06:35:17 +00:00
lukem 4e33a0f5d5 all:
*	add "releasekernel=conf", to install a gzipped copy of the kernels
	built by "kernel=conf" to RELEASEDIR/MACHINE/binary/kernel

build.sh:
    *	be more consistent in various status messages
    *	move the {release,}kernel=conf conf parsing code into getkernelconf()
	and use in both buildkernel() and releasekernel()
    *	only warn once when building multiple kernels without updating the tools
2003-05-25 12:34:27 +00:00
lukem 6019a973a8 * Display the start time again just before the end time, to make it
easier to work out how long things took.  Suggested by Alistair Crooks.
* Explicitly display the makewrapper path
2003-05-18 10:57:11 +00:00
lukem e128ff2fcf Change evbsh3 to be like evbmips, in that a default MACHINE_ARCH
won't be provided for a MACHINE of "evbsh3"; the user has to explicitly
use "evbsh3-eb" or "evbsh3-el"
2003-05-17 07:52:52 +00:00
lukem e3fa32ff73 * Display default DESTDIR & RELEASEDIR. (Well, they're actually in
the .OBJDIR of the top of the source tree, but expressing that in 1
  line or less starts to get complicated).   Requested by Hubert.
* When using a -el or -eb MACHINE "shortcut", use that original value
  as the MACHINE for the default makewrapper filename.  Requested by Simon.
2003-05-12 03:01:16 +00:00
lukem 8bced05906 * Add support for MACHINEs: evbmips-eb evbmips-el sbmips-eb sbmips-el
which sets the appropriate MACHINE_ARCH and rewrites MACHINE to lose
  the -e[bl] suffix.
* Don't default to a MACHINE_ARCH for evbmips or sbmips.

Per discussion wth Simon Burge.
2003-05-12 02:33:17 +00:00
lukem b7d3d22051 Add "sourcesets" argument/target, which builds source sets into
RELEASEDIR/source/sets
2003-05-10 07:12:37 +00:00
lukem 9ca2699e2b When providing a default DESTDIR & RELEASEDIR in non-expert mode, add
these to makeenv so that the generated makewrapper contains these settings...
2003-05-09 09:10:06 +00:00
lukem ad89cbfee9 New features:
*	If not expert mode, provide defaults for:
		DESTDIR		/top/of/obj/destdir.${MACHINE}
		RELEASEDIR	/top/of/obj/releasedir
    *	Collate the various status messages output during the run
	and display them at the end in a "summary report".
    *	Cross-check the validity of MACHINE against MACHINE_ARCH.
	Fixes PR [toolchain/20193] from David Maxwell.
    *	Highlight that the tools will be rebuilt if UPDATE isn't set.
    *	Add stronger language recommending against -E unless you
    *	Improve whitespace use in usage()

Code stuff:
    *	Be consistent about using "${var}"
    *	Be more consistent how [ tests ] are run
    *	Improve some comments
    *	Rename getmakevar() to raw_getmakevar()
    *	Rename safe_getmakevar() to getmakevar()
    *	cd back to ${TOP} after a kernel build.
    *	Always keep the tmpdir around for the build (it's where the
	status messages are collated, for one).
2003-05-08 14:19:39 +00:00
christos 985fd8014b CYGWIN needs -X too (John Gordon) 2003-05-08 12:49:45 +00:00
fvdl 796c8a1016 Adapt for x86_64 -> amd64 rename. 2003-04-26 18:42:34 +00:00
thorpej d2809fcf8a Put -X into MAKEFLAGS on FreeBSD and Mac OS X; they have a small ARG_MAX. 2003-03-14 05:22:50 +00:00
lukem ea64374119 remove unnecessary message 2003-03-07 01:22:16 +00:00
lukem cfcaeea176 don't print the command & start time until after the options are parsed... 2003-03-04 02:20:28 +00:00
lukem bfc98ff079 Display the build.sh command line and the start & end times.
Based on suggestion from Andrew Brown <atatat@netbsd.org>.
2003-02-18 23:59:06 +00:00
lukem 9fd6e49e07 Enhance "kernel=" to print pathnames of newly built kernels for cut & paste.
(Previously we just printed the build directory.)
2003-02-16 04:35:03 +00:00
enami 561033c00e Consistently, don't expand ${MACHINE} in help message. 2003-02-06 22:19:06 +00:00
lukem e6d083f5b9 another DESTDIR clarification 2003-01-31 01:38:35 +00:00
lukem 1f9a9dde05 add missing usage for "sets" 2003-01-26 13:12:05 +00:00
lukem 4e91f80fa2 - Add "sets" top-level Makefile target and build.sh operation.
[Latter suggested by Julio Merino in private email]
- Add "help" build.sh operation.
2003-01-26 06:19:12 +00:00
lukem 46d44d89e9 Change build.sh so that at least one operation is required.
Add "makewrapper" operation to build.sh.
	[The above changes were suggested by Alan Barrett on current-users@]

Fail if building as non-root unless: UNPRIVED is set, -U is given, or -E
(expert mode) is given.
	[Suggested by James Wetterau in private email]

Improve the examples in BUILDING.
2003-01-26 05:34:32 +00:00
lukem f643db1c84 Can't check if cross building with "install=" until after $MACHINE has
been validated.  Noted by Anthony Mallet on current-users@
2003-01-24 01:17:52 +00:00
lukem 31b7057f61 Rework how build.sh functions, so that command line options set various
parameters, and a list of "operations" defines what to do.
The full usage is show below.  Notes:
	`-b' has been deprecated (it always occurs now)
	`-d' is replaced by "distribution"
	`-R rel' onlys sets RELEASEDIR; use "release" to build a release
	`-k kern' has been replaced by "kernel=kern"
	`-i idir' has been replaced by "install=idir"
	-r now occurs before nbmake is rebuilt

Add a copyright (long due!).  Rework the code to (a KNF inspired) ShellNF.
Use functions appropriately.  Allow `nb' prefix to be easily changed to
something else.  Solve world peace (just kidding)

This is part of the (never achievable) goal of attempting to make
NetBSD easier to build...


  --8<--  new usage follows  --8<--

Usage: build.sh [-EnorUu] [-a arch] [-B buildid] [-D dest] [-j njob] [-M obj]
		[-m mach] [-O obj] [-R release] [-T tools] [-V var=[value]]
		[-w wrapper]   [operation [...] ]

 System build operations (all imply "obj" and "tools"):
    build		Run "make build"
    distribution	Run "make distribution" (includes etc/ files)
    release		Run "make release" (includes kernels & distrib media)

 Other operations:
    obj			Run "make obj" (default unless -o)
    tools 		Build and install tools
    kernel=conf		Build kernel with config file `conf'
    install=idir	Run "make installworld" to `idir'
			(useful after 'distribution' or 'release')

 Options:
    -a arch	Set MACHINE_ARCH to arch (otherwise deduced from MACHINE)
    -B buildId	Set BUILDID to buildId
    -D dest	Set DESTDIR to dest
    -E		Set "expert" mode; disables some DESTDIR checks
    -j njob	Run up to njob jobs in parallel; see make(1)
    -M obj	Set obj root directory to obj (sets MAKEOBJDIRPREFIX)
    -m mach	Set MACHINE to mach (not required if NetBSD native)
    -n		Show commands that would be executed, but do not execute them
    -O obj	Set obj root directory to obj (sets a MAKEOBJDIR pattern)
    -o		Set MKOBJDIRS=no (do not create objdirs at start of build)
    -R release	Set RELEASEDIR to release
    -r		Remove contents of TOOLDIR and DESTDIR before building
    -T tools	Set TOOLDIR to tools.  If unset, and TOOLDIR is not set in
		the environment, nbmake will be (re)built unconditionally.
    -U		Set UNPRIVED
    -u		Set UPDATE
    -V v=[val]	Set variable `v' to `val'
    -w wrapper	Create nbmake script as wrapper
		(default: ${TOOLDIR}/bin/nbmake-${MACHINE})
2003-01-23 16:24:08 +00:00
lukem 6bbdc41e7b reorder usage so that "mutually exclusive build" operations are listed
separately from "set variable" operations, in an attempt to make
build.sh easier to use
2003-01-22 11:26:11 +00:00
lukem 001300d84b Improvements from Alan Barrett (in private email), with minor tweaking:
(Thanks Alan!)

* Before attempting to use KERNOBJDIR, we now need to "make obj" in
  ${KERNSRCDIR}/${KERNARCHDIR}/compile, not in ${TOP}/etc as used to be
  the case.

* Fix one place where getmakevar was invoked unconditionally.  It needs
  to be conditional on $runcmd != "echo", so that we can rely on the
  existence of the new $make executable.

* Add a sanity check to getmakevar, to bomb if a similar error is
  introduced in the future.

* Changed the bomb function to print to stderr instead of to stdout, and
  to kill the top level shell process.  Without this, an attempted bomb
  from inside getmakevar did not work properly.

* Moved some duplicated code into a new safe_getmakevar function, which
  calls getmakevar if that is safe, or else emits a literal '$' followed
  by the variable name.


Improvements from me:

* Always 'trap "exit 1" 1 2 3 15', so the kill in bomb() doesn't cause ugly
  output.
2003-01-15 01:49:03 +00:00
lukem cc3d03cf30 improve usage 2003-01-04 14:55:44 +00:00