I need the xpi_hash
variable to be assigned only when update target's command is decided to execute. Then I'm using this variable as environment, exporting, etc..
If I put it outside of rule, it will be expanded firstly, before $(xpi)
target is called, hence will not find that file.
substitute := perl -p -e 's/@([^@]+)@/$$ENV{$$1} bla bla...
export xpi_hash
.PHONY: dirs substitute update
update: $(xpi) $(target_update_rdf)
xpi_hash := $(shell sha1sum $(xpi) | grep -Eow '^[^ ]+')
@echo "Updating..."
$(target_update_rdf): $(update_rdf)
$(substitute) $< > $@
and above of course is not correct, because for command part the shell is represented. So maybe another way to put this question is - how to bring variable as command output?