# HG changeset patch # User "Yann E. MORIN" # Date 1180121442 0 # Node ID b2695c2f19190f56e562b9e54d43f1f3b3610b81 # Parent 256614d8ef44c283a94397b0aec147b538f2b29d Add the possibility to stop after a specified step. Update the Makefile help and the documentation accordingly. diff -r 256614d8ef44 -r b2695c2f1919 Makefile --- a/Makefile Thu May 24 19:00:26 2007 +0000 +++ b/Makefile Fri May 25 19:30:42 2007 +0000 @@ -9,6 +9,7 @@ # 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 @@ @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= to restart a previously saved step (read doc first!)' .config: $(CONFIG_FILES) $(CT_TOP_DIR)/config/debug.in @make oldconfig diff -r 256614d8ef44 -r b2695c2f1919 docs/overview.txt --- a/docs/overview.txt Thu May 24 19:00:26 2007 +0000 +++ b/docs/overview.txt Fri May 25 19:30:42 2007 +0000 @@ -95,13 +95,46 @@ 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 @@ The version of crosstool-NG you are using. Not much help for you, but it's there if you need it. + Interesting config options | ---------------------------* diff -r 256614d8ef44 -r b2695c2f1919 scripts/crosstool.sh --- a/scripts/crosstool.sh Thu May 24 19:00:26 2007 +0000 +++ b/scripts/crosstool.sh Fri May 25 19:30:42 2007 +0000 @@ -410,6 +410,10 @@ 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 diff -r 256614d8ef44 -r b2695c2f1919 scripts/functions --- a/scripts/functions Thu May 24 19:00:26 2007 +0000 +++ b/scripts/functions Fri May 25 19:30:42 2007 +0000 @@ -519,12 +519,14 @@ 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_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