Add the possibility to stop after a specified step.

Update the Makefile help and the documentation accordingly.
This commit is contained in:
Yann E. MORIN" 2007-05-25 19:30:42 +00:00
parent e49e7c80a2
commit 266e38cc13
4 changed files with 54 additions and 5 deletions

View File

@ -9,6 +9,7 @@ export CT_TOP_DIR=$(shell pwd)
# This is crosstool-ng version string
export CT_VERSION=$(shell cat $(CT_TOP_DIR)/version)
export CT_STOP=$(STOP)
export CT_RESTART=$(RESTART)
.PHONY: all
@ -35,8 +36,11 @@ help::
@echo 'Distribution targets:'
@echo ' tarball - Build a tarball of the configured toolchain'
@echo
@echo 'Environement variables:'
@echo ' STOP - Stop the build just after this step'
@echo ' RESTART - Restart the build just before this step'
@echo
@echo 'Execute "make" or "make all" to build all targets marked with [*]'
@echo 'Pass RESTART=<step> to restart a previously saved step (read doc first!)'
.config: $(CONFIG_FILES) $(CT_TOP_DIR)/config/debug.in
@make oldconfig

View File

@ -95,13 +95,46 @@ where you want it installed, what architecture and specific processor it
will support, the version of the components you want to use, etc... The
value for those options are then stored in a configuration file.
You then simply run make. It will use this configuration file to retrieve,
extract and patch the components, build, install and test your newly built
toolchain.
To enter the menu, type:
make menuconfig
To build the so-configured target, simply type:
make
This will use the above configuration to retrieve, extract and patch the
components, build, install and eventually test your newly built toolchain.
You are then free to add the toolchain /bin directory in your PATH to use
it at will.
In any case, you can get some terse help. Just type:
make help
Stoping and restarting a build |
-------------------------------*
If you want to stop the build after a step you are debugging, you can pass the
variable STOP to make:
make STOP=some_step
Conversely, if you want to restart a build at a specific step you are
debugging, you can pass the RESTART variable to make:
make RESTART=some_step
The list of steps is, in order of appearence in the build process:
- libc_check_config
- kernel_check_config
- kernel_headers
- binutils
- libc_headers
- cc_core
- libfloat
- libc
- cc
- libc_finish
- debug
____________________________
/
Configuring crosstool-NG /
@ -135,6 +168,7 @@ CT_VERSION:
The version of crosstool-NG you are using. Not much help for you, but it's
there if you need it.
Interesting config options |
---------------------------*

View File

@ -410,6 +410,10 @@ if [ "${CT_ONLY_DOWNLOAD}" != "y" -a "${CT_ONLY_EXTRACT}" != "y" ]; then
fi
if [ ${do_it} -eq 1 ]; then
do_${step}
if [ "${CT_STOP}" = "${step}" ]; then
CT_DoLog ERROR "Stopping just after step \"${step}\", as requested."
exit 0
fi
if [ "${CTDEBUG_CT_PAUSE_STEPS}" = "y" ]; then
CT_DoPause "Step \"${step}\" finished"
fi

View File

@ -519,12 +519,14 @@ CT_DoSaveState() {
CT_DoLoadState(){
local state_name="$1"
local state_dir="${CT_STATE_DIR}/${state_name}"
local old_RESTART="${CT_RESTART}"
local old_STOP="${CT_STOP}"
# We need to do something special with the log file!
if [ "${CT_LOG_TO_FILE}" = "y" ]; then
exec >"${state_dir}/tail.log"
fi
CT_DoLog DEBUG "Restoring state at step \"${state_name}\"..."
CT_DoLog INFO "Restoring state at step \"${state_name}\", as requested."
case "${CT_DEBUG_CT_SAVE_STEPS_GZIP}" in
y) tar_opt=xzf; tar_ext=".tar.gz";;
@ -551,6 +553,11 @@ CT_DoLoadState(){
CT_DoLog DEBUG " Restoring environment"
. "${state_dir}/env.sh" >/dev/null 2>&1 || true
# Restore the new RESTART and STOP steps
CT_RESTART="${old_RESTART}"
CT_STOP="${old_STOP}"
unset old_stop old_restart
if [ "${CT_LOG_TO_FILE}" = "y" ]; then
CT_DoLog DEBUG " Restoring log file"
exec >/dev/null