Exclude them from renaming and expect the linker to do the right thing in
resolving them all to the library copy (i.e. optarg) or locally as the
case may be. Testing multiple programs crunched which reference optarg shows
correct behavior now.
these cases, prepend getwd() onto the front of them so a full correct path
is passed to the reach over make command (as it's running from at least
a subdir of the current directory for each object)
"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).
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.
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.
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.