summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6d9bbc5)
raw | patch | inline | side by side (parent: 6d9bbc5)
author | Junio C Hamano <junkio@cox.net> | |
Fri, 23 Sep 2005 17:41:40 +0000 (10:41 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 24 Sep 2005 18:26:22 +0000 (11:26 -0700) |
Taking the make command line Peter Eriksen uses, give defaults
to SHELL_PATH, TAR, CURLDIR, NO_STRCASESTR, and INSTALL.
Signed-off-by: Junio C Hamano <junkio@cox.net>
to SHELL_PATH, TAR, CURLDIR, NO_STRCASESTR, and INSTALL.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Makefile | patch | blob | history | |
git-clone.sh | patch | blob | history | |
templates/Makefile | patch | blob | history |
diff --git a/Makefile b/Makefile
index a0e779ea4990d606fe2e8f41bb1c3c938df68881..513351d98d1dda3beaf2811f66347bc179c211ca 100644 (file)
--- a/Makefile
+++ b/Makefile
# Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
# Patrick Mauritz).
#
-# Define NO_GETDOMAINNAME if your library lack it (SunOS, Patrick Mauritz).
-#
# Define WITH_OWN_SUBPROCESS_PY if you want to use with python 2.3.
#
# Define COLLISION_CHECK below if you believe that SHA1's
CC = gcc
AR = ar
+TAR = tar
INSTALL = install
RPMBUILD = rpmbuild
SCRIPT_PERL += git-send-email.perl
endif
-ifndef NO_CURL
- ifdef CURLDIR
- # This is still problematic -- gcc does not want -R.
- CFLAGS += -I$(CURLDIR)/include
- CURL_LIBCURL = -L$(CURLDIR)/lib -R$(CURLDIR)/lib -lcurl
- else
- CURL_LIBCURL = -lcurl
- endif
- PROGRAMS += git-http-fetch
-endif
-
LIB_FILE=libgit.a
LIB_H = \
LIBS = $(LIB_FILE)
LIBS += -lz
+#
+# Platform specific tweaks
+#
ifeq ($(shell uname -s),Darwin)
NEEDS_SSL_WITH_CRYPTO = YesPlease
NEEDS_LIBICONV = YesPlease
ifeq ($(shell uname -s),SunOS)
NEEDS_SOCKET = YesPlease
NEEDS_NSL = YesPlease
+ SHELL_PATH = /bin/bash
+ NO_STRCASESTR = YesPlease
+ CURLDIR = /opt/sfw
+ INSTALL = ginstall
+ TAR = gtar
PLATFORM_DEFINES += -D__EXTENSIONS__
endif
ifneq (,$(findstring arm,$(shell uname -m)))
ARM_SHA1 = YesPlease
endif
+ifndef NO_CURL
+ ifdef CURLDIR
+ # This is still problematic -- gcc does not want -R.
+ CFLAGS += -I$(CURLDIR)/include
+ CURL_LIBCURL = -L$(CURLDIR)/lib -R$(CURLDIR)/lib -lcurl
+ else
+ CURL_LIBCURL = -lcurl
+ endif
+ PROGRAMS += git-http-fetch
+endif
+
ifndef SHELL_PATH
SHELL_PATH = /bin/sh
endif
$(patsubst %.py,%,$(SCRIPT_PYTHON)) \
gitk
+export TAR INSTALL DESTDIR
### Build rules
all: $(PROGRAMS) $(SCRIPTS)
git: git.sh Makefile
rm -f $@+ $@
- sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' <$@.sh >$@+
+ sed -e '1s|#!.*/sh|#!$(SHELL_PATH)|' \
+ -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' <$@.sh >$@+
chmod +x $@+
mv $@+ $@
./git-tar-tree HEAD $(GIT_TARNAME) > $(GIT_TARNAME).tar
@mkdir -p $(GIT_TARNAME)
@cp git-core.spec $(GIT_TARNAME)
- tar rf $(GIT_TARNAME).tar $(GIT_TARNAME)/git-core.spec
+ $(TAR) rf $(GIT_TARNAME).tar $(GIT_TARNAME)/git-core.spec
@rm -rf $(GIT_TARNAME)
gzip -f -9 $(GIT_TARNAME).tar
deb: dist
rm -rf $(GIT_TARNAME)
- tar zxf $(GIT_TARNAME).tar.gz
+ $(TAR) zxf $(GIT_TARNAME).tar.gz
dpkg-source -b $(GIT_TARNAME)
cd $(GIT_TARNAME) && fakeroot debian/rules binary
rm -f git-core_$(GIT_VERSION)-*.deb git-core_$(GIT_VERSION)-*.dsc
rm -f git-tk_$(GIT_VERSION)-*.deb
$(MAKE) -C Documentation/ clean
- $(MAKE) -C templates/ clean
+ $(MAKE) -C templates clean
$(MAKE) -C t/ clean
diff --git a/git-clone.sh b/git-clone.sh
index 44135f489d55c29eb2e7dce1b892471c55b9914b..a322a459952cd28055f74b4ff1766407789dadf9 100755 (executable)
--- a/git-clone.sh
+++ b/git-clone.sh
then
HEAD=HEAD
fi
- tar Ccf "$repo" - refs $HEAD | tar Cxf "$D/.git" - || exit 1
+ (cd "$repo" && tar cf - refs $HEAD) |
+ (cd "$D/.git" && tar xf -) || exit 1
;;
*)
case "$repo" in
diff --git a/templates/Makefile b/templates/Makefile
index 776e6c80097ff5e56659b36c8bf22194c8b9dace..221a0860661a3adb43470aa22d30b54601223b3d 100644 (file)
--- a/templates/Makefile
+++ b/templates/Makefile
# make and install sample templates
-INSTALL=install
-prefix=$(HOME)
-template_dir=$(prefix)/share/git-core/templates/
+INSTALL ?= install
+TAR ?= tar
+prefix ?= $(HOME)
+template_dir ?= $(prefix)/share/git-core/templates/
# DESTDIR=
all: boilerplates custom
install: all
$(INSTALL) -d -m755 $(DESTDIR)$(template_dir)
- tar Ccf blt - . | tar Cxf $(DESTDIR)$(template_dir) -
+ (cd blt && $(TAR) cf - .) | \
+ (cd $(DESTDIR)$(template_dir) && $(TAR) xf -)