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