# HG changeset patch # User "Yann E. MORIN" # Date 1242238247 0 # Node ID bc8b9381f637a45bdf508d9c5809a2f29ce24da5 # Parent 4a5540d3a3011dbcd0873fac150117b38084697b Add a new action: show-tuple - in a directory containing a crosstool-NG configuration, prints the tuple of the configured target to stdout. -------- diffstat follows -------- /trunk/Makefile.in | 4 3 1 0 +++- /trunk/scripts/showTuple.sh.in | 30 30 0 0 ++++++++++++++++++++++++++++++ /trunk/ct-ng.comp | 2 1 1 0 +- /trunk/ct-ng.in | 10 9 1 0 +++++++++- 4 files changed, 43 insertions(+), 3 deletions(-) diff -r 4a5540d3a301 -r bc8b9381f637 Makefile.in --- a/Makefile.in Tue May 12 06:07:41 2009 +0000 +++ b/Makefile.in Wed May 13 18:10:47 2009 +0000 @@ -102,7 +102,7 @@ #-------------------------------------- # Build rules -build-bin: ct-ng scripts/crosstool-NG.sh scripts/saveSample.sh +build-bin: ct-ng scripts/crosstool-NG.sh scripts/saveSample.sh scripts/showTuple.sh @chmod 755 $^ build-lib: paths.mk @@ -151,6 +151,8 @@ @rm -f scripts/crosstool-NG.sh @echo " RM 'script/saveSample.sh'" @rm -f scripts/saveSample.sh + @echo " RM 'script/showTuple.sh'" + @rm -f scripts/showTuple.sh clean-lib: @echo " RM 'paths.mk'" diff -r 4a5540d3a301 -r bc8b9381f637 ct-ng.comp --- a/ct-ng.comp Tue May 12 06:07:41 2009 +0000 +++ b/ct-ng.comp Wed May 13 18:10:47 2009 +0000 @@ -16,7 +16,7 @@ actions='help menuconfig oldconfig saveconfig build build. build-all build-all. - list-samples list-steps + list-samples list-steps show-tuple clean distclean wiki-samples updatetools tarball version' diff -r 4a5540d3a301 -r bc8b9381f637 ct-ng.in --- a/ct-ng.in Tue May 12 06:07:41 2009 +0000 +++ b/ct-ng.in Wed May 13 18:10:47 2009 +0000 @@ -111,6 +111,9 @@ include $(CT_LIB_DIR)/samples/samples.mk include $(CT_LIB_DIR)/scripts/scripts.mk +help-config:: + @echo ' show-tuple - Print the tuple of the currently configured toolchain' + help-distrib:: @echo ' tarball - Build a tarball of the configured toolchain' @@ -119,9 +122,14 @@ # End help system .config: - @echo ' There is no existing .config file!' + @echo "There is no existing .config file!" + @echo "You need to either run 'menuconfig'," + @echo "or configure an existing sample." @false +show-tuple: .config + $(SILENT)$(bash) $(CT_LIB_DIR)/scripts/showTuple.sh + # Actual build build: .config $(SILENT)$(CT_LIB_DIR)/scripts/crosstool-NG.sh diff -r 4a5540d3a301 -r bc8b9381f637 scripts/showTuple.sh.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/showTuple.sh.in Wed May 13 18:10:47 2009 +0000 @@ -0,0 +1,30 @@ +#!@@CT_bash@@ + +# What we need: +# - the .config file + +# Parse the tools' paths configuration +. "${CT_LIB_DIR}/paths.mk" + +# We'll need the stdout later, save it +exec 7>&1 + +# Parse the common functions +. "${CT_LIB_DIR}/scripts/functions" + +# Don't care about any log file +exec >/dev/null +rm -f "${tmp_log_file}" + +# Parse the configuration file +. .config + +# Parse architecture and kernel specific functions +. "${CT_LIB_DIR}/scripts/build/arch/${CT_ARCH}.sh" +. "${CT_LIB_DIR}/scripts/build/kernel/${CT_KERNEL}.sh" + +# Build CT_TARGET +CT_DoBuildTargetTuple + +# All this for this single echo... :-( Sigh, I'll have to re-arrange things... +echo "${CT_TARGET}" >&7