Rename all Makefiles used by ct-ng into (something).mk, to avoid confusion.
author"Yann E. MORIN" <yann.morin.1998@anciens.enib.fr>
Sun Jul 15 09:09:04 2007 +0000 (2007-07-15)
changeset 2614b8cba298bf3
parent 260 0b0769e5a2ab
child 262 30b65aecf7fb
Rename all Makefiles used by ct-ng into (something).mk, to avoid confusion.
Makefile.in
Makefile.steps
ct-ng.in
kconfig/Makefile
kconfig/kconfig.mk
samples/Makefile
samples/samples.mk
steps.mk
tools/Makefile
tools/tools.mk
     1.1 --- a/Makefile.in	Sun Jul 15 08:37:22 2007 +0000
     1.2 +++ b/Makefile.in	Sun Jul 15 09:09:04 2007 +0000
     1.3 @@ -80,7 +80,7 @@
     1.4  	     tar cf - --exclude=.svn $${src_dir} |(cd $(LIBDIR); tar xf -); \
     1.5  	 done
     1.6  	@rm -f $(LIBDIR)/tools/addToolVersion.sh
     1.7 -	@for src_file in Makefile.steps version; do                 \
     1.8 +	@for src_file in steps.mk version; do                 \
     1.9  	     echo "  INST   $${src_file}";                          \
    1.10  	     install -m 644 $${src_file} $(LIBDIR)/$${src_file};    \
    1.11  	 done
     2.1 --- a/Makefile.steps	Sun Jul 15 08:37:22 2007 +0000
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,35 +0,0 @@
     2.4 -# Makefile for each steps
     2.5 -# Copyright 2006 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
     2.6 -
     2.7 -CT_STEPS := libc_check_config       \
     2.8 -            kernel_check_config     \
     2.9 -            kernel_headers          \
    2.10 -            binutils                \
    2.11 -            cc_core_pass_1          \
    2.12 -            libc_headers            \
    2.13 -            libc_start_files        \
    2.14 -            cc_core_pass_2          \
    2.15 -            libfloat                \
    2.16 -            libc                    \
    2.17 -            cc                      \
    2.18 -            libc_finish             \
    2.19 -            tools                   \
    2.20 -            debug                   \
    2.21 -
    2.22 -$(CT_STEPS):
    2.23 -	@$(CT_NG) RESTART=$@ STOP=$@ build
    2.24 -
    2.25 -$(patsubst %,-%,$(CT_STEPS)):
    2.26 -	@$(CT_NG) STOP=$(patsubst -%,%,$@) build
    2.27 -
    2.28 -$(patsubst %,%-,$(CT_STEPS)):
    2.29 -	@$(CT_NG) RESTART=$(patsubst %-,%,$@) build
    2.30 -
    2.31 -help-build::
    2.32 -	@echo  '  liststeps      - List all build steps'
    2.33 -
    2.34 -liststeps:
    2.35 -	@echo  'Available build steps, in order:'
    2.36 -	@for step in $(CT_STEPS); do    \
    2.37 -	     echo "  - $${step}";       \
    2.38 -	 done
     3.1 --- a/ct-ng.in	Sun Jul 15 08:37:22 2007 +0000
     3.2 +++ b/ct-ng.in	Sun Jul 15 09:09:04 2007 +0000
     3.3 @@ -70,10 +70,10 @@
     3.4  	@echo  '  clean          - Remove generated files'
     3.5  	@echo  '  distclean      - Remove generated files, configuration and build directories'
     3.6  
     3.7 -include $(CT_LIB_DIR)/kconfig/Makefile
     3.8 -include $(CT_LIB_DIR)/samples/Makefile
     3.9 -include $(CT_LIB_DIR)/tools/Makefile
    3.10 -include $(CT_LIB_DIR)/Makefile.steps
    3.11 +include $(CT_LIB_DIR)/kconfig/kconfig.mk
    3.12 +include $(CT_LIB_DIR)/samples/samples.mk
    3.13 +include $(CT_LIB_DIR)/tools/tools.mk
    3.14 +include $(CT_LIB_DIR)/steps.mk
    3.15  
    3.16  help-distrib::
    3.17  	@echo  '  tarball        - Build a tarball of the configured toolchain'
     4.1 --- a/kconfig/Makefile	Sun Jul 15 08:37:22 2007 +0000
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,103 +0,0 @@
     4.4 -# ===========================================================================
     4.5 -# crosstool-NG configuration targets
     4.6 -# These targets are used from top-level makefile
     4.7 -
     4.8 -# Derive the project version from, well, the project version:
     4.9 -export PROJECTVERSION=$(CT_VERSION)
    4.10 -
    4.11 -KCONFIG_TOP = config/config.in
    4.12 -obj = $(CT_TOP_DIR)/kconfig
    4.13 -PHONY += clean help oldconfig menuconfig config defoldconfig
    4.14 -
    4.15 -# Darwin (MacOS-X) does not have proper libintl support
    4.16 -ifeq ($(shell uname -s),Darwin)
    4.17 -KBUILD_NO_NLS:=1
    4.18 -endif
    4.19 -
    4.20 -ifneq ($(KBUILD_NO_NLS),)
    4.21 -CFLAGS += -DKBUILD_NO_NLS
    4.22 -endif
    4.23 -
    4.24 -# Build a list of all config files
    4.25 -DEBUG_CONFIG_FILES = $(shell find $(CT_LIB_DIR)/config/debug -type f -name '*.in')
    4.26 -TOOLS_CONFIG_FILES = $(shell find $(CT_LIB_DIR)/config/tools -type f -name '*.in')
    4.27 -
    4.28 -STATIC_CONFIG_FILES = $(shell find $(CT_LIB_DIR)/config -type f -name '*.in')
    4.29 -GEN_CONFIG_FILES=$(CT_TOP_DIR)/config.gen/debug.in	\
    4.30 -				 $(CT_TOP_DIR)/config.gen/tools.in
    4.31 -
    4.32 -CONFIG_FILES=$(STATIC_CONFIG_FILES) $(GEN_CONFIG_FILES)
    4.33 -
    4.34 -$(GEN_CONFIG_FILES):: $(CT_TOP_DIR)/config.gen
    4.35 -
    4.36 -$(CT_TOP_DIR)/config.gen:
    4.37 -	@mkdir -p $(CT_TOP_DIR)/config.gen
    4.38 -
    4.39 -$(CT_TOP_DIR)/config.gen/debug.in:: $(DEBUG_CONFIG_FILES)
    4.40 -	@echo "# Debug facilities menu" >$@
    4.41 -	@echo "# Generated file, do not edit!!!" >>$@
    4.42 -	@echo "menu \"Debug facilities\"" >>$@
    4.43 -	@for f in $(patsubst $(CT_TOP_DIR)/%,%,$(wildcard $(CT_TOP_DIR)/config/debug/*.in)); do \
    4.44 -	     echo "source $${f}";                                                               \
    4.45 -	 done >>$@
    4.46 -	@echo "endmenu" >>$@
    4.47 -
    4.48 -$(CT_TOP_DIR)/config.gen/tools.in:: $(TOOLS_CONFIG_FILES)
    4.49 -	@echo "# Tools facilities menu" >$@
    4.50 -	@echo "# Generated file, do not edit!!!" >>$@
    4.51 -	@echo "menu \"Tools facilities\"" >>$@
    4.52 -	@for f in $(patsubst $(CT_TOP_DIR)/%,%,$(wildcard $(CT_TOP_DIR)/config/tools/*.in)); do \
    4.53 -	     echo "source $${f}";                                                               \
    4.54 -	 done >>$@
    4.55 -	@echo "endmenu" >>$@
    4.56 -
    4.57 -config menuconfig oldconfig defoldconfig:: $(KCONFIG_TOP)
    4.58 -
    4.59 -$(KCONFIG_TOP):
    4.60 -	@ln -s $(CT_LIB_DIR)/config config
    4.61 -
    4.62 -menuconfig:: $(obj)/mconf $(CONFIG_FILES)
    4.63 -	@$< $(KCONFIG_TOP)
    4.64 -
    4.65 -config:: $(obj)/conf $(CONFIG_FILES)
    4.66 -	@$< $(KCONFIG_TOP)
    4.67 -
    4.68 -oldconfig:: $(obj)/conf $(CONFIG_FILES)
    4.69 -	@$< -s $(KCONFIG_TOP)
    4.70 -
    4.71 -defoldconfig:: $(obj)/conf $(CONFIG_FILES)
    4.72 -	@yes "" |$< -s $(KCONFIG_TOP) >/dev/null
    4.73 -
    4.74 -# Help text used by make help
    4.75 -help-config::
    4.76 -	@echo  '  config         - Update current config using a line-oriented program'
    4.77 -	@echo  '  menuconfig     - Update current config using a menu based program'
    4.78 -	@echo  '  oldconfig      - Update current config using a provided .config as base'
    4.79 -
    4.80 -# Cheesy build
    4.81 -
    4.82 -SHIPPED = $(CT_LIB_DIR)/kconfig/zconf.tab.c $(CT_LIB_DIR)/kconfig/lex.zconf.c $(CT_LIB_DIR)/kconfig/zconf.hash.c
    4.83 -
    4.84 -%.c: %.c_shipped
    4.85 -	@ln -s $(notdir $<) $@
    4.86 -
    4.87 -$(obj)/conf $(obj)/mconf:: $(obj)
    4.88 -
    4.89 -$(obj):
    4.90 -	@mkdir -p $(obj)
    4.91 -
    4.92 -$(obj)/mconf:: $(SHIPPED) $(CT_LIB_DIR)/kconfig/mconf.c
    4.93 -	@$(HOST_CC) $(CFLAGS) -o $@ $(CT_LIB_DIR)/kconfig/{mconf.c,zconf.tab.c,lxdialog/*.c} \
    4.94 -		-lcurses "-DCURSES_LOC=<ncurses.h>"
    4.95 -
    4.96 -$(obj)/conf:: $(SHIPPED) $(CT_LIB_DIR)/kconfig/conf.c
    4.97 -	@$(HOST_CC) $(CFLAGS) -o $@ $(CT_LIB_DIR)/kconfig/{conf.c,zconf.tab.c}
    4.98 -
    4.99 -clean::
   4.100 -	@rm -f $(CT_TOP_DIR)/kconfig/{,m}conf
   4.101 -	@rmdir --ignore-fail-on-non-empty $(CT_TOP_DIR)/kconfig 2>/dev/null || true
   4.102 -	@rm -f $(CT_TOP_DIR)/config
   4.103 -	@rm -rf $(CT_TOP_DIR)/config.gen
   4.104 -
   4.105 -distclean::
   4.106 -	@rm -f $(CT_TOP_DIR)/config
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/kconfig/kconfig.mk	Sun Jul 15 09:09:04 2007 +0000
     5.3 @@ -0,0 +1,103 @@
     5.4 +# ===========================================================================
     5.5 +# crosstool-NG configuration targets
     5.6 +# These targets are used from top-level makefile
     5.7 +
     5.8 +# Derive the project version from, well, the project version:
     5.9 +export PROJECTVERSION=$(CT_VERSION)
    5.10 +
    5.11 +KCONFIG_TOP = config/config.in
    5.12 +obj = $(CT_TOP_DIR)/kconfig
    5.13 +PHONY += clean help oldconfig menuconfig config defoldconfig
    5.14 +
    5.15 +# Darwin (MacOS-X) does not have proper libintl support
    5.16 +ifeq ($(shell uname -s),Darwin)
    5.17 +KBUILD_NO_NLS:=1
    5.18 +endif
    5.19 +
    5.20 +ifneq ($(KBUILD_NO_NLS),)
    5.21 +CFLAGS += -DKBUILD_NO_NLS
    5.22 +endif
    5.23 +
    5.24 +# Build a list of all config files
    5.25 +DEBUG_CONFIG_FILES = $(shell find $(CT_LIB_DIR)/config/debug -type f -name '*.in')
    5.26 +TOOLS_CONFIG_FILES = $(shell find $(CT_LIB_DIR)/config/tools -type f -name '*.in')
    5.27 +
    5.28 +STATIC_CONFIG_FILES = $(shell find $(CT_LIB_DIR)/config -type f -name '*.in')
    5.29 +GEN_CONFIG_FILES=$(CT_TOP_DIR)/config.gen/debug.in	\
    5.30 +				 $(CT_TOP_DIR)/config.gen/tools.in
    5.31 +
    5.32 +CONFIG_FILES=$(STATIC_CONFIG_FILES) $(GEN_CONFIG_FILES)
    5.33 +
    5.34 +$(GEN_CONFIG_FILES):: $(CT_TOP_DIR)/config.gen
    5.35 +
    5.36 +$(CT_TOP_DIR)/config.gen:
    5.37 +	@mkdir -p $(CT_TOP_DIR)/config.gen
    5.38 +
    5.39 +$(CT_TOP_DIR)/config.gen/debug.in:: $(DEBUG_CONFIG_FILES)
    5.40 +	@echo "# Debug facilities menu" >$@
    5.41 +	@echo "# Generated file, do not edit!!!" >>$@
    5.42 +	@echo "menu \"Debug facilities\"" >>$@
    5.43 +	@for f in $(patsubst $(CT_TOP_DIR)/%,%,$(wildcard $(CT_TOP_DIR)/config/debug/*.in)); do \
    5.44 +	     echo "source $${f}";                                                               \
    5.45 +	 done >>$@
    5.46 +	@echo "endmenu" >>$@
    5.47 +
    5.48 +$(CT_TOP_DIR)/config.gen/tools.in:: $(TOOLS_CONFIG_FILES)
    5.49 +	@echo "# Tools facilities menu" >$@
    5.50 +	@echo "# Generated file, do not edit!!!" >>$@
    5.51 +	@echo "menu \"Tools facilities\"" >>$@
    5.52 +	@for f in $(patsubst $(CT_TOP_DIR)/%,%,$(wildcard $(CT_TOP_DIR)/config/tools/*.in)); do \
    5.53 +	     echo "source $${f}";                                                               \
    5.54 +	 done >>$@
    5.55 +	@echo "endmenu" >>$@
    5.56 +
    5.57 +config menuconfig oldconfig defoldconfig:: $(KCONFIG_TOP)
    5.58 +
    5.59 +$(KCONFIG_TOP):
    5.60 +	@ln -s $(CT_LIB_DIR)/config config
    5.61 +
    5.62 +menuconfig:: $(obj)/mconf $(CONFIG_FILES)
    5.63 +	@$< $(KCONFIG_TOP)
    5.64 +
    5.65 +config:: $(obj)/conf $(CONFIG_FILES)
    5.66 +	@$< $(KCONFIG_TOP)
    5.67 +
    5.68 +oldconfig:: $(obj)/conf $(CONFIG_FILES)
    5.69 +	@$< -s $(KCONFIG_TOP)
    5.70 +
    5.71 +defoldconfig:: $(obj)/conf $(CONFIG_FILES)
    5.72 +	@yes "" |$< -s $(KCONFIG_TOP) >/dev/null
    5.73 +
    5.74 +# Help text used by make help
    5.75 +help-config::
    5.76 +	@echo  '  config         - Update current config using a line-oriented program'
    5.77 +	@echo  '  menuconfig     - Update current config using a menu based program'
    5.78 +	@echo  '  oldconfig      - Update current config using a provided .config as base'
    5.79 +
    5.80 +# Cheesy build
    5.81 +
    5.82 +SHIPPED = $(CT_LIB_DIR)/kconfig/zconf.tab.c $(CT_LIB_DIR)/kconfig/lex.zconf.c $(CT_LIB_DIR)/kconfig/zconf.hash.c
    5.83 +
    5.84 +%.c: %.c_shipped
    5.85 +	@ln -s $(notdir $<) $@
    5.86 +
    5.87 +$(obj)/conf $(obj)/mconf:: $(obj)
    5.88 +
    5.89 +$(obj):
    5.90 +	@mkdir -p $(obj)
    5.91 +
    5.92 +$(obj)/mconf:: $(SHIPPED) $(CT_LIB_DIR)/kconfig/mconf.c
    5.93 +	@$(HOST_CC) $(CFLAGS) -o $@ $(CT_LIB_DIR)/kconfig/{mconf.c,zconf.tab.c,lxdialog/*.c} \
    5.94 +		-lcurses "-DCURSES_LOC=<ncurses.h>"
    5.95 +
    5.96 +$(obj)/conf:: $(SHIPPED) $(CT_LIB_DIR)/kconfig/conf.c
    5.97 +	@$(HOST_CC) $(CFLAGS) -o $@ $(CT_LIB_DIR)/kconfig/{conf.c,zconf.tab.c}
    5.98 +
    5.99 +clean::
   5.100 +	@rm -f $(CT_TOP_DIR)/kconfig/{,m}conf
   5.101 +	@rmdir --ignore-fail-on-non-empty $(CT_TOP_DIR)/kconfig 2>/dev/null || true
   5.102 +	@rm -f $(CT_TOP_DIR)/config
   5.103 +	@rm -rf $(CT_TOP_DIR)/config.gen
   5.104 +
   5.105 +distclean::
   5.106 +	@rm -f $(CT_TOP_DIR)/config
     6.1 --- a/samples/Makefile	Sun Jul 15 08:37:22 2007 +0000
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,71 +0,0 @@
     6.4 -# Makefile to manage samples
     6.5 -
     6.6 -# Build the list of available samples
     6.7 -CT_TOP_SAMPLES := $(patsubst $(CT_TOP_DIR)/samples/%/crosstool.config,%,$(wildcard $(CT_TOP_DIR)/samples/*/crosstool.config))
     6.8 -CT_LIB_SAMPLES := $(filter-out $(CT_TOP_SAMPLES),$(patsubst $(CT_LIB_DIR)/samples/%/crosstool.config,%,$(wildcard $(CT_LIB_DIR)/samples/*/crosstool.config)))
     6.9 -
    6.10 -CT_SAMPLES := $(CT_TOP_SAMPLES) $(CT_LIB_SAMPLES)
    6.11 -
    6.12 -help-config::
    6.13 -	@echo  '  saveconfig     - Save current config as a preconfigured target'
    6.14 -
    6.15 -help-samples::
    6.16 -	@$(CT_LIB_DIR)/scripts/showSamples.sh $(CT_SAMPLES)
    6.17 -
    6.18 -help-build::
    6.19 -	@echo  '  regtest        - Regtest-build all samples'
    6.20 -	@echo  '  regtest-local  - Regtest-build all local samples'
    6.21 -	@echo  '  regtest-global - Regtest-build all global samples'
    6.22 -
    6.23 -# How we do build one sample
    6.24 -PHONY += $(CT_SAMPLES)
    6.25 -$(CT_SAMPLES):
    6.26 -	@$(CT_NG) $(patsubst %,copy_config_%,$(@)) oldconfig
    6.27 -
    6.28 -$(patsubst %,copy_config_%,$(CT_SAMPLES)):
    6.29 -	@if [ -f $(CT_TOP_DIR)/samples/$(patsubst copy_config_%,%,$(@))/crosstool.config ]; then                    \
    6.30 -	      cp "$(CT_TOP_DIR)/samples/$(patsubst copy_config_%,%,$(@))/crosstool.config" "$(CT_TOP_DIR)/.config"; \
    6.31 -	 else                                                                                                       \
    6.32 -	      cp "$(CT_LIB_DIR)/samples/$(patsubst copy_config_%,%,$(@))/crosstool.config" "$(CT_TOP_DIR)/.config"; \
    6.33 -	 fi
    6.34 -
    6.35 -# And now for building all samples one after the other
    6.36 -PHONY += regtest regtest_local regtest_global
    6.37 -regtest: regtest-local regtest-global
    6.38 -
    6.39 -regtest-local: $(patsubst %,regtest_%,$(CT_TOP_SAMPLES))
    6.40 -
    6.41 -regtest-global: $(patsubst %,regtest_%,$(CT_LIB_SAMPLES))
    6.42 -
    6.43 -# One regtest per sample
    6.44 -# We could use a simple rule like: 'regtest: $(CT_SAMPLES)', but that doesn't
    6.45 -# work because we want to save the samples as well.
    6.46 -# Also, we don't want to see anylog at all, save for the elapsed time, and we
    6.47 -# want to save the log file in a specific place
    6.48 -# Furthermore, force the location where the toolchain will be installed.
    6.49 -# Finaly, we can't use 'make sample-name' as we need to provide default values
    6.50 -# if the options set has changed, but oldconfig does not like when stdin is
    6.51 -# not a terminal (eg. it is a pipe).
    6.52 -$(patsubst %,regtest_%,$(CT_SAMPLES)):
    6.53 -	@samp=$(patsubst regtest_%,%,$@)                                                                ;   \
    6.54 -	 echo -e "\rBuilding sample \"$${samp}\""                                                       &&  \
    6.55 -	 $(CT_NG) copy_config_$${samp}                                                                  &&  \
    6.56 -	 yes "" |$(CT_NG) defoldconfig >/dev/null 2>&1                                                  &&  \
    6.57 -	 sed -i -r -e 's:^(CT_PREFIX_DIR=).*$$:\1"$${CT_TOP_DIR}/targets/tst/$${CT_TARGET}":;' .config  &&  \
    6.58 -	 sed -i -r -e 's:^.*(CT_LOG_(WARN|INFO|EXTRA|DEBUG|ALL)).*$$:# \1 is not set:;' .config         &&  \
    6.59 -	 sed -i -r -e 's:^.*(CT_LOG_ERROR).*$$:\1=y:;' .config                                          &&  \
    6.60 -	 sed -i -r -e 's:^(CT_LOG_LEVEL_MAX)=.*$$:\1="ERROR":;' .config                                 &&  \
    6.61 -	 sed -i -r -e 's:^.*(CT_LOG_TO_FILE).*$$:\1=y:;' .config                                        &&  \
    6.62 -	 sed -i -r -e 's:^.*(CT_LOG_PROGRESS_BAR).*$$:\1=y:;' .config                                   &&  \
    6.63 -	 yes "" |$(CT_NG) defoldconfig >/dev/null 2>&1                                                  &&  \
    6.64 -	 $(CT_NG) build                                                                                 &&  \
    6.65 -	 echo -e "\rSuccessfully built sample \"$${samp}\""                                             &&  \
    6.66 -	 echo -e "\rMaking tarball for sample \"$${samp}\""                                             &&  \
    6.67 -	 $(CT_NG) tarball                                                                               &&  \
    6.68 -	 echo -e "\rSuccessfully built tarball for sample \"$${samp}\""                                 ;   \
    6.69 -	 echo -e "\rCleaning sample \"$${samp}\""                                                       ;   \
    6.70 -	 $(CT_NG) distclean                                                                             ;   \
    6.71 -	 echo -e "\r"
    6.72 -
    6.73 -saveconfig:
    6.74 -	@$(CT_LIB_DIR)/scripts/saveSample.sh
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/samples/samples.mk	Sun Jul 15 09:09:04 2007 +0000
     7.3 @@ -0,0 +1,71 @@
     7.4 +# Makefile to manage samples
     7.5 +
     7.6 +# Build the list of available samples
     7.7 +CT_TOP_SAMPLES := $(patsubst $(CT_TOP_DIR)/samples/%/crosstool.config,%,$(wildcard $(CT_TOP_DIR)/samples/*/crosstool.config))
     7.8 +CT_LIB_SAMPLES := $(filter-out $(CT_TOP_SAMPLES),$(patsubst $(CT_LIB_DIR)/samples/%/crosstool.config,%,$(wildcard $(CT_LIB_DIR)/samples/*/crosstool.config)))
     7.9 +
    7.10 +CT_SAMPLES := $(CT_TOP_SAMPLES) $(CT_LIB_SAMPLES)
    7.11 +
    7.12 +help-config::
    7.13 +	@echo  '  saveconfig     - Save current config as a preconfigured target'
    7.14 +
    7.15 +help-samples::
    7.16 +	@$(CT_LIB_DIR)/scripts/showSamples.sh $(CT_SAMPLES)
    7.17 +
    7.18 +help-build::
    7.19 +	@echo  '  regtest        - Regtest-build all samples'
    7.20 +	@echo  '  regtest-local  - Regtest-build all local samples'
    7.21 +	@echo  '  regtest-global - Regtest-build all global samples'
    7.22 +
    7.23 +# How we do build one sample
    7.24 +PHONY += $(CT_SAMPLES)
    7.25 +$(CT_SAMPLES):
    7.26 +	@$(CT_NG) $(patsubst %,copy_config_%,$(@)) oldconfig
    7.27 +
    7.28 +$(patsubst %,copy_config_%,$(CT_SAMPLES)):
    7.29 +	@if [ -f $(CT_TOP_DIR)/samples/$(patsubst copy_config_%,%,$(@))/crosstool.config ]; then                    \
    7.30 +	      cp "$(CT_TOP_DIR)/samples/$(patsubst copy_config_%,%,$(@))/crosstool.config" "$(CT_TOP_DIR)/.config"; \
    7.31 +	 else                                                                                                       \
    7.32 +	      cp "$(CT_LIB_DIR)/samples/$(patsubst copy_config_%,%,$(@))/crosstool.config" "$(CT_TOP_DIR)/.config"; \
    7.33 +	 fi
    7.34 +
    7.35 +# And now for building all samples one after the other
    7.36 +PHONY += regtest regtest_local regtest_global
    7.37 +regtest: regtest-local regtest-global
    7.38 +
    7.39 +regtest-local: $(patsubst %,regtest_%,$(CT_TOP_SAMPLES))
    7.40 +
    7.41 +regtest-global: $(patsubst %,regtest_%,$(CT_LIB_SAMPLES))
    7.42 +
    7.43 +# One regtest per sample
    7.44 +# We could use a simple rule like: 'regtest: $(CT_SAMPLES)', but that doesn't
    7.45 +# work because we want to save the samples as well.
    7.46 +# Also, we don't want to see anylog at all, save for the elapsed time, and we
    7.47 +# want to save the log file in a specific place
    7.48 +# Furthermore, force the location where the toolchain will be installed.
    7.49 +# Finaly, we can't use 'make sample-name' as we need to provide default values
    7.50 +# if the options set has changed, but oldconfig does not like when stdin is
    7.51 +# not a terminal (eg. it is a pipe).
    7.52 +$(patsubst %,regtest_%,$(CT_SAMPLES)):
    7.53 +	@samp=$(patsubst regtest_%,%,$@)                                                                ;   \
    7.54 +	 echo -e "\rBuilding sample \"$${samp}\""                                                       &&  \
    7.55 +	 $(CT_NG) copy_config_$${samp}                                                                  &&  \
    7.56 +	 yes "" |$(CT_NG) defoldconfig >/dev/null 2>&1                                                  &&  \
    7.57 +	 sed -i -r -e 's:^(CT_PREFIX_DIR=).*$$:\1"$${CT_TOP_DIR}/targets/tst/$${CT_TARGET}":;' .config  &&  \
    7.58 +	 sed -i -r -e 's:^.*(CT_LOG_(WARN|INFO|EXTRA|DEBUG|ALL)).*$$:# \1 is not set:;' .config         &&  \
    7.59 +	 sed -i -r -e 's:^.*(CT_LOG_ERROR).*$$:\1=y:;' .config                                          &&  \
    7.60 +	 sed -i -r -e 's:^(CT_LOG_LEVEL_MAX)=.*$$:\1="ERROR":;' .config                                 &&  \
    7.61 +	 sed -i -r -e 's:^.*(CT_LOG_TO_FILE).*$$:\1=y:;' .config                                        &&  \
    7.62 +	 sed -i -r -e 's:^.*(CT_LOG_PROGRESS_BAR).*$$:\1=y:;' .config                                   &&  \
    7.63 +	 yes "" |$(CT_NG) defoldconfig >/dev/null 2>&1                                                  &&  \
    7.64 +	 $(CT_NG) build                                                                                 &&  \
    7.65 +	 echo -e "\rSuccessfully built sample \"$${samp}\""                                             &&  \
    7.66 +	 echo -e "\rMaking tarball for sample \"$${samp}\""                                             &&  \
    7.67 +	 $(CT_NG) tarball                                                                               &&  \
    7.68 +	 echo -e "\rSuccessfully built tarball for sample \"$${samp}\""                                 ;   \
    7.69 +	 echo -e "\rCleaning sample \"$${samp}\""                                                       ;   \
    7.70 +	 $(CT_NG) distclean                                                                             ;   \
    7.71 +	 echo -e "\r"
    7.72 +
    7.73 +saveconfig:
    7.74 +	@$(CT_LIB_DIR)/scripts/saveSample.sh
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/steps.mk	Sun Jul 15 09:09:04 2007 +0000
     8.3 @@ -0,0 +1,35 @@
     8.4 +# Makefile for each steps
     8.5 +# Copyright 2006 Yann E. MORIN <yann.morin.1998@anciens.enib.fr>
     8.6 +
     8.7 +CT_STEPS := libc_check_config       \
     8.8 +            kernel_check_config     \
     8.9 +            kernel_headers          \
    8.10 +            binutils                \
    8.11 +            cc_core_pass_1          \
    8.12 +            libc_headers            \
    8.13 +            libc_start_files        \
    8.14 +            cc_core_pass_2          \
    8.15 +            libfloat                \
    8.16 +            libc                    \
    8.17 +            cc                      \
    8.18 +            libc_finish             \
    8.19 +            tools                   \
    8.20 +            debug                   \
    8.21 +
    8.22 +$(CT_STEPS):
    8.23 +	@$(CT_NG) RESTART=$@ STOP=$@ build
    8.24 +
    8.25 +$(patsubst %,-%,$(CT_STEPS)):
    8.26 +	@$(CT_NG) STOP=$(patsubst -%,%,$@) build
    8.27 +
    8.28 +$(patsubst %,%-,$(CT_STEPS)):
    8.29 +	@$(CT_NG) RESTART=$(patsubst %-,%,$@) build
    8.30 +
    8.31 +help-build::
    8.32 +	@echo  '  liststeps      - List all build steps'
    8.33 +
    8.34 +liststeps:
    8.35 +	@echo  'Available build steps, in order:'
    8.36 +	@for step in $(CT_STEPS); do    \
    8.37 +	     echo "  - $${step}";       \
    8.38 +	 done
     9.1 --- a/tools/Makefile	Sun Jul 15 08:37:22 2007 +0000
     9.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.3 @@ -1,31 +0,0 @@
     9.4 -# Makefile for the tools/ sub-directory
     9.5 -
     9.6 -# Here, we can update the config.* scripts.
     9.7 -# If we're in CT_LIB_DIR, then CT_LIB_DIR == CT_TOP_DIR, and we can update those
     9.8 -# scripts for later inclusion mainline. If CT_LIB_DIR != CT_TOP_DIR, then those
     9.9 -# scripts are downloaded only for use in CT_TOP_DIR.
    9.10 -
    9.11 -CONFIG_SUB_SRC="http://cvs.savannah.gnu.org/viewcvs/*checkout*/config/config/config.sub"
    9.12 -CONFIG_SUB_DEST="$(CT_TOP_DIR)/tools/config.sub"
    9.13 -CONFIG_GUESS_SRC="http://cvs.savannah.gnu.org/viewcvs/*checkout*/config/config/config.guess"
    9.14 -CONFIG_GUESS_DEST="$(CT_TOP_DIR)/tools/config.guess"
    9.15 -
    9.16 -$(CT_TOP_DIR)/tools:
    9.17 -	@mkdir -p $(CT_TOP_DIR)/tools
    9.18 -
    9.19 -PHONY += updatetools
    9.20 -updatetools: $(CT_TOP_DIR)/tools $(CONFIG_SUB_DEST) $(CONFIG_GUESS_DEST)
    9.21 -
    9.22 -$(CONFIG_SUB_DEST):
    9.23 -	@wget $(CONFIG_SUB_SRC) -O $@
    9.24 -	@chmod u+rwx,go+rx-w $@
    9.25 -
    9.26 -$(CONFIG_GUESS_DEST):
    9.27 -	@wget $(CONFIG_GUESS_SRC) -O $@
    9.28 -	@chmod u+rwx,go+rx-w $@
    9.29 -
    9.30 -help-distrib::
    9.31 -	@echo  '  updatetools    - Update the config tools'
    9.32 -
    9.33 -distclean::
    9.34 -	@[ $(CT_TOP_DIR) = $(CT_LIB_DIR) ] || rm -rf $(CT_TOP_DIR)/tools
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/tools/tools.mk	Sun Jul 15 09:09:04 2007 +0000
    10.3 @@ -0,0 +1,31 @@
    10.4 +# Makefile for the tools/ sub-directory
    10.5 +
    10.6 +# Here, we can update the config.* scripts.
    10.7 +# If we're in CT_LIB_DIR, then CT_LIB_DIR == CT_TOP_DIR, and we can update those
    10.8 +# scripts for later inclusion mainline. If CT_LIB_DIR != CT_TOP_DIR, then those
    10.9 +# scripts are downloaded only for use in CT_TOP_DIR.
   10.10 +
   10.11 +CONFIG_SUB_SRC="http://cvs.savannah.gnu.org/viewcvs/*checkout*/config/config/config.sub"
   10.12 +CONFIG_SUB_DEST="$(CT_TOP_DIR)/tools/config.sub"
   10.13 +CONFIG_GUESS_SRC="http://cvs.savannah.gnu.org/viewcvs/*checkout*/config/config/config.guess"
   10.14 +CONFIG_GUESS_DEST="$(CT_TOP_DIR)/tools/config.guess"
   10.15 +
   10.16 +$(CT_TOP_DIR)/tools:
   10.17 +	@mkdir -p $(CT_TOP_DIR)/tools
   10.18 +
   10.19 +PHONY += updatetools
   10.20 +updatetools: $(CT_TOP_DIR)/tools $(CONFIG_SUB_DEST) $(CONFIG_GUESS_DEST)
   10.21 +
   10.22 +$(CONFIG_SUB_DEST):
   10.23 +	@wget $(CONFIG_SUB_SRC) -O $@
   10.24 +	@chmod u+rwx,go+rx-w $@
   10.25 +
   10.26 +$(CONFIG_GUESS_DEST):
   10.27 +	@wget $(CONFIG_GUESS_SRC) -O $@
   10.28 +	@chmod u+rwx,go+rx-w $@
   10.29 +
   10.30 +help-distrib::
   10.31 +	@echo  '  updatetools    - Update the config tools'
   10.32 +
   10.33 +distclean::
   10.34 +	@[ $(CT_TOP_DIR) = $(CT_LIB_DIR) ] || rm -rf $(CT_TOP_DIR)/tools