151 ifeq ($$(lastword $$($1_REPLACEMENTS)), ;) |
151 ifeq ($$(lastword $$($1_REPLACEMENTS)), ;) |
152 $1_REPLACEMENTS += DUMMY_REPLACEMENT => DUMMY_REPLACEMENT |
152 $1_REPLACEMENTS += DUMMY_REPLACEMENT => DUMMY_REPLACEMENT |
153 endif |
153 endif |
154 |
154 |
155 # Convert the REPLACEMENTS syntax ( A => B ; C => D ; ...) to a sed command |
155 # Convert the REPLACEMENTS syntax ( A => B ; C => D ; ...) to a sed command |
156 # line (-e "s/A/B/" -e "s/C/D/" ...), basically by replacing '=>' with '/' |
156 # line (-e "s/A/B/g" -e "s/C/D/g" ...), basically by replacing '=>' with '/' |
157 # and ';' with '/" -e "s/', and adjusting for edge cases. |
157 # and ';' with '/g" -e "s/', and adjusting for edge cases. |
158 $1_REPLACEMENTS_COMMAND_LINE := $(SED) -e 's$$($1_SEP)$$(subst $$(SPACE);$$(SPACE),$$($1_SEP)' \ |
158 $1_REPLACEMENTS_COMMAND_LINE := $(SED) -e 's$$($1_SEP)$$(subst $$(SPACE);$$(SPACE),$$($1_SEP)g' \ |
159 -e 's$$($1_SEP),$$(subst $$(SPACE)=>$$(SPACE),$$($1_SEP),$$(subst $$(SPACE)=>$$(SPACE);$$(SPACE),$$($1_SEP)$$($1_SEP)' \ |
159 -e 's$$($1_SEP),$$(subst $$(SPACE)=>$$(SPACE),$$($1_SEP),$$(subst $$(SPACE)=>$$(SPACE);$$(SPACE),$$($1_SEP)$$($1_SEP)g' \ |
160 -e 's$$($1_SEP),$$(strip $$($1_REPLACEMENTS)))))$$($1_SEP)' |
160 -e 's$$($1_SEP),$$(strip $$($1_REPLACEMENTS)))))$$($1_SEP)g' |
161 else |
161 else |
162 # We don't have any replacements, just pipe the file through cat. |
162 # We don't have any replacements, just pipe the file through cat. |
163 $1_REPLACEMENTS_COMMAND_LINE := $(CAT) |
163 $1_REPLACEMENTS_COMMAND_LINE := $(CAT) |
164 endif |
164 endif |
165 |
165 |