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(-)
This commit is contained in:
Yann E. MORIN" 2009-05-13 18:10:47 +00:00
parent 1c1d672f87
commit e89072b5a5
4 changed files with 43 additions and 3 deletions

View File

@ -102,7 +102,7 @@ uninstall: real-uninstall
#-------------------------------------- #--------------------------------------
# Build rules # 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 $^ @chmod 755 $^
build-lib: paths.mk build-lib: paths.mk
@ -151,6 +151,8 @@ clean-bin:
@rm -f scripts/crosstool-NG.sh @rm -f scripts/crosstool-NG.sh
@echo " RM 'script/saveSample.sh'" @echo " RM 'script/saveSample.sh'"
@rm -f scripts/saveSample.sh @rm -f scripts/saveSample.sh
@echo " RM 'script/showTuple.sh'"
@rm -f scripts/showTuple.sh
clean-lib: clean-lib:
@echo " RM 'paths.mk'" @echo " RM 'paths.mk'"

View File

@ -16,7 +16,7 @@ _ct-ng () {
actions='help menuconfig oldconfig saveconfig actions='help menuconfig oldconfig saveconfig
build build. build-all build-all. build build. build-all build-all.
list-samples list-steps list-samples list-steps show-tuple
clean distclean wiki-samples updatetools clean distclean wiki-samples updatetools
tarball version' tarball version'

View File

@ -111,6 +111,9 @@ include $(CT_LIB_DIR)/steps.mk
include $(CT_LIB_DIR)/samples/samples.mk include $(CT_LIB_DIR)/samples/samples.mk
include $(CT_LIB_DIR)/scripts/scripts.mk include $(CT_LIB_DIR)/scripts/scripts.mk
help-config::
@echo ' show-tuple - Print the tuple of the currently configured toolchain'
help-distrib:: help-distrib::
@echo ' tarball - Build a tarball of the configured toolchain' @echo ' tarball - Build a tarball of the configured toolchain'
@ -119,9 +122,14 @@ help-env::
# End help system # End help system
.config: .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 @false
show-tuple: .config
$(SILENT)$(bash) $(CT_LIB_DIR)/scripts/showTuple.sh
# Actual build # Actual build
build: .config build: .config
$(SILENT)$(CT_LIB_DIR)/scripts/crosstool-NG.sh $(SILENT)$(CT_LIB_DIR)/scripts/crosstool-NG.sh

30
scripts/showTuple.sh.in Normal file
View File

@ -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