From 542bb1840957690d306b21d9b1f54705e655f5a6 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Mon, 23 Jul 2012 22:02:23 +0200 Subject: 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 Signed-off-by: "Yann E. MORIN" --- samples/samples.mk | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) (limited to 'samples') diff --git a/samples/samples.mk b/samples/samples.mk index 980ce5f3..f4b2554b 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 -- cgit v1.2.3