From e89072b5a5922a08bcf3f1f10f3bd12806918f23 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Wed, 13 May 2009 18:10:47 +0000 Subject: 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 --git a/Makefile.in b/Makefile.in index cb2bf42..2bef451 100644 --- a/Makefile.in +++ b/Makefile.in @@ -102,7 +102,7 @@ uninstall: real-uninstall #-------------------------------------- # 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 @@ clean-bin: @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 --git a/ct-ng.comp b/ct-ng.comp index b0e0dc8..6eaf2bf 100644 --- a/ct-ng.comp +++ b/ct-ng.comp @@ -16,7 +16,7 @@ _ct-ng () { 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 --git a/ct-ng.in b/ct-ng.in index 814d3eb..1e23cae 100644 --- a/ct-ng.in +++ b/ct-ng.in @@ -111,6 +111,9 @@ include $(CT_LIB_DIR)/steps.mk 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 @@ help-env:: # 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 --git a/scripts/showTuple.sh.in b/scripts/showTuple.sh.in new file mode 100644 index 0000000..c7df08c --- /dev/null +++ b/scripts/showTuple.sh.in @@ -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 -- cgit v0.10.2-6-g49f6