Add a new help entry to list each samples more verbosely, but only on-demand.
/trunk/samples/samples.mk | 4 4 0 0 ++++
/trunk/scripts/showSamples.sh | 32 31 1 0 +++++++++++++++++++++++++++++++-
2 files changed, 35 insertions(+), 1 deletion(-)
1.1 --- a/samples/samples.mk Fri May 02 17:49:29 2008 +0000
1.2 +++ b/samples/samples.mk Fri May 02 21:49:43 2008 +0000
1.3 @@ -10,6 +10,7 @@
1.4 @echo ' saveconfig - Save current config as a preconfigured target'
1.5
1.6 help-samples::
1.7 + @echo ' show-samples - show a brief overview of each samples listed below:'
1.8 @$(CT_LIB_DIR)/scripts/showSamples.sh $(CT_SAMPLES)
1.9
1.10 help-build::
1.11 @@ -17,6 +18,9 @@
1.12 @echo ' regtest-local[.#] - Regtest-build all local samples'
1.13 @echo ' regtest-global[.#] - Regtest-build all global samples'
1.14
1.15 +show-samples:
1.16 + @$(CT_LIB_DIR)/scripts/showSamples.sh -v $(CT_SAMPLES)
1.17 +
1.18 # How we do build one sample
1.19 PHONY += $(CT_SAMPLES)
1.20 $(CT_SAMPLES):
2.1 --- a/scripts/showSamples.sh Fri May 02 17:49:29 2008 +0000
2.2 +++ b/scripts/showSamples.sh Fri May 02 21:49:43 2008 +0000
2.3 @@ -3,11 +3,16 @@
2.4 # Parses all samples on the command line, and for each of them, prints
2.5 # the versions of the main tools
2.6
2.7 +opt="$1"
2.8 +[ "${opt}" = "-v" ] && shift || opt=
2.9 +
2.10 # GREP_OPTIONS screws things up.
2.11 export GREP_OPTIONS=
2.12
2.13 # Dump a single sample
2.14 dump_single_sample() {
2.15 + local verbose=0
2.16 + [ "$1" = "-v" ] && verbose=1 && shift
2.17 local width="$1"
2.18 local sample="$2"
2.19 if [ -f "${CT_TOP_DIR}/samples/${sample}/crosstool.config" ]; then
2.20 @@ -20,6 +25,31 @@
2.21 printf " %-*s (%s" ${width} "${sample}" "${sample_type}"
2.22 [ -f "${sample_top}/samples/${sample}/broken" ] && printf ",broken"
2.23 echo ")"
2.24 + if [ ${verbose} -ne 0 ]; then
2.25 + . "${sample_top}/samples/${sample}/crosstool.config"
2.26 + echo " OS : ${CT_KERNEL}-${CT_KERNEL_VERSION}"
2.27 + echo " binutils : binutils-${CT_BINUTILS_VERSION}"
2.28 + echo -n " C compiler: ${CT_CC}-${CT_CC_VERSION} (C"
2.29 + [ "${CT_CC_LANG_CXX}" = "y" ] && echo -n ",C++"
2.30 + [ "${CT_CC_LANG_FORTRAN}" = "y" ] && echo -n ",Fortran"
2.31 + [ "${CT_CC_LANG_JAVA}" = "y" ] && echo -n ",Java"
2.32 + [ "${CT_CC_LANG_ADA}" = "y" ] && echo -n ",ADA"
2.33 + [ "${CT_CC_LANG_OBJC}" = "y" ] && echo -n ",Objective-C"
2.34 + [ "${CT_CC_LANG_OBJCXX}" = "y" ] && echo -n ",Objective-C++"
2.35 + [ -n "${CT_CC_LANG_OTHERS}" ] && echo -n ",$CT_CC_LANG_OTHERS}"
2.36 + echo ")"
2.37 + echo " C library : ${CT_LIBC}-${CT_LIBC_VERSION}"
2.38 + echo -n " Tools :"
2.39 + [ "${CT_LIBELF}" ] && echo -n " libelf-${CT_LIBELF_VERSION}"
2.40 + [ "${CT_SSTRIP}" ] && echo -n " sstrip"
2.41 + [ "${CT_DMALLOC}" ] && echo -n " dmalloc-${CT_DMALLOC_VERSION}"
2.42 + [ "${CT_DUMA}" ] && echo -n " duma-${CT_DUMA_VERSION}"
2.43 + [ "${CT_GDB}" ] && echo -n " gdb-${CT_GDB_VERSION}"
2.44 + [ "${CT_LTRACE}" ] && echo -n " ltrace-${CT_LTRACE_VERSION}"
2.45 + [ "${CT_STRACE}" ] && echo -n " strace-${CT_STRACE_VERSION}"
2.46 + echo
2.47 + echo
2.48 + fi
2.49 }
2.50
2.51 # Get largest sample width
2.52 @@ -29,5 +59,5 @@
2.53 done
2.54
2.55 for sample in "${@}"; do
2.56 - ( dump_single_sample ${width} "${sample}" )
2.57 + ( dump_single_sample ${opt} ${width} "${sample}" )
2.58 done