git-send-email: Document configuration options
[git/git.git] / git-gui / Makefile
CommitLineData
b4d2b04c
JH
1all::
2
eec10252
JH
3# Define V=1 to have a more verbose compile.
4#
5
b4d2b04c
JH
6GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
7 @$(SHELL_PATH) ./GIT-VERSION-GEN
8-include GIT-VERSION-FILE
9
b4d2b04c 10GITGUI_BUILT_INS = git-citool
5bac4a67 11ALL_PROGRAMS = git-gui $(GITGUI_BUILT_INS)
b4d2b04c
JH
12
13ifndef SHELL_PATH
14 SHELL_PATH = /bin/sh
15endif
16
67c75759
JH
17ifndef gitexecdir
18 gitexecdir := $(shell git --exec-path)
19endif
20
21ifndef INSTALL
22 INSTALL = install
23endif
b4d2b04c 24
eec10252
JH
25ifndef V
26 QUIET_GEN = @echo ' ' GEN $@;
27 QUIET_BUILT_IN = @echo ' ' BUILTIN $@;
28endif
29
b4d2b04c
JH
30DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
31gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
b4d2b04c
JH
32SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
33
5bac4a67 34git-gui: git-gui.sh GIT-VERSION-FILE CREDITS-FILE
eec10252 35 $(QUIET_GEN)rm -f $@ $@+ && \
5bac4a67
JH
36 sed -n \
37 -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
67c75759 38 -e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \
5bac4a67 39 -e '1,/^set gitgui_credits /p' \
eec10252
JH
40 $@.sh >$@+ && \
41 cat CREDITS-FILE >>$@+ && \
42 sed -e '1,/^set gitgui_credits /d' $@.sh >>$@+ && \
43 chmod +x $@+ && \
b4d2b04c
JH
44 mv $@+ $@
45
5bac4a67 46CREDITS-FILE: CREDITS-GEN .FORCE-CREDITS-FILE
eec10252 47 $(QUIET_GEN)$(SHELL_PATH) ./CREDITS-GEN
5bac4a67 48
b4d2b04c 49$(GITGUI_BUILT_INS): git-gui
eec10252 50 $(QUIET_BUILT_IN)rm -f $@ && ln git-gui $@
b4d2b04c 51
b4d2b04c
JH
52all:: $(ALL_PROGRAMS)
53
54install: all
55 $(INSTALL) -d -m755 '$(DESTDIR_SQ)$(gitexecdir_SQ)'
56 $(INSTALL) git-gui '$(DESTDIR_SQ)$(gitexecdir_SQ)'
57 $(foreach p,$(GITGUI_BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git-gui' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)
58
5bac4a67 59dist-version: CREDITS-FILE
67c75759
JH
60 @mkdir -p $(TARDIR)
61 @echo $(GITGUI_VERSION) > $(TARDIR)/version
5bac4a67 62 @cat CREDITS-FILE > $(TARDIR)/credits
67c75759 63
b4d2b04c 64clean::
5bac4a67 65 rm -f $(ALL_PROGRAMS) GIT-VERSION-FILE CREDITS-FILE
b4d2b04c 66
67c75759 67.PHONY: all install dist-version clean
b4d2b04c 68.PHONY: .FORCE-GIT-VERSION-FILE
5bac4a67 69.PHONY: .FORCE-CREDITS-FILE