Generated header git_sha1.h has to depend on the git HEAD
otherwise it will never be updated.
v2: use absolute path for --git-dir option, in order to support cases
when Android.gen.mk is invoked by other makefiles
$(hide) $(PRIVATE_SCRIPT) $(1) $(PRIVATE_XML) > $@
endef
-$(intermediates)/main/git_sha1.h:
+$(intermediates)/main/git_sha1.h: $(MESA_TOP)/.git/HEAD
@mkdir -p $(dir $@)
@echo "GIT-SHA1: $(PRIVATE_MODULE) <= git"
$(hide) touch $@
$(hide) if which git > /dev/null; then \
- git --git-dir $(PRIVATE_PATH)/../../.git log -n 1 --oneline | \
+ git --git-dir $(MESA_TOP)/.git log -n 1 --oneline | \
sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "git-\1"/' \
> $@; \
fi