diff options
author | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2009-05-13 18:10:47 (GMT) |
---|---|---|
committer | Yann E. MORIN" <yann.morin.1998@anciens.enib.fr> | 2009-05-13 18:10:47 (GMT) |
commit | e89072b5a5922a08bcf3f1f10f3bd12806918f23 (patch) | |
tree | d48438023543db61b9e8c1efe01127293cf1130a | |
parent | 1c1d672f87c1fbf0428486f0eeb4f2791483570a (diff) |
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(-)
-rw-r--r-- | Makefile.in | 4 | ||||
-rw-r--r-- | ct-ng.comp | 2 | ||||
-rw-r--r-- | ct-ng.in | 10 | ||||
-rw-r--r-- | scripts/showTuple.sh.in | 30 |
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'" @@ -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' @@ -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 |