Commit Graph

229 Commits

Author SHA1 Message Date
jmc b24c81ca0c Make sure the makes running before the make build rule include
-m <top dir>/share/mk
2001-12-03 08:18:00 +00:00
thorpej a3c473186e - Define MAKE_MACHINE reasonably for the bootstrap make.
- Don't unset IFS; some shells don't like that.  Instead save, and
  restore IFS.
2001-11-30 02:18:13 +00:00
jmc df406df953 If using objdirs make sure the objdir root is made before starting the build.
Otherwise problems with bsd.own.mk and _SRC_TOP_OBJ can result.
2001-11-26 05:57:33 +00:00
thorpej 9b19c5d978 Add a "-d" option that uses the "distribution" target, rather than
the "build" target.
2001-11-25 18:35:06 +00:00
thorpej 9f11f1b5b4 If using -t, do a "cleandir" before building/installing the
tools.  This is something the old "build" hack used to do.
2001-11-15 00:14:35 +00:00
tv 8db91a3669 Revert part of rev. 1.20 -- $DESTDIR and $TOOLDIR are deliberately shown
symbolically with "-n", as these may come from mk.conf after building the
bootstrap make.  Add a comment to that effect.
2001-11-13 19:03:08 +00:00
tv b5cd2489b2 Major overhaul of src/tools and host toolchain. Summary of changes:
* Rewrite src/tools Make logic to work like the rest of the tree wrt
  "dependall" and "install".  The old "make build" hack is gone.

* Remove the MKTOOLS logic.  This was linked to the "make build" hack,
  and was only needed because TOOLDIR originally had no writable default.

* Redo the GNU configure/make logic to make it fit reasonably in a
  BSD make wrapper.  Use new ${.ALLTARGETS} variable to scan for
  targets in $(srcdir), and mark them with .MADE: to prevent rebuilding.

* Only build cross tools in src/tools; remove some messy logic in
  src/usr.* and src/gnu/usr.* that would do target filename rewriting
  (improves consistency and readability).

* Add the ability to build cross gdb at tool build time by setting
  MKCROSSGDB (default no) to "yes" in mk.conf.

* Add src/tools/groff and set up paths to work with this cross groff.
2001-11-12 23:16:17 +00:00
msaitoh 7e478326bd change MACHINE_ARCH of evbsh3 from sh3el to sh3eb because all config files
for evbsh3 defaults to big endian.
2001-11-12 08:54:58 +00:00
jmc a1ae34bc72 Always rebuild the nbmake wrapper script. Otherwise the options passed to
build.sh just get lost if they differ from a previous invocation (i.e. letting
MKOBJDIRS get set the first time, -o will get ignored after this unless a
rebuild of the script happens). It's low overhead so this adds little burden
to getting it right.
2001-11-11 01:34:30 +00:00
thorpej 3b569c7be3 * Fix a quoting error so that when using -n, we actually see
$TOOLDIR and $DESTDIR in their expanded form.
* Set USETOOLS=yes in the make wrapper script; it's pretty pointless
  using the make wrapper unless you're using the host tools.
* In the -t case, make sure to only echo the "make obj" command if -n.
2001-11-09 04:14:17 +00:00
dillo c5b59dd31e export DESTDIR when set via -D. 2001-11-05 02:17:47 +00:00
tv 472dcba2fb * Always use the makewrapper when starting a build phase.
* Set stuff mostly in the environment, not on make(1)'s command line.
  This is needed for MACHINE and MACHINE_ARCH (noted by bjh21), and keeps
  the mk.conf-overriding-env behavior (suggested by several people).

* Use MAKEFLAGS to make the wrapper script more readable.

* When prepping objdir in tools for the default TOOLDIR value, just make
  that objdir; leave the recursive "make obj" for later.
2001-11-02 05:07:22 +00:00
thorpej a4a68fe775 When doing an only-tools build, don't use the makewrapper. 2001-11-01 01:49:44 +00:00
thorpej f55ffb9482 Add a -t option that builds and installs the toolchain only
(and thus implies -b).  To make this work, we also check do_buildsystem
when doing the DESTDIR sanity check.
2001-11-01 00:14:17 +00:00
tv dadd6e7370 Major cleanup and overhaul:
* Allow MACHINE to be set automatically on NetBSD native builds.
  Require -m only if the host is not NetBSD.

* Fail if DESTDIR is set to root (/) and the build is not NetBSD native,
  or the build is attempting a "make release" (option -R).

* Warn the user if DESTDIR is set to root (/) that the kernel must be up
  to date, or else the build might hose the system.  Also, do not remove
  DESTDIR on -r if it is set to root.

* Fail if TOOLDIR is set to / or empty after checking with nbmake.

* Allow DESTDIR and TOOLDIR to be set in mk.conf and/or by the new default
  from <bsd.own.mk>.  Note that if -T is not used to set TOOLDIR, and
  TOOLDIR is not set in the environment, then nbmake will always be
  bootstrapped (rather than looking at nbmake's timestamp).  This is
  because /bin/sh doesn't know how to get TOOLDIR from mk.conf without
  first having nbmake (...which lives in TOOLDIR).

* Do a pass of "make obj" through src/tools before installing nbmake (so
  long as -o/MKOBJDIRS=no is not specified).  This ensures that objdirs
  exist if they are desired, and paves the way for using build.sh to
  build all the src/tools without building everything else.

* Add "-w" option, which allows the builder to specify where the nbmake
  wrapper shell script should be created.  If not specified,
  $TOOLDIR/bin/nbmake-$MACHINE is still created as a default.

* Print the values of DESTDIR and TOOLDIR after bootstrapping nbmake,
  for informational purposes.

It should now be possible to type just "./build.sh" on a NetBSD-current
host and get a new build in / for the appropriate architecture.
However, building in-place like this has *not* been extensively tested
yet, so be careful.
2001-10-31 19:59:43 +00:00
jmc a6ddeb5145 Add a sanity check. Don't rm -rf / if TOOLDIR or DESTDIR got set to / and -r
was an option
2001-10-31 18:23:55 +00:00
reinoud a7b1e2f4a6 Rollback 2001-10-31 13:12:35 +00:00
tv 7636e93f41 * Fix brokenness created by the -n option additions ("eval" still kept
quoting, so the commands were thought to be one big word with embedded
  whitespace)

* New options:
  -O obj    Set root of an obj tree; sets MAKEOBJDIR to an appropriate
            substitution pattern.
  -o        Sets MKOBJDIRS=no (otherwise sets MKOBJDIRS=yes)
  -u        Sets UPDATE
2001-10-31 01:56:10 +00:00
reinoud 3d76fbc53f Acorn's MACHINE_ARFCH is now arm, not arm32 ... moving it effectively to
ELF (Yay!)
2001-10-31 00:08:03 +00:00
tv 732cb3a230 * Clean up a bit; always use [] for comparison tests.
* Don't require DESTDIR when -b is set.

* Add -n option, which prints the commands that would be run by build.sh,
  but doesn't run them (much like make's -n option).

* Auto-resolve relative paths for -D, -R, and -T (but not for the
  corresponding environment variables).

* Explicitly declare defaults of all shell variables used where feasible,
  rather than sprinkling ${varname-value} expansions.

* Prefix shell true/false variables with "do_" to indicate their use as
  actual values in shell expressions (like "$do_buildsystem && echo foo").
2001-10-30 22:33:00 +00:00
jmc ac3e0f6b6c Add -b option. Bootstrap only. i.e. build and install nbmake and then exit 2001-10-30 21:04:05 +00:00
tv 3ae57da833 Set TOOLDIR in the nbmake-MACHINE wrapper script. 2001-10-29 19:47:51 +00:00
matt 0c7ce20cc8 Netwinder's MACHINE_ARCH is arm, not arm32 2001-10-26 23:25:03 +00:00
bjh21 5b191935e3 Re-instate MACHINE -> MACHINE_ARCH entry for arm26, which I left out of the
last change.
2001-10-24 14:55:09 +00:00
bjh21 ad870d54a0 Sync the MACHINE -> MACHINE_ARCH mapping for ARM platforms with
sys/arch/*/param.h.  While not necessarily correct, param.h is at least
definitively incorrect.
2001-10-24 14:00:24 +00:00
tv e7f296218e - Supply full list of MACHINEs for implicit MACHINE_ARCH evaluation.
If a machine is not known, abort.

- Emulate "mkdir -p" for Old "mkdir" programs on some host OS's.

- Add "-a" option to provide MACHINE_ARCH explicitly (for MACHINEs
  that are capable of having more than one MACHINE_ARCH, such as sh3
  and sparc64)

- Where "getopts" is not available in the shell, try using "getopt".
  It's not whitespace compatible, but works in most cases.

- Rename "bmake" to "nbmake" per suggestions.

- When building nbmake, create a temporary directory for the purpose
  of holding host compiler objects that might be created in the cwd.
  Delete this directory if aborted via sh's "trap".

- Create a wrapper script in $TOOLDIR/bin called "nbmake-$MACHINE",
  which can be run by hand for building parts of a cross tree easily.
  Use this script when finally starting the build.
2001-10-24 02:39:56 +00:00
tv 2c014f233f Move mkdir of TOOLDIR/bin to after removing TOOLDIR as specified by -r.
Add -R option to specify RELEASEDIR directory and flag using "make release"
instead of "make build" (inverted logic from removed -n option).
2001-10-19 16:43:47 +00:00
tv 79069d719a Add error handling to bmake build, and add "-j" option to set NBUILDJOBS. 2001-10-19 02:25:48 +00:00
tv 41334a362b Script to automate bootstrapping a build on any host platform. Creates
a bmake (rebuilds, if necessary) and invokes that to start the build.
2001-10-19 02:21:03 +00:00