Commit Graph

315 Commits

Author SHA1 Message Date
Ruslan Ermilov
83c7ade90a NOSHARED -> NO_SHARED 2004-12-21 09:59:45 +00:00
Ruslan Ermilov
e653b48c80 Start the dreaded NOFOO -> NO_FOO conversion.
OK'ed by:	core
2004-12-21 08:47:35 +00:00
Ruslan Ermilov
e9bddef1f0 Previous revision didn't fix all cases. For example,
testing for variables that are always defined (e.g.,
"make -V CC") would still print a false warning.  Fix
this by only passing a submake the MAKEOBJDIRPREFIX=*
argument if it was present.  As a result, we loose
the check for -DMAKEOBJDIRPREFIX, or an esoteric
"MAKEOBJDIRPREFIX = foo" (with embedded spaces), but
these are unorthodox enough to not care about them.

The make(1) bug mentioned in the previous revision
was just fixed in make/main.c,v 1.109.
2004-12-16 19:55:57 +00:00
Marcel Moolenaar
26e8ef3fe8 Unbreak the MAKEOBJDIRPREFIX variable check by avoiding bugs in make(1).
When make flags are passed to make in the environment, the string is
chopped up in an (argc,argv) vector. This happens in brk_string() and
the chopped up string is stored in static buffer. When this includes
something like "-V BINMAKE", then a pointer into the static buffer is
put on the variables list for evaluation later. However, brk_string()
is used for more than just chopping up the MAKEFLAGS env. variable, so
it's very likely that the static buffer is clobbered. In fact, this is
exactly what happens.
The result is that _MAKEOBJDIRPREFIX gets assigned whatever garbage
the child make happens to emit, causing the test to fail. Like this:

pluto2% cd /usr/src
pluto2% make -V BINMAKE
"/q/6.x/src/Makefile", line 94: MAKEOBJDIRPREFIX can only be set in environment, not as a global (in /etc/make.conf) or command-line variable.
pluto2% make -dv -V BINMAKE | & grep _MAKEOBJDIRPREFIX
Global:_MAKEOBJDIRPREFIX = }

The fix is to not use MAKEFLAGS for this, but simple pass the flags
as arguments. Ideally make(1) should be fixed but that's beyond the
scope of my attention span.

This fixes release.
2004-12-13 00:49:52 +00:00
Hartmut Brandt
89f087e8dd Fix builds with a read-only directory and a make upgrade. This is done
by forcing the creation of an object directory for the make regression
tests. Let make handle the tracking of the dependency and installation
of test_shell script.

Submitted by:	ru
2004-12-07 14:41:16 +00:00
Peter Wemm
1d9468ee37 Convert tools/lib32/build.sh into world connectable hooks. This still
rates pretty high on the "hack!" scale, but it works for me.  Adding
-DWANT_LIB32 to the world build command line, or 'WANT_LIB32=yes' to
/etc/make.conf will include the 32 bit libraries with the build.

I have not made this default behavior.  Cross compiling this stuff is an
adventure I have not investigated.

This is still a WIP.  We needed this at work so that we could install from
a readonly obj tree - lib32/build.sh wasn't up to that.
2004-11-06 03:14:26 +00:00
Ruslan Ermilov
588dbe0aa0 Fixed MAKEOBJDIRPREFIX variable type check in case the env(1)
binary is not in PATH, as is the case with installworld, etc.
2004-10-18 17:47:31 +00:00
Ruslan Ermilov
d18c990625 My take at improving the universe: allow the worlds to be
built in parallel.  Examples:

make universe
	Build worlds sequentially, each world sequentially.

make universe JFLAG=-j4
	Build worlds sequentially, each world in parallel.

make -j4 universe
make -j4 universe JFLAG=-j2
	Build four worlds in parallel, each world will be
	built in parallel too.  World parallelization is
	set to four in the first synopsis, and to two in
	the second.

make -j4 universe JFLAG=-B
	Build worlds in parallel, each world sequentially.

("world" == buildworld followed by buildkernels.)

Prayers:	obrien, phk
2004-08-18 07:17:01 +00:00
Ruslan Ermilov
0ec443a080 Moved the MAKEOBJDIRPREFIX check from Makefile.inc1 to Makefile,
to suppress warnings with installworld and distributeworld when
env(1) cannot be found in the PATH.
2004-08-18 06:49:56 +00:00
Hartmut Brandt
088cf0fb43 Make make recurse into sub-directories and sub-makes when given
two -n flags.  If only one -n flag is given the old behaviour
is retained (POLA).  In order to make this working for installworld
change the IMAKEENV in this case so that the tools are found
(we have no temporary installation environment in this case).

Submitted by:	ru (IMAKEENV part)
2004-08-09 11:38:41 +00:00
Ken Smith
1f6483e4df The doc team reworked the section of the handbook describing how to
rebuild things, further discouraging 'make world'.  The title of
that section is now changed...
2004-07-23 21:21:34 +00:00
Mark Murray
954c5b4392 Rename a preposterously long name with one that might look a bit
more professional. While here, write a few lines of explanatory
text to explain what its for.

Discussed with:	rwatson
With hat:	core
2004-07-18 18:55:31 +00:00
David E. O'Brien
96c370ccf5 Add an "out" to the now required BS of defining DESTDIR. 2004-07-18 01:19:33 +00:00
Marcel Moolenaar
44f4ffe202 Properly terminate a quoted string in the previous commit. Oddly
enough this only seems to cause problems with -jX so went unnoticed
until now.
2004-07-17 20:57:37 +00:00
Marcel Moolenaar
0a9458250a As per discussions on current@, protect unsuspecting users from
trying to upgrade their system with make world instead of following
the preferred and suggested sequence of commands. The fact remains
that make world does not upgrade the kernel.
Allow make world when DESTDIR has been specified, including when
DESTDIR specifies the root file system. Otherwise, print a useful
warning and fail.

Reviewed, tested and scrutinized by: gad@
2004-07-16 02:51:28 +00:00
Poul-Henning Kamp
0d4e175d2e Add a JFLAG which can be used to speed up universe:
make universe JFLAG=-j12
2004-07-09 13:55:50 +00:00
Dag-Erling Smørgrav
43fc676240 Add a kernel-toolchain target which only builds the bits required to build
a kernel.  This is essentially the same as the toolchain target, except
that it does not build headers and libraries.

Submitted by:	ru
2004-04-13 13:42:01 +00:00
Ruslan Ermilov
839274c75b Added the `toolchain' top-level target, which builds enough of
buildworld, up to and including libraries, except for actually
building the world.

Requested by:	many
2004-03-24 08:26:22 +00:00
Ruslan Ermilov
6e14763e7d Protect shell expansions. 2004-03-02 14:32:23 +00:00
Johan Karlsson
506f4c06ae Add amd64 to universe.
Approved by:	peter
2004-02-29 13:07:05 +00:00
Garance A Drosehn
224f069870 Change the 'realclean' target name to be 'cleanworld', to match other
targets like buildworld, installworld.

Suggested by:	obrien
2004-02-20 02:10:35 +00:00
Garance A Drosehn
1a974787f9 Improvements on the 'make realclean' target. Some are style improvements,
but the biggest issue is that there are situatons when
${.OBJDIR} == ${.SRCDIR}, and in those situations the previous version
would happily remove all your /usr/src while it was cleaning out the objects.
Not that *you* would be happy about it...  Thanks to bde for immediately
noticing this serious possibility.

More improvements will be made to this target, but I wanted to commit this
safer version right now, before anyone lost their /usr/src due to it.

Reviewed by:	bde
MFC after:	10 days
2004-02-19 21:09:58 +00:00
Garance A Drosehn
2047c5d32e Add a 'realclean' target, which simply and quickly removes everything
that was built in previous 'make buildworld' and 'make buildkernel'.  The
target knows enough to run a 'chflags -R 0' and a second 'rm' if the first
'rm' ran into any errors while removing files.

Suggested by:	email with Richard Coleman Re: upcoming 64b-time_t changes.
Reviewed by:	imp, marcel, and others on -hackers
MFC after:	1 week
2004-02-16 20:18:25 +00:00
Peter Wemm
ef7af95abd Put on some factor 30+ bikeshed repellent and export the internal
Makefile.inc1 underscore targets with a big warning that they are
intentionally undocumented, subject to change without notice and
might poison your dog etc.  If you don't know what they are, then they
are not meant for you to use.

I've added these by hand to so many many trees that I've lost count.  I
find them rather useful.
2003-12-09 02:08:19 +00:00
Kris Kennaway
2a6e9f885c Don't allow the 'make' target (which rebuilds make for bootstrapping)
to become confused by a file called 'make' in /usr/src

Submitted by:	ru
2003-11-07 08:36:55 +00:00
Ruslan Ermilov
829340b175 Retired the "most" and "installmost" targets -- they just
do not have a chance to work nowadays as we have a lot of
internal libraries in lib/.

Discussed with:	marcel, wollman
2003-10-04 18:53:38 +00:00
Ruslan Ermilov
b797df80b9 Cosmetics: folded BITGTS into TGTS. 2003-08-30 13:33:41 +00:00
Marcel Moolenaar
d911f786ab Limit testing for an up-to-date version of make(1) to the world and
buildworld targets by default, but allow it to be done for all user
targets by introducing a boolean option, named ALWAYS_CHECK_MAKE.

This change is by no means perfect and I don't even want to claim
this to be a solution. It does however address the fact that not
everybody likes to see make(1) rebuilt simply because the regression
test failed for some reason or other, including pilot error. It
therefore serves the purpose of keeping the crowd happy until we
have something better or simply reached a compromise.

The reasons for changing the default behaviour are:
o  It avoids a negative, possibly non-intuitive option,
o  It's according to POLA and fond of feet,
o  Only buildworld is documented to do its best to be
   successful at reasonably cost.

Reviewed by: gad, imp, obrien, peter
2003-08-28 04:03:13 +00:00
Ruslan Ermilov
5ab778118b - Don't print "elf" before printing "make world" (aout support has been
removed).

- Avoid using printf(1) where a simple shell's built-in echo is enough.
2003-08-06 11:06:38 +00:00
Ruslan Ermilov
9d1086a65b The `mk' target is long dead. 2003-07-20 12:38:29 +00:00
Ruslan Ermilov
ef2c779bf9 Use an up-to-date make binary in the upgrade_checks target if
one is already available.  This avoids sometimes unnecessary
step of attempting to rebuild the make binary again which may
fail at all if, for example, one has removed his /usr/include
before doing an installworld (to keep /usr/include tidied up).

Pointed out by:	kris, marcel
2003-07-19 23:17:08 +00:00
Ruslan Ermilov
ead4296edb Don't hardcore PATH into BINMAKE; the latter should only be
comprised of the path to a make(1) binary (possibly the one
built by the "make" target in this Makefile), and a path to
a fresh share/mk.  The idea is to allow "make release" pick
up the right "make" binary, if one exists.

This fixes release.5 I broke with the last commit here; the
second PATH here was overriding the right one from WMAKEENV
while rebuilding the "build-tools" for crunched binaries.
2003-07-04 17:35:26 +00:00
Ruslan Ermilov
5dc6311712 Fixed style bugs related to parentheses in Makefile.inc1.
Submitted by:	bde

Fixed nearby bug: propagate the root Makefile's idea of
the appropriate "make" binary down to release/Makefile.
2003-07-04 14:27:06 +00:00
Ruslan Ermilov
b31745f599 Do the upgrade checks quietly. 2003-06-22 21:56:22 +00:00
Hidetoshi Shimokawa
0147d2aa71 Allow installkernel.debug and reinstallkernel.debug. 2003-06-22 10:01:03 +00:00
Warner Losh
5e9b1e9f3c Kill upgrade target docs. It too is stale.
Submitted by: ru
2003-04-03 05:34:36 +00:00
Warner Losh
3226556327 Kill aout to elf upgrade path. From an old comment in the makefile:
# If -DWANT_AOUT is specified, a `make world' with OBJFORMAT=elf will
# update the legacy support for aout. This includes all libraries, ld.so
# and boot objects. This part of build should be regarded as
# deprecated and you should _not_ expect to be able to do this past the
# release of 4.0. You have exactly one major release to move entirely
# to elf.

Now that we're past 5.0, these aren't needed at all anymore and it is
well past its freshness date.
2003-04-03 05:28:09 +00:00
Ruslan Ermilov
20902bd3e1 Don't make buildworld and buildkernel in parallel.
And this is probably what you expect when you say
"make -jX buildworld buildkernel".
2003-02-27 13:11:33 +00:00
Ruslan Ermilov
301c406900 Don't spam sys/${MACHINE}/conf/ with _.${MACHINE}.makeLINT.
Submitted by:	johan
2003-02-19 16:57:12 +00:00
Ruslan Ermilov
1f4f767045 Fixed universe.
Folded pc98 into the common case.
Retired ${JFLAG} (``make -jX universe'' should work).
2003-02-19 15:40:19 +00:00
Poul-Henning Kamp
a3961cf42c Fix make universe's kernel builds on pc98: We need to pass both ARCH
and TARGET_ARCH.
2003-02-18 17:35:20 +00:00
Ruslan Ermilov
76499f1539 Part 3/3 of unbreaking cross releases:
When we call "distributeworld" as part of "make release", we set
MACHINE and MACHINE_ARCH to point to TARGET and TARGET_ARCH; this
confused src/Makefile's idea of what ${MAKEPATH}, and consequently
${MAKE}, is (well, it still confuses ${MAKEPATH}, but see below).

To overcome this problem, we now take the following approach:

- We preserve the make(1)'s idea of its argv[0], ${MAKE}.
- We check to see if ${MAKE} passes the regression tests.
- If it does, we use it.  Otherwise, we build and use an
  up-to-date make(1).

This fix is still not quite right, in a situation where a single
/usr/obj is shared between different architecture machines, but
it is less critical and I hope to fix that soon.
2003-01-29 10:00:42 +00:00
Jens Schweikhardt
d98744aa7b Minor typo fixes and whitespace cleanups. 2002-12-30 16:48:35 +00:00
Warner Losh
deadd433cc Build kernels for pc98 just like the other platforms. Also, remove
one space to make the dates line up for easy mental math.

# Too bad only i386 and pc98 are the only parts of the universe
# currently buildable on my box :-(
2002-12-14 22:36:56 +00:00
Bruce A. Mah
280e7ae990 Minor, cosmetic change to buildworld output to make it reflect
rev. 1.270 more accurately.

Reviewed by:	ru
Approved by:	re (jhb)
2002-12-03 17:49:05 +00:00
Ruslan Ermilov
2e84ab947d If /usr/bin/make fails to pass the regression tests, it might not
be suitable for building.  The old action here was to upgrade the
make in /usr/bin.  This is both bogus and does not work under non
root.  So, rather than overwriting the existing /usr/bin/make, we
now install it into a safe location, and use it from there.

Reviewed by:	imp, marcel
Approved by:	re (rwatson)
2002-12-02 14:31:21 +00:00
Ruslan Ermilov
113cf9e649 Moved make(1) regression tests from src/Makefile to where they
belong (src/tools/regression/usr.bin/make), and use the latter
to test if make(1) is adequate for building the world.

Approved by:	re
2002-11-28 13:08:09 +00:00
Poul-Henning Kamp
11c1066016 PC98 is not a true architecture, but a subarchitecture of i386, so we need
to use a slightly differnt command to PC98::buildworld.
2002-10-02 13:52:36 +00:00
Poul-Henning Kamp
89d0989f17 Add pc98 to universe target.
Remember about /usr/obj and look for conf/NOTES in the right place.
2002-10-01 09:58:50 +00:00
Poul-Henning Kamp
77c1699f0c Add "make universe" target which:
for each arch i386 sparc64 alpha ia64
                make buildworld TARGET_ARCH=$arch
                if NOTES found
                        make LINT
                foreach kern ${arch}/conf/[A-Z0-9]*
                        make buildkernel TARGET_ARCH=$arch KERNCONF=$kern

Errors from the individual steps are ignored and the stdout+stderr
are saved in distinct files in root of the source tree with names
like: _.${arch}.${target}

On my dual 1.6G Athlon it takes roughly four hours to run this target.
2002-09-26 04:40:54 +00:00