Makefile : assigning function variable in target command line
- by Michael
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.
update: $(xpi) $(target_update_rdf)
xpi_hash := $(shell sha1sum $(xpi) | grep -Eow '^[^ ]+')
@echo "Updating..."
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?