summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2008-05-02 21:49:43 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2008-05-02 21:49:43 (GMT)
commit8739aa7574ecfca1b0364b8f03c1f3f0e19c0434 (patch)
tree6da4ad5041e11f75aa2fdc5035e267f4951409a4
parentbf3d5df0ff6ec25761714c7dcded7c9a7db5db20 (diff)
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(-)
-rw-r--r--samples/samples.mk4
-rwxr-xr-xscripts/showSamples.sh32
2 files changed, 35 insertions, 1 deletions
diff --git a/samples/samples.mk b/samples/samples.mk
index 05a0547..73eff04 100644
--- a/samples/samples.mk
+++ b/samples/samples.mk
@@ -10,6 +10,7 @@ help-config::
@echo ' saveconfig - Save current config as a preconfigured target'
help-samples::
+ @echo ' show-samples - show a brief overview of each samples listed below:'
@$(CT_LIB_DIR)/scripts/showSamples.sh $(CT_SAMPLES)
help-build::
@@ -17,6 +18,9 @@ help-build::
@echo ' regtest-local[.#] - Regtest-build all local samples'
@echo ' regtest-global[.#] - Regtest-build all global samples'
+show-samples:
+ @$(CT_LIB_DIR)/scripts/showSamples.sh -v $(CT_SAMPLES)
+
# How we do build one sample
PHONY += $(CT_SAMPLES)
$(CT_SAMPLES):
diff --git a/scripts/showSamples.sh b/scripts/showSamples.sh
index f814940..c15c20c 100755
--- a/scripts/showSamples.sh
+++ b/scripts/showSamples.sh
@@ -3,11 +3,16 @@
# Parses all samples on the command line, and for each of them, prints
# the versions of the main tools
+opt="$1"
+[ "${opt}" = "-v" ] && shift || opt=
+
# GREP_OPTIONS screws things up.
export GREP_OPTIONS=
# Dump a single sample
dump_single_sample() {
+ local verbose=0
+ [ "$1" = "-v" ] && verbose=1 && shift
local width="$1"
local sample="$2"
if [ -f "${CT_TOP_DIR}/samples/${sample}/crosstool.config" ]; then
@@ -20,6 +25,31 @@ dump_single_sample() {
printf " %-*s (%s" ${width} "${sample}" "${sample_type}"
[ -f "${sample_top}/samples/${sample}/broken" ] && printf ",broken"
echo ")"
+ if [ ${verbose} -ne 0 ]; then
+ . "${sample_top}/samples/${sample}/crosstool.config"
+ echo " OS : ${CT_KERNEL}-${CT_KERNEL_VERSION}"
+ echo " binutils : binutils-${CT_BINUTILS_VERSION}"
+ echo -n " C compiler: ${CT_CC}-${CT_CC_VERSION} (C"
+ [ "${CT_CC_LANG_CXX}" = "y" ] && echo -n ",C++"
+ [ "${CT_CC_LANG_FORTRAN}" = "y" ] && echo -n ",Fortran"
+ [ "${CT_CC_LANG_JAVA}" = "y" ] && echo -n ",Java"
+ [ "${CT_CC_LANG_ADA}" = "y" ] && echo -n ",ADA"
+ [ "${CT_CC_LANG_OBJC}" = "y" ] && echo -n ",Objective-C"
+ [ "${CT_CC_LANG_OBJCXX}" = "y" ] && echo -n ",Objective-C++"
+ [ -n "${CT_CC_LANG_OTHERS}" ] && echo -n ",$CT_CC_LANG_OTHERS}"
+ echo ")"
+ echo " C library : ${CT_LIBC}-${CT_LIBC_VERSION}"
+ echo -n " Tools :"
+ [ "${CT_LIBELF}" ] && echo -n " libelf-${CT_LIBELF_VERSION}"
+ [ "${CT_SSTRIP}" ] && echo -n " sstrip"
+ [ "${CT_DMALLOC}" ] && echo -n " dmalloc-${CT_DMALLOC_VERSION}"
+ [ "${CT_DUMA}" ] && echo -n " duma-${CT_DUMA_VERSION}"
+ [ "${CT_GDB}" ] && echo -n " gdb-${CT_GDB_VERSION}"
+ [ "${CT_LTRACE}" ] && echo -n " ltrace-${CT_LTRACE_VERSION}"
+ [ "${CT_STRACE}" ] && echo -n " strace-${CT_STRACE_VERSION}"
+ echo
+ echo
+ fi
}
# Get largest sample width
@@ -29,5 +59,5 @@ for sample in "${@}"; do
done
for sample in "${@}"; do
- ( dump_single_sample ${width} "${sample}" )
+ ( dump_single_sample ${opt} ${width} "${sample}" )
done