build systems: move git_sha1_gen.sh to bin/
authorEric Engestrom <eric@engestrom.ch>
Thu, 6 Jul 2017 19:25:28 +0000 (20:25 +0100)
committerEric Engestrom <eric@engestrom.ch>
Thu, 6 Jul 2017 21:59:39 +0000 (22:59 +0100)
There was no reason for this script to live outside the scripts
directory.

Suggested-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Brian Paul <brianp@vmware.com>
Makefile.am
bin/git_sha1_gen.sh [new file with mode: 0755]
git_sha1_gen.sh [deleted file]
src/Makefile.am
src/SConscript
src/mesa/Android.libmesa_git_sha1.mk

index d1eadee1e1c6fd2672876a26a6a7dc39a471a99b..51542af3b8298f48bbafe7f97ffe9805d799ec20 100644 (file)
@@ -53,7 +53,7 @@ EXTRA_DIST = \
        common.py \
        docs \
        doxygen \
-       git_sha1_gen.sh \
+       bin/git_sha1_gen.sh \
        scons \
        SConstruct
 
diff --git a/bin/git_sha1_gen.sh b/bin/git_sha1_gen.sh
new file mode 100755 (executable)
index 0000000..898e590
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# run git from the sources directory
+cd "$(dirname "$0")"
+
+# don't print anything if git fails
+if ! git_sha1=$(git --git-dir=../.git rev-parse --short=10 HEAD 2>/dev/null)
+then
+  exit
+fi
+
+printf '#define MESA_GIT_SHA1 "git-%s"\n' "$git_sha1"
diff --git a/git_sha1_gen.sh b/git_sha1_gen.sh
deleted file mode 100755 (executable)
index 20ab8df..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/sh
-
-# run git from the sources directory
-cd "$(dirname "$0")"
-
-# don't print anything if git fails
-if ! git_sha1=$(git --git-dir=.git rev-parse --short=10 HEAD 2>/dev/null)
-then
-  exit
-fi
-
-printf '#define MESA_GIT_SHA1 "git-%s"\n' "$git_sha1"
index 36995e08a45c154c52daee3d59dd56523bb75608..5aee6b01417ab06f4ccf488573168adb12e1ea41 100644 (file)
@@ -21,7 +21,7 @@
 
 .PHONY: git_sha1.h.tmp
 git_sha1.h.tmp:
-       @sh $(top_srcdir)/git_sha1_gen.sh > $@
+       @sh $(top_srcdir)/bin/git_sha1_gen.sh > $@
 
 git_sha1.h: git_sha1.h.tmp
        @echo "updating git_sha1.h"
index c31e4ec06fa5666cd118097620abd5ab0614cdfd..37b3f8572e25a28dee7fbb6c64eef9131998327b 100644 (file)
@@ -24,7 +24,7 @@ def write_git_sha1_h_file(filename):
 
     tempfile = "git_sha1.h.tmp"
     with open(tempfile, "w") as f:
-        args = [ 'sh', Dir('#').abspath + '/git_sha1_gen.sh' ]
+        args = [ 'sh', Dir('#').abspath + '/bin/git_sha1_gen.sh' ]
         try:
             subprocess.Popen(args, stdout=f).wait()
         except:
index a5a1ebb37f5150cbffa71dd89b9c36f1fe2f3dab..7d64b1c809cc962c4a7949055c478d8fee001f84 100644 (file)
@@ -46,7 +46,7 @@ LOCAL_GENERATED_SOURCES += $(addprefix $(intermediates)/, git_sha1.h)
 $(intermediates)/git_sha1.h: $(wildcard $(MESA_TOP)/.git/logs/HEAD)
        @mkdir -p $(dir $@)
        @echo "GIT-SHA1: $(PRIVATE_MODULE) <= git"
-       $(hide) sh $(MESA_TOP)/git_sha1_gen.sh > $@
+       $(hide) sh $(MESA_TOP)/bin/git_sha1_gen.sh > $@
 
 LOCAL_EXPORT_C_INCLUDE_DIRS := $(intermediates)