aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile10
-rwxr-xr-xgit.sh.in (renamed from git.sh)5
2 files changed, 13 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 4f55f631b..d3d0855e0 100644
--- a/Makefile
+++ b/Makefile
@@ -183,11 +183,17 @@ SCRIPTS = $(SCRIPT_SH) $(SCRIPT_PERL) gitk
### Build rules
-all: $(PROGRAMS)
+all: $(PROGRAMS) git.sh
all:
$(MAKE) -C templates
+git.sh: git.sh.in Makefile
+ rm -f $@+ $@
+ sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' <$@.in >$@+
+ chmod +x $@+
+ mv $@+ $@
+
%.o: %.c
$(CC) -o $*.o -c $(ALL_CFLAGS) $<
%.o: %.S
@@ -293,7 +299,7 @@ deb: dist
clean:
rm -f *.o mozilla-sha1/*.o ppc/*.o $(PROGRAMS) $(LIB_FILE)
- rm -f git-core.spec
+ rm -f git-core.spec git.sh
rm -rf $(GIT_TARNAME)
rm -f $(GIT_TARNAME).tar.gz git-core_$(GIT_VERSION)-*.tar.gz
rm -f git-core_$(GIT_VERSION)-*.deb git-core_$(GIT_VERSION)-*.dsc
diff --git a/git.sh b/git.sh.in
index f96765079..178d0f0c0 100755
--- a/git.sh
+++ b/git.sh.in
@@ -6,6 +6,11 @@ case "$#" in
0) ;;
*) cmd="$1"
shift
+ case "$cmd" in
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+ echo "git version @@GIT_VERSION@@"
+ exit 0 ;;
+ esac
test -x $path/git-$cmd && exec $path/git-$cmd "$@" ;;
esac