I am trying to set an env var which is git sha1 commit for a makefile target. I am setting a lot of env vars and only this fails with no such file or directory error. I am hell confused. Please help me pass this as env var to my makefile target. This is what I do in the beginning of my Makefile.
SHA1 := $(shell git log | head -1 | awk '{print $2}')
BUILD_STAMP := $(shell date +%s)
export SHA1
export BUILD_STAMP
And one of the makefile targets have like this.
target: dep-target
env \
VAR1=$(VAR1) \
GIT_SHA1=$(SHA1) \
my-command for the target
This fails with
env: a6d23d14b0fbb613e567cc647ebfe2808ce47af1: No such file or directory
Please help me set this as env var.