Makefile : assigning function variable in target command line
Posted
by Michael
on Stack Overflow
See other posts from Stack Overflow
or by Michael
Published on 2010-05-06T03:02:45Z
Indexed on
2010/05/06
3:08 UTC
Read the original article
Hit count: 341
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?
© Stack Overflow or respective owner