diff options
author | Alexey Neyman <stilor@att.net> | 2015-10-28 18:12:03 -0700 |
---|---|---|
committer | Alexey Neyman <stilor@att.net> | 2015-10-30 16:24:52 -0700 |
commit | b36e00212458309335f939cda6ba92de94068dec (patch) | |
tree | c997bfee234ddc639801022762a1b52b2cf05563 /samples | |
parent | 1d6bed6254ac819ef7b6deb653053024311ec5be (diff) | |
download | crosstool-ng-b36e00212458309335f939cda6ba92de94068dec.tar.gz crosstool-ng-b36e00212458309335f939cda6ba92de94068dec.tar.bz2 crosstool-ng-b36e00212458309335f939cda6ba92de94068dec.zip |
Avoid commas in autogenerated CT_PREFIX_DIR.
Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'samples')
-rw-r--r-- | samples/samples.mk | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/samples/samples.mk b/samples/samples.mk index 35f34354..b3542f6d 100644 --- a/samples/samples.mk +++ b/samples/samples.mk @@ -164,13 +164,20 @@ $(CT_SAMPLES): config_files # ---------------------------------------------------------- # Some helper functions +# Construct a CT_PREFIX_DIR path from the sample name. Sample names use +# comma as a separator between host and target triplets in canadian cross +# configurations, but ct-ng does not allow commas in the path. Substitute +# with = (equal sign). +# $1: sample +__comma = , +prefix_dir = $(CT_PREFIX)/$(subst $(__comma),=,$(1)) + # Create the rule to build a sample -# $1: sample tuple -# $2: prefix +# $1: sample name (target tuple, or host/target tuples separated by a comma) define build_sample @$(ECHO) ' CONF $(1)' $(SILENT)$(CONF) -s --defconfig=$(call sample_dir,$(1))/crosstool.config $(KCONFIG_TOP) - $(SILENT)$(sed) -i -r -e 's:^(CT_PREFIX_DIR=).*$$:\1"$(2)":;' .config + $(SILENT)$(sed) -i -r -e 's:^(CT_PREFIX_DIR=).*$$:\1"$(call prefix_dir,$(1))":;' .config $(SILENT)$(sed) -i -r -e 's:^.*(CT_LOG_(WARN|INFO|EXTRA|DEBUG|ALL)).*$$:# \1 is not set:;' .config $(SILENT)$(sed) -i -r -e 's:^.*(CT_LOG_ERROR).*$$:\1=y:;' .config $(SILENT)$(sed) -i -r -e 's:^(CT_LOG_LEVEL_MAX)=.*$$:\1="ERROR":;' .config @@ -197,8 +204,8 @@ endif # MAKECMDGOALS contains a build sample rule endif # MAKECMDGOALS != "" # Build a single sample -$(patsubst %,build-%,$(CT_SAMPLES)): config_files - $(call build_sample,$(patsubst build-%,%,$@),$(CT_PREFIX)/$(patsubst build-%,%,$@)) +$(patsubst %,build-%,$(CT_SAMPLES)): build-%: config_files + $(call build_sample,$*) # Build al samples build-all: $(patsubst %,build-%,$(CT_SAMPLES)) |