git-gui: Use option database defaults to set the font
[git/mingw/j6t.git] / Makefile
blobb29d7d1e68d2489fd07612c8d0062d3491f04719
1 all::
3 # Define V=1 to have a more verbose compile.
6 GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
7 @$(SHELL_PATH) ./GIT-VERSION-GEN
8 -include GIT-VERSION-FILE
10 SCRIPT_SH = git-gui.sh
11 GITGUI_BUILT_INS = git-citool
12 ALL_PROGRAMS = $(GITGUI_BUILT_INS) $(patsubst %.sh,%,$(SCRIPT_SH))
14 ifndef SHELL_PATH
15 SHELL_PATH = /bin/sh
16 endif
18 ifndef gitexecdir
19 gitexecdir := $(shell git --exec-path)
20 endif
22 ifndef INSTALL
23 INSTALL = install
24 endif
26 ifndef V
27 QUIET_GEN = @echo ' ' GEN $@;
28 QUIET_BUILT_IN = @echo ' ' BUILTIN $@;
29 endif
31 TCLTK_PATH ?= wish
33 ifeq ($(findstring $(MAKEFLAGS),s),s)
34 QUIET_GEN =
35 QUIET_BUILT_IN =
36 endif
38 DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
39 gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
40 SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
41 TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
43 $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
44 $(QUIET_GEN)rm -f $@ $@+ && \
45 sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
46 -e 's|^exec wish "$$0"|exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' \
47 -e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \
48 $@.sh >$@+ && \
49 chmod +x $@+ && \
50 mv $@+ $@
52 $(GITGUI_BUILT_INS): git-gui
53 $(QUIET_BUILT_IN)rm -f $@ && ln git-gui $@
55 # These can record GITGUI_VERSION
56 $(patsubst %.sh,%,$(SCRIPT_SH)): GIT-VERSION-FILE
58 all:: $(ALL_PROGRAMS)
60 install: all
61 $(INSTALL) -d -m755 '$(DESTDIR_SQ)$(gitexecdir_SQ)'
62 $(INSTALL) git-gui '$(DESTDIR_SQ)$(gitexecdir_SQ)'
63 $(foreach p,$(GITGUI_BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git-gui' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)
65 dist-version:
66 @mkdir -p $(TARDIR)
67 @echo $(GITGUI_VERSION) > $(TARDIR)/version
69 clean::
70 rm -f $(ALL_PROGRAMS) GIT-VERSION-FILE
72 .PHONY: all install dist-version clean
73 .PHONY: .FORCE-GIT-VERSION-FILE