Merge branch 'jc/read-tree-df'
[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
3ed02de2 10SCRIPT_SH = git-gui.sh
b4d2b04c 11GITGUI_BUILT_INS = git-citool
3ed02de2 12ALL_PROGRAMS = $(GITGUI_BUILT_INS) $(patsubst %.sh,%,$(SCRIPT_SH))
b4d2b04c
JH
13
14ifndef SHELL_PATH
15 SHELL_PATH = /bin/sh
16endif
17
67c75759
JH
18ifndef gitexecdir
19 gitexecdir := $(shell git --exec-path)
20endif
21
22ifndef INSTALL
23 INSTALL = install
24endif
b4d2b04c 25
eec10252
JH
26ifndef V
27 QUIET_GEN = @echo ' ' GEN $@;
28 QUIET_BUILT_IN = @echo ' ' BUILTIN $@;
29endif
30
27ebd6e0
JH
31ifeq ($(findstring $(MAKEFLAGS),s),s)
32QUIET_GEN =
33QUIET_BUILT_IN =
34endif
35
b4d2b04c
JH
36DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
37gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
b4d2b04c
JH
38SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
39
3ed02de2 40$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
eec10252 41 $(QUIET_GEN)rm -f $@ $@+ && \
3ed02de2 42 sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
67c75759 43 -e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \
eec10252 44 $@.sh >$@+ && \
eec10252 45 chmod +x $@+ && \
b4d2b04c
JH
46 mv $@+ $@
47
48$(GITGUI_BUILT_INS): git-gui
eec10252 49 $(QUIET_BUILT_IN)rm -f $@ && ln git-gui $@
b4d2b04c 50
3ed02de2
JH
51# These can record GITGUI_VERSION
52$(patsubst %.sh,%,$(SCRIPT_SH)): GIT-VERSION-FILE
53
b4d2b04c
JH
54all:: $(ALL_PROGRAMS)
55
56install: all
57 $(INSTALL) -d -m755 '$(DESTDIR_SQ)$(gitexecdir_SQ)'
58 $(INSTALL) git-gui '$(DESTDIR_SQ)$(gitexecdir_SQ)'
59 $(foreach p,$(GITGUI_BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git-gui' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)
60
3ed02de2 61dist-version:
67c75759
JH
62 @mkdir -p $(TARDIR)
63 @echo $(GITGUI_VERSION) > $(TARDIR)/version
64
b4d2b04c 65clean::
3ed02de2 66 rm -f $(ALL_PROGRAMS) GIT-VERSION-FILE
b4d2b04c 67
67c75759 68.PHONY: all install dist-version clean
b4d2b04c 69.PHONY: .FORCE-GIT-VERSION-FILE