2727# Define NEEDS_SOCKET if linking with libc is not enough (SunOS,
2828# Patrick Mauritz).
2929#
30- # Define NO_GETDOMAINNAME if your library lack it (SunOS, Patrick Mauritz).
31- #
3230# Define WITH_OWN_SUBPROCESS_PY if you want to use with python 2.3.
3331#
3432# Define COLLISION_CHECK below if you believe that SHA1's
@@ -63,6 +61,7 @@ GIT_PYTHON_DIR = $(prefix)/share/git-core/python
6361
6462CC = gcc
6563AR = ar
64+ TAR = tar
6665INSTALL = install
6766RPMBUILD = rpmbuild
6867
@@ -133,17 +132,6 @@ ifdef WITH_SEND_EMAIL
133132 SCRIPT_PERL += git-send-email.perl
134133endif
135134
136- ifndef NO_CURL
137- ifdef CURLDIR
138- # This is still problematic -- gcc does not want -R.
139- CFLAGS += -I$(CURLDIR)/include
140- CURL_LIBCURL = -L$(CURLDIR)/lib -R$(CURLDIR)/lib -lcurl
141- else
142- CURL_LIBCURL = -lcurl
143- endif
144- PROGRAMS += git-http-fetch
145- endif
146-
147135LIB_FILE =libgit.a
148136
149137LIB_H = \
@@ -166,19 +154,38 @@ LIB_OBJS = \
166154LIBS = $(LIB_FILE )
167155LIBS += -lz
168156
157+ #
158+ # Platform specific tweaks
159+ #
169160ifeq ($(shell uname -s) ,Darwin)
170161 NEEDS_SSL_WITH_CRYPTO = YesPlease
171162 NEEDS_LIBICONV = YesPlease
172163endif
173164ifeq ($(shell uname -s) ,SunOS)
174165 NEEDS_SOCKET = YesPlease
175166 NEEDS_NSL = YesPlease
167+ SHELL_PATH = /bin/bash
168+ NO_STRCASESTR = YesPlease
169+ CURLDIR = /opt/sfw
170+ INSTALL = ginstall
171+ TAR = gtar
176172 PLATFORM_DEFINES += -D__EXTENSIONS__
177173endif
178174ifneq (,$(findstring arm,$(shell uname -m) ) )
179175 ARM_SHA1 = YesPlease
180176endif
181177
178+ ifndef NO_CURL
179+ ifdef CURLDIR
180+ # This is still problematic -- gcc does not want -R.
181+ CFLAGS += -I$(CURLDIR)/include
182+ CURL_LIBCURL = -L$(CURLDIR)/lib -R$(CURLDIR)/lib -lcurl
183+ else
184+ CURL_LIBCURL = -lcurl
185+ endif
186+ PROGRAMS += git-http-fetch
187+ endif
188+
182189ifndef SHELL_PATH
183190 SHELL_PATH = /bin/sh
184191endif
@@ -245,6 +252,7 @@ SCRIPTS = $(patsubst %.sh,%,$(SCRIPT_SH)) \
245252 $(patsubst % .py,% ,$(SCRIPT_PYTHON ) ) \
246253 gitk
247254
255+ export TAR INSTALL DESTDIR
248256# ## Build rules
249257
250258all : $(PROGRAMS ) $(SCRIPTS )
254262
255263git : git.sh Makefile
256264 rm -f $@ + $@
257- sed -e ' s/@@GIT_VERSION@@/$(GIT_VERSION)/g' < $@ .sh > $@ +
265+ sed -e ' 1s|#!.*/sh|#!$(SHELL_PATH)|' \
266+ -e ' s/@@GIT_VERSION@@/$(GIT_VERSION)/g' < $@ .sh > $@ +
258267 chmod +x $@ +
259268 mv $@ + $@
260269
@@ -356,7 +365,7 @@ dist: git-core.spec git-tar-tree
356365 ./git-tar-tree HEAD $(GIT_TARNAME ) > $(GIT_TARNAME ) .tar
357366 @mkdir -p $(GIT_TARNAME )
358367 @cp git-core.spec $(GIT_TARNAME )
359- tar rf $(GIT_TARNAME ) .tar $(GIT_TARNAME ) /git-core.spec
368+ $( TAR ) rf $(GIT_TARNAME ) .tar $(GIT_TARNAME ) /git-core.spec
360369 @rm -rf $(GIT_TARNAME )
361370 gzip -f -9 $(GIT_TARNAME ) .tar
362371
@@ -365,7 +374,7 @@ rpm: dist
365374
366375deb : dist
367376 rm -rf $(GIT_TARNAME )
368- tar zxf $(GIT_TARNAME ) .tar.gz
377+ $( TAR ) zxf $(GIT_TARNAME ) .tar.gz
369378 dpkg-source -b $(GIT_TARNAME )
370379 cd $(GIT_TARNAME ) && fakeroot debian/rules binary
371380
@@ -380,5 +389,5 @@ clean:
380389 rm -f git-core_$(GIT_VERSION ) -* .deb git-core_$(GIT_VERSION ) -* .dsc
381390 rm -f git-tk_$(GIT_VERSION ) -* .deb
382391 $(MAKE ) -C Documentation/ clean
383- $(MAKE ) -C templates/ clean
392+ $(MAKE ) -C templates clean
384393 $(MAKE ) -C t/ clean
0 commit comments