The make depend needs to be it's own separate make so it's done before the
main make runs. This also fixes issues w. -j breaking on 'depend <target'.
In addition, force the sub cross-over make to always run or otherwise it'll
never check dependencies once a valid foo.cro has been created.
Bump to 20050208
This fixes the "make -j N dependall" build issues people were
seeing in src/rescue, that appears to have been introduced
in rev 1.62.
Use the MAKEVERBOSE macros (if present) to print the pretty message.
Set the CRUNCH_VERSION to 20050130.
Instead of trying to identify all the .o files that make each target rely
on the targets own Makefile having a program.ro target that will compile
all the objects and link them into a single relocatable.
Rename each program's 'main' to '_crunched_<prog>_stub' instead of compiling
a small piece of C.
The old behaviour can be forced by specifying -O, and is also done if the
config file specifies 'objs' or 'objpaths'.
As well as simplifying the logic, this means you only get a single 'prog.ro
is up to date' message for each program during the build.
the list of symbols to be renamed.
Rename symbols to <symbol>$$from%%<prog> (not _$$hide$$<prog>.cro$$<symbol>)
so that gdb reports the symbol name instead of "_" (the $$ is treated as a
C++ name mangle and nothing after it is output by default).
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).
* 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.