summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@free.fr>2012-07-23 20:02:23 (GMT)
committerYann E. MORIN" <yann.morin.1998@free.fr>2012-07-23 20:02:23 (GMT)
commit542bb1840957690d306b21d9b1f54705e655f5a6 (patch)
treef1e39cc634f9b9d41bc9fdddfda509f85a5fe57e /samples
parenta427e20308c1bcd640377d75120d90a4e9194c25 (diff)
scripts+samples: fix listings the samples
Since we use defconfigs to save the samples, listing all the samples can no longer be done by passing all the sample names at one to the script; we need to pass them one-by-one after we expand the sample's defconfig ibnto a complete .config. Reported-by: Bryan Hundven <bryanhundven@gmail.com> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Diffstat (limited to 'samples')
-rw-r--r--samples/samples.mk39
1 files changed, 33 insertions, 6 deletions
diff --git a/samples/samples.mk b/samples/samples.mk
index 980ce5f..f4b2554 100644
--- a/samples/samples.mk
+++ b/samples/samples.mk
@@ -44,7 +44,7 @@ show-config: .config
PHONY += $(patsubst %,show-%,$(CT_SAMPLES))
$(patsubst %,show-%,$(CT_SAMPLES)): config_files
@KCONFIG_CONFIG=$$(pwd)/.config.sample \
- $(CONF) --defconfig=$(call sample_dir,$(patsubst show-%,%,$(@)))/crosstool.config \
+ $(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
@@ -55,18 +55,45 @@ show-all: $(patsubst %,show-%,$(CT_SAMPLES))
# print the list of all available samples
PHONY += list-samples
-list-samples: FORCE
- $(SILENT)$(CT_LIB_DIR)/scripts/showSamples.sh $(CT_SAMPLES)
+list-samples: list-samples-pre $(patsubst %,list-%,$(CT_SAMPLES))
+ @echo ' L (Local) : sample was found in current directory'
+ @echo ' G (Global) : sample was installed with crosstool-NG'
+ @echo ' X (EXPERIMENTAL): sample may use EXPERIMENTAL features'
+ @echo ' B (BROKEN) : sample is currently broken'
+
+PHONY += list-samples-pre
+list-samples-pre: FORCE
+ @echo 'Status Sample name'
+
+PHONY += $(patsubst %,list-%,$(CT_SAMPLES))
+$(patsubst %,list-%,$(CT_SAMPLES)): config_files
+ @KCONFIG_CONFIG=$$(pwd)/.config.sample \
+ $(CONF) --defconfig=$(call sample_dir,$(patsubst list-%,%,$(@)))/crosstool.config \
+ $(KCONFIG_TOP) >/dev/null
+ @$(CT_LIB_DIR)/scripts/showSamples.sh $(patsubst list-%,%,$(@))
+ @rm -f .config.sample
PHONY += list-samples-short
list-samples-short: FORCE
$(SILENT)for s in $(CT_SAMPLES); do \
- printf "$${s}\n"; \
+ printf "%s\n" "$${s}"; \
done
PHONY += wiki-samples
-wiki-samples:
- $(SILENT)$(CT_LIB_DIR)/scripts/showSamples.sh -w $(CT_SAMPLES)
+wiki-samples: wiki-samples-pre $(patsubst %,wiki-%,$(CT_SAMPLES)) wiki-samples-post
+
+wiki-samples-pre: FORCE
+ $(SILENT)$(CT_LIB_DIR)/scripts/showSamples.sh -w
+
+wiki-samples-post: FORCE
+ $(SILENT)$(CT_LIB_DIR)/scripts/showSamples.sh -W $(CT_SAMPLES)
+
+$(patsubst %,wiki-%,$(CT_SAMPLES)): config_files
+ $(SILENT)KCONFIG_CONFIG=$$(pwd)/.config.sample \
+ $(CONF) --defconfig=$(call sample_dir,$(patsubst wiki-%,%,$(@)))/crosstool.config \
+ $(KCONFIG_TOP) >/dev/null
+ $(SILENT)$(CT_LIB_DIR)/scripts/showSamples.sh -w $(patsubst wiki-%,%,$(@))
+ $(SILENT)rm -f .config.sample
# ----------------------------------------------------------
# This part deals with saving/restoring samples