summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@free.fr>2013-01-21 23:32:38 (GMT)
committerYann E. MORIN" <yann.morin.1998@free.fr>2013-01-21 23:32:38 (GMT)
commitd82f1c6f2a86707ebcfe134cb600b382cb00cc65 (patch)
treefd790fbd400eb366d70e610d692c4f1229d86ecc /samples
parent5e9d4ba24f44ed6f0adb205761ccc28440a1d086 (diff)
samples: check if update is needed
Add a ct-ng action to check if samples needs being updated. This will be usefull when the config options change. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Diffstat (limited to 'samples')
-rw-r--r--samples/samples.mk16
1 files changed, 16 insertions, 0 deletions
diff --git a/samples/samples.mk b/samples/samples.mk
index f4b2554..7608dce 100644
--- a/samples/samples.mk
+++ b/samples/samples.mk
@@ -79,6 +79,22 @@ list-samples-short: FORCE
printf "%s\n" "$${s}"; \
done
+# Check one sample
+PHONY += $(patsubst %,check-%,$(CT_SAMPLES))
+$(patsubst %,check-%,$(CT_SAMPLES)): config_files
+ @export KCONFIG_CONFIG=$$(pwd)/.config.sample; \
+ CT_NG_SAMPLE=$(call sample_dir,$(patsubst check-%,%,$(@)))/crosstool.config; \
+ $(CONF) --defconfig=$${CT_NG_SAMPLE} $(KCONFIG_TOP) >/dev/null; \
+ $(CONF) --savedefconfig=$$(pwd)/.defconfig $(KCONFIG_TOP) >/dev/null; \
+ old_sha1=$$( sha1sum "$${CT_NG_SAMPLE}" |cut -d ' ' -f 1 ); \
+ new_sha1=$$( sha1sum .defconfig |cut -d ' ' -f 1 ); \
+ if [ $${old_sha1} != $${new_sha1} ]; then \
+ echo "$(patsubst check-%,%,$(@)) needs update"; \
+ fi
+ @rm -f .config.sample* .defconfig
+
+check-samples: $(patsubst %,check-%,$(CT_SAMPLES))
+
PHONY += wiki-samples
wiki-samples: wiki-samples-pre $(patsubst %,wiki-%,$(CT_SAMPLES)) wiki-samples-post