samples/samples.mk
changeset 3012 95173b196a88
parent 2982 1e35d2fa54d7
child 3168 9b991363c01c
     1.1 --- a/samples/samples.mk	Mon May 07 21:37:59 2012 +0200
     1.2 +++ b/samples/samples.mk	Mon Jul 23 22:02:23 2012 +0200
     1.3 @@ -44,7 +44,7 @@
     1.4  PHONY += $(patsubst %,show-%,$(CT_SAMPLES))
     1.5  $(patsubst %,show-%,$(CT_SAMPLES)): config_files
     1.6  	@KCONFIG_CONFIG=$$(pwd)/.config.sample	\
     1.7 -	    $(CONF) --defconfig=$(call sample_dir,$(patsubst show-%,%,$(@)))/crosstool.config \
     1.8 +	    $(CONF) --defconfig=$(call sample_dir,$(patsubst show-%,%,$(@)))/crosstool.config   \
     1.9  	            $(KCONFIG_TOP) >/dev/null
    1.10  	@$(CT_LIB_DIR)/scripts/showSamples.sh -v $(patsubst show-%,%,$(@))
    1.11  	@rm -f .config.sample
    1.12 @@ -55,18 +55,45 @@
    1.13  
    1.14  # print the list of all available samples
    1.15  PHONY += list-samples
    1.16 -list-samples: FORCE
    1.17 -	$(SILENT)$(CT_LIB_DIR)/scripts/showSamples.sh $(CT_SAMPLES)
    1.18 +list-samples: list-samples-pre $(patsubst %,list-%,$(CT_SAMPLES))
    1.19 +	@echo ' L (Local)       : sample was found in current directory'
    1.20 +	@echo ' G (Global)      : sample was installed with crosstool-NG'
    1.21 +	@echo ' X (EXPERIMENTAL): sample may use EXPERIMENTAL features'
    1.22 +	@echo ' B (BROKEN)      : sample is currently broken'
    1.23 +
    1.24 +PHONY += list-samples-pre
    1.25 +list-samples-pre: FORCE
    1.26 +	@echo 'Status  Sample name'
    1.27 +
    1.28 +PHONY += $(patsubst %,list-%,$(CT_SAMPLES))
    1.29 +$(patsubst %,list-%,$(CT_SAMPLES)): config_files
    1.30 +	@KCONFIG_CONFIG=$$(pwd)/.config.sample	\
    1.31 +	    $(CONF) --defconfig=$(call sample_dir,$(patsubst list-%,%,$(@)))/crosstool.config   \
    1.32 +	            $(KCONFIG_TOP) >/dev/null
    1.33 +	@$(CT_LIB_DIR)/scripts/showSamples.sh $(patsubst list-%,%,$(@))
    1.34 +	@rm -f .config.sample
    1.35  
    1.36  PHONY += list-samples-short
    1.37  list-samples-short: FORCE
    1.38  	$(SILENT)for s in $(CT_SAMPLES); do \
    1.39 -	    printf "$${s}\n";               \
    1.40 +	    printf "%s\n" "$${s}";          \
    1.41  	done
    1.42  
    1.43  PHONY += wiki-samples
    1.44 -wiki-samples:
    1.45 -	$(SILENT)$(CT_LIB_DIR)/scripts/showSamples.sh -w $(CT_SAMPLES)
    1.46 +wiki-samples: wiki-samples-pre $(patsubst %,wiki-%,$(CT_SAMPLES)) wiki-samples-post
    1.47 +
    1.48 +wiki-samples-pre: FORCE
    1.49 +	$(SILENT)$(CT_LIB_DIR)/scripts/showSamples.sh -w
    1.50 +
    1.51 +wiki-samples-post: FORCE
    1.52 +	$(SILENT)$(CT_LIB_DIR)/scripts/showSamples.sh -W $(CT_SAMPLES)
    1.53 +
    1.54 +$(patsubst %,wiki-%,$(CT_SAMPLES)): config_files
    1.55 +	$(SILENT)KCONFIG_CONFIG=$$(pwd)/.config.sample	\
    1.56 +	    $(CONF) --defconfig=$(call sample_dir,$(patsubst wiki-%,%,$(@)))/crosstool.config   \
    1.57 +	            $(KCONFIG_TOP) >/dev/null
    1.58 +	$(SILENT)$(CT_LIB_DIR)/scripts/showSamples.sh -w $(patsubst wiki-%,%,$(@))
    1.59 +	$(SILENT)rm -f .config.sample
    1.60  
    1.61  # ----------------------------------------------------------
    1.62  # This part deals with saving/restoring samples