"make -a -b VAR=VALUE -c -d target" to
"make -a -b -c -d VAR=VALUE target"
to avoid depending on make's undocumented and unportably-implemented
handling of the former case.
Makes crunchgen and nbmake work together on Cygwin.
* Rename "config.h" to "nbtool_config.h" and
HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
This makes in more obvious in the source when we're using
tools/compat/config.h versus "standard autoconf" config.h
* Consistently move the inclusion of nbtool_config.h to before
<sys/cdefs.h> so that the former can provide __RCSID() (et al),
and there's no need to protect those macros any more.
These changes should make it easier to "tool-ify" a program by adding:
#if HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h"
#endif
to the top of the source files (for the general case).
* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.
* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.
doesn't pick up baggage from bsd.own.mk and bsd.prog.mk.
This stops parallel makes exploding because they try to build ${PROG} to soon.
Fixes toolchain/21563 (with change to src/distrib/common/Makefile.crunch).
Upped version of crunchgen to 0.3
then build the program itself.
This means that changes to any of the program source files cause the
crunched binary to be rebuilt.
Seems to work ok with the sysinst ramdisks.
two variables:
TOOLCHAIN_MISSING -- set to "yes" on platforms for which there is
no working in-tree toolchain (hppa, ns32k, sh5, x86_64).
EXTERNAL_TOOLCHAIN -- if defined by the user, points to the root of
an external toolchain (e.g. /usr/local/gnu). This enables the cross-build
framework even for TOOLCHAIN_MISSING platforms.
If TOOLCHAIN_MISSING is set to "yes", MKGDB, MKBFD, and MKGCC are all
unconditionally set to "no", since the bits are not there to build.
If EXTERNAL_TOOLCHAIN is set, MKGCC is unconditionally set to "no",
since the external toolchain's compiler is not in-sync with the
in-tree compiler support components (e.g. libgcc).
* Set MACHINE_CPU much earlier in bsd.own.mk, so that more tests in
that file can use it.
Even though envp is not the POSIX way of crawling through the environment,
this will hopefully save someone from having to scratch their head
really hard with a crunched program using envp.
from henric@aimnet.com, via OpenBSD
crunchgen-created makefile with a partiallly complete build
(a situation which is more common than you think...)
solving the "parallel build" problem for crunchgen-created makefiles
needs to be done a different way...
fixes [toolchain/17012] from me.
it's not set, default to -Os (so it's not hard coded into the binary.)
Generate a makefile by default that does all object file builds in local
subdirs by binary (i.e. bad144 gets built in $OBJDIR/bad144) via a reach over
make. (Sets .PATH and .CURDIR and does a make for the objects needed in that
dir).
Add a -o option that does the old behavior of searching for obj files by
querying the various object environment vars and searching. Without this
option none of the objdir special options, environment vars, etc will have
effect.
Document all the changes in the man page (and specificly note that without -o
none of the objdir functions take effect).
1) Always do a make clean before building objects in any directory. This
is wasteful, but there's really no other simple way to cope with the
fact that the compilation settings (e.g. CFLAGS) appropriate for the
non-crunched build of a program may not be appropriate for the crunched
build. If the objdir magic in make didn't rely upon the presence of an
"obj" or "obj.${MACHINE}" symlink, we could abuse it to handle this but
unfortunately, it does.
2) Override $DBG to cause object files to be built with -Os. We can't emit
"DBG?=" into the generated makefile because of order-of-inclusion issues
with the system Makefiles; the result would be that the default setting
(currently -O2) would always be used instead of -Os. If you're crunching,
you almost certainly are doing it to get a smaller executable (!) so -Os
is almost certainly appropriate for you.
- keep the case consistent between the actual name and what's referenced.
e.g, if it's `foo', don't use '.Nm Foo' at the start of a sentence.
- remove unnecessary `.Nm foo' after the first occurrence (except for
using `.Nm ""' if there's stuff following, or for the 2nd and so on
occurrences in a SYNOPSIS
- use Sx, Ic, Li, Em, Sq, and Xr as appropriate
1) Include bsd.sys.mk so we pick up DESTDIR changes to fine .h files.
2) Only set STRIP if it's unset.
3) Generate .cro files rather than .lo files. .lo now is used for "local
objects" - obj's for the host machine not the target machine.
the machine type a run-time decision a la make. Also, use ${LD}
for the linker, not ld.
Note: you will have to delete the crunchgen cache file for these
changes to take effect.