# HG changeset patch # User "Yann E. MORIN" # Date 1178621854 0 # Node ID 7987069e8312b6aa311f0efcd9aa65864f4121ee # Parent b8924cbdca26ba0331115c9f08050c5eb567c96b Print the major components and their version when calling "make help". diff -r b8924cbdca26 -r 7987069e8312 samples/Makefile --- a/samples/Makefile Tue May 08 10:52:39 2007 +0000 +++ b/samples/Makefile Tue May 08 10:57:34 2007 +0000 @@ -1,16 +1,14 @@ # Build a list of all available samples -SAMPLES = $(patsubst $(CT_TOP_DIR)/samples/%,%,$(filter-out %Makefile,$(wildcard $(CT_TOP_DIR)/samples/*))) +CT_SAMPLES = $(patsubst $(CT_TOP_DIR)/samples/%/crosstool.config,%,$(filter-out %Makefile,$(wildcard $(CT_TOP_DIR)/samples/*/crosstool.config))) .PHONY: $(SAMPLES) -$(SAMPLES): +$(CT_SAMPLES): @cp "$(CT_TOP_DIR)/samples/$(@)/crosstool.config" "$(CT_TOP_DIR)/.config" @$(MAKE) oldconfig help:: @echo 'Preconfigured targets:' - @for s in $(SAMPLES); do \ - echo " $${s}"; \ - done + @$(CT_TOP_DIR)/scripts/showSamples.sh $(CT_SAMPLES) @echo '' saveconfig: diff -r b8924cbdca26 -r 7987069e8312 scripts/showSamples.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/showSamples.sh Tue May 08 10:57:34 2007 +0000 @@ -0,0 +1,30 @@ +#!/bin/bash + +# Parses all samples on the command line, and for each of them, prints +# the versions of the main tools + +# GREP_OPTIONS screws things up. +export GREP_OPTIONS= + +# Dump a single sample +dump_single_sample() { + local width="$1" + local sample="$2" + . "${CT_TOP_DIR}/samples/${sample}/crosstool.config" + # Build the components string + local str="${CT_KERNEL}-${CT_KERNEL_VERSION}" + str="${str} binutils-${CT_BINUTILS_VERSION}" + str="${str} ${CT_CC}-${CT_CC_VERSION}" + str="${str} ${CT_LIBC}-${CT_LIBC_VERSION}" + printf " %-*s - %s\n" ${width} "${sample}" "${str}" +} + +# Get largest sample width +width=0 +for sample in "${@}"; do + [ ${#sample} -gt ${width} ] && width=${#sample} +done + +for sample in "${@}"; do + ( dump_single_sample ${width} "${sample}" ) +done