summaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2008-10-27 18:42:26 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2008-10-27 18:42:26 (GMT)
commitb47644382215f43f96b3957b127e92caa9d33f80 (patch)
tree66ba460bc4125e1570febe965fd4facff050dc8f /samples
parent84fe3f42e282437971eecd158f93e76554b7bb22 (diff)
Enhance the make fragments:
- comment the different parts - re-order the code so that it is homogeneous amogst fragments - eye-candy in some existing comments /trunk/tools/tools.mk | 17 15 2 0 +++++++++++++++-- /trunk/steps.mk | 38 26 12 0 ++++++++++++++++++++++++++------------ /trunk/samples/samples.mk | 41 28 13 0 ++++++++++++++++++++++++++++------------- /trunk/config/config.mk | 2 1 1 0 +- 4 files changed, 70 insertions(+), 28 deletions(-)
Diffstat (limited to 'samples')
-rw-r--r--samples/samples.mk41
1 files changed, 28 insertions, 13 deletions
diff --git a/samples/samples.mk b/samples/samples.mk
index ab8fdb7..6ac80dd 100644
--- a/samples/samples.mk
+++ b/samples/samples.mk
@@ -1,11 +1,14 @@
# Makefile to manage samples
+# ----------------------------------------------------------
# Build the list of available samples
CT_TOP_SAMPLES := $(patsubst $(CT_TOP_DIR)/samples/%/crosstool.config,%,$(wildcard $(CT_TOP_DIR)/samples/*/crosstool.config))
CT_LIB_SAMPLES := $(filter-out $(CT_TOP_SAMPLES),$(patsubst $(CT_LIB_DIR)/samples/%/crosstool.config,%,$(wildcard $(CT_LIB_DIR)/samples/*/crosstool.config)))
-
CT_SAMPLES := $(sort $(CT_TOP_SAMPLES) $(CT_LIB_SAMPLES))
+# ----------------------------------------------------------
+# This part deals with the samples help entries
+
help-config::
@echo ' saveconfig - Save current config as a preconfigured target'
@@ -23,13 +26,35 @@ help-build::
help-distrib::
@echo ' wiki-samples - Print a DokuWiki table of samples'
+# ----------------------------------------------------------
+# This part deals with printing samples information
+
+# Prints the details of a sample
+PHONY += $(patsubst %,show-%,$(CT_SAMPLES))
$(patsubst %,show-%,$(CT_SAMPLES)):
@$(CT_LIB_DIR)/scripts/showSamples.sh -v $(patsubst show-%,%,$(@))
+# print the list of all available samples
PHONY += list-samples
list-samples: .FORCE
@echo $(CT_SAMPLES) |sed -r -e 's/ /\n/g;' |sort
+wiki-samples:
+ $(SILENT)$(CT_LIB_DIR)/scripts/showSamples.sh -w $(CT_SAMPLES)
+
+# ----------------------------------------------------------
+# This part deals with saving/restoring samples
+
+# Save a sample
+saveconfig:
+ $(SILENT)$(CT_LIB_DIR)/scripts/saveSample.sh
+
+# The 'sample_dir' function prints the directory in which the sample is,
+# searching first in local samples, then in global samples
+define sample_dir
+$$( [ -d $(CT_TOP_DIR)/samples/$(1) ] && echo "$(CT_TOP_DIR)/samples/$(1)" || echo "$(CT_LIB_DIR)/samples/$(1)")
+endef
+
# How we do recall one sample
PHONY += $(CT_SAMPLES)
$(CT_SAMPLES):
@@ -61,13 +86,9 @@ $(CT_SAMPLES):
@echo
@echo 'Now configured for "$@"'
-# The 'sample_dir' function prints the directory in which the sample is,
-# searching first in local samples, then in global samples
-define sample_dir
-$$( [ -d $(CT_TOP_DIR)/samples/$(1) ] && echo "$(CT_TOP_DIR)/samples/$(1)" || echo "$(CT_LIB_DIR)/samples/$(1)")
-endef
-
+# ----------------------------------------------------------
# And now for building all samples one after the other
+
PHONY += regtest regtest_local regtest_global
regtest: regtest-local regtest-global
@@ -107,9 +128,3 @@ $(patsubst %,regtest_%,$(CT_SAMPLES)):
echo -e "\rCleaning sample \"$${samp}\"" ; \
$(CT_NG) distclean ; \
echo -e "\r"
-
-saveconfig:
- $(SILENT)$(CT_LIB_DIR)/scripts/saveSample.sh
-
-wiki-samples:
- $(SILENT)$(CT_LIB_DIR)/scripts/showSamples.sh -w $(CT_SAMPLES)