aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@free.fr>2012-05-07 21:37:59 +0200
committerYann E. MORIN" <yann.morin.1998@free.fr>2012-05-07 21:37:59 +0200
commit33a6cdd7ece062ebcf06c5660e88111300b2308f (patch)
tree9bb4df7100a44d3cc08c06bacbfbcca963019271
parent99a6ddf3be35bd49566cf3d0e942729696684a6e (diff)
downloadcrosstool-ng-33a6cdd7ece062ebcf06c5660e88111300b2308f.tar.gz
crosstool-ng-33a6cdd7ece062ebcf06c5660e88111300b2308f.tar.bz2
crosstool-ng-33a6cdd7ece062ebcf06c5660e88111300b2308f.zip
samples: rework show-tuple
Now that we are using defconfig files, the samples do not contain the full configuration, so we can not simply parse them to show their content. Instead, we must fake recalling a sample, and parse the generated .config file. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
-rw-r--r--samples/samples.mk11
-rwxr-xr-xscripts/showSamples.sh7
2 files changed, 11 insertions, 7 deletions
diff --git a/samples/samples.mk b/samples/samples.mk
index 411d97db..980ce5f3 100644
--- a/samples/samples.mk
+++ b/samples/samples.mk
@@ -36,13 +36,18 @@ help-env::
# Print the details of current configuration
PHONY += show-config
show-config: .config
- @export current_tuple=$(shell $(MAKE) -rf "$(CT_NG)" show-tuple ); \
- $(CT_LIB_DIR)/scripts/showSamples.sh -v current
+ @cp .config .config.sample
+ @$(CT_LIB_DIR)/scripts/showSamples.sh -v current
+ @rm -f .config.sample
# Prints the details of a sample
PHONY += $(patsubst %,show-%,$(CT_SAMPLES))
-$(patsubst %,show-%,$(CT_SAMPLES)):
+$(patsubst %,show-%,$(CT_SAMPLES)): config_files
+ @KCONFIG_CONFIG=$$(pwd)/.config.sample \
+ $(CONF) --defconfig=$(call sample_dir,$(patsubst show-%,%,$(@)))/crosstool.config \
+ $(KCONFIG_TOP) >/dev/null
@$(CT_LIB_DIR)/scripts/showSamples.sh -v $(patsubst show-%,%,$(@))
+ @rm -f .config.sample
# Prints the details of all samples
PHONY += show-all
diff --git a/scripts/showSamples.sh b/scripts/showSamples.sh
index 774794b1..ba32c3c6 100755
--- a/scripts/showSamples.sh
+++ b/scripts/showSamples.sh
@@ -14,7 +14,7 @@
export GREP_OPTIONS=
# Dump a single sample
-# Note: we can quite safely used the non-mangled .config.2
+# Note: we use the specific .config.sample config file
dump_single_sample() {
local verbose=0
local complibs
@@ -25,9 +25,8 @@ dump_single_sample() {
case "${sample}" in
current)
sample_type="l"
- sample="${current_tuple}"
+ sample="$( ${CT_NG} show-tuple )"
width="${#sample}"
- . $(pwd)/.config
;;
*) if [ -f "${CT_TOP_DIR}/samples/${sample}/crosstool.config" ]; then
sample_top="${CT_TOP_DIR}"
@@ -36,9 +35,9 @@ dump_single_sample() {
sample_top="${CT_LIB_DIR}"
sample_type="G"
fi
- . "${sample_top}/samples/${sample}/crosstool.config"
;;
esac
+ . $(pwd)/.config.sample
if [ -z "${wiki}" ]; then
t_width=14
printf "%-*s [%s" ${width} "${sample}" "${sample_type}"