@ -170,6 +170,16 @@ ALL_CFLAGS = $(CFLAGS)
ALL_LDFLAGS = $(LDFLAGS)
ALL_LDFLAGS = $(LDFLAGS)
STRIP ?= strip
STRIP ?= strip
# Among the variables below, these:
# gitexecdir
# template_dir
# htmldir
# ETC_GITCONFIG (but not sysconfdir)
# can be specified as a relative path ../some/where/else (which must begin
# with ../); this is interpreted as relative to $(bindir) and "git" at
# runtime figures out where they are based on the path to the executable.
# This can help installing the suite in a relocatable way.
prefix = $(HOME)
prefix = $(HOME)
bindir = $(prefix)/bin
bindir = $(prefix)/bin
mandir = $(prefix)/share/man
mandir = $(prefix)/share/man
@ -205,7 +215,7 @@ GITWEB_FAVICON = git-favicon.png
GITWEB_SITE_HEADER =
GITWEB_SITE_HEADER =
GITWEB_SITE_FOOTER =
GITWEB_SITE_FOOTER =
export prefix bindir gitexecdir sharedir htmldir sysconfdir
export prefix bindir sharedir htmldir sysconfdir
CC = gcc
CC = gcc
AR = ar
AR = ar
@ -1321,22 +1331,30 @@ template_instdir = $(template_dir)
endif
endif
export template_instdir
export template_instdir
ifeq ($(firstword $(subst /, ,$(gitexecdir))),..)
gitexec_instdir = $(bindir)/$(gitexecdir)
else
gitexec_instdir = $(gitexecdir)
endif
gitexec_instdir_SQ = $(subst ','\'',$(gitexec_instdir))
export gitexec_instdir
install: all
install: all
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexecdir_SQ)'
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
$(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexecdir_SQ)'
$(INSTALL) $(ALL_PROGRAMS) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
$(INSTALL) git$X git-upload-pack$X git-receive-pack$X git-upload-archive$X '$(DESTDIR_SQ)$(bindir_SQ)'
$(INSTALL) git$X git-upload-pack$X git-receive-pack$X git-upload-archive$X '$(DESTDIR_SQ)$(bindir_SQ)'
$(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install
$(MAKE) -C templates DESTDIR='$(DESTDIR_SQ)' install
$(MAKE) -C perl prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install
$(MAKE) -C perl prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install
ifndef NO_TCLTK
ifndef NO_TCLTK
$(MAKE) -C gitk-git install
$(MAKE) -C gitk-git install
$(MAKE) -C git-gui install
$(MAKE) -C git-gui gitexecdir='$(gitexec_instdir_SQ)' install
endif
endif
ifneq (,$X)
ifneq (,$X)
$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), $(RM) '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p';)
$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), $(RM) '$(DESTDIR_SQ)$(gitexec_instdir_SQ)/$p';)
endif
endif
bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
execdir=$$(cd '$(DESTDIR_SQ)$(gitexecdir_SQ)' && pwd) && \
execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
if test "z$$bindir" != "z$$execdir"; \
if test "z$$bindir" != "z$$execdir"; \
then \
then \
ln -f "$$bindir/git$X" "$$execdir/git$X" || \
ln -f "$$bindir/git$X" "$$execdir/git$X" || \