summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile8
1 files changed, 8 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index a1ab65ef0c..c85b9036a2 100644
--- a/Makefile
+++ b/Makefile
@@ -5,7 +5,15 @@ TOP = .
SUBDIRS = src
+# The git command below generates an empty string when we're not
+# building in a GIT tree (i.e., building from a release tarball).
default: $(TOP)/configs/current
+ @touch src/mesa/main/git_sha1.h
+ @if which git > /dev/null; then \
+ git log -n 1 --oneline |\
+ sed 's/^\([^ ]*\) .*/#define MESA_GIT_SHA1 "\1"/' \
+ > src/mesa/main/git_sha1.h; \
+ fi
@for dir in $(SUBDIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE)) || exit 1 ; \