interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / gitk-git / Makefile

84 lines · 2468 bytes Raw Blame History
1# The default target of this Makefile is...
2all::
3
4prefix ?= $(HOME)
5bindir ?= $(prefix)/bin
6sharedir ?= $(prefix)/share
7gitk_libdir ?= $(sharedir)/gitk/lib
8msgsdir ?= $(gitk_libdir)/msgs
9msgsdir_SQ = $(subst ','\'',$(msgsdir))
10
11SHELL_PATH ?= /bin/sh
12TCL_PATH ?= tclsh
13TCLTK_PATH ?= wish
14INSTALL ?= install
15RM ?= rm -f
16
17DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
18bindir_SQ = $(subst ','\'',$(bindir))
19TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
20
21### Detect Tck/Tk interpreter path changes
22TRACK_TCLTK = $(subst ','\'',-DTCLTK_PATH='$(TCLTK_PATH_SQ)')
23
24GIT-TCLTK-VARS: FORCE
25 @VARS='$(TRACK_TCLTK)'; \
26 if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \
27 echo 1>&2 " * new Tcl/Tk interpreter location"; \
28 echo "$$VARS" >$@; \
29 fi
30
31## po-file creation rules
32XGETTEXT ?= xgettext
33ifdef NO_MSGFMT
34 MSGFMT ?= $(TCL_PATH) po/po2msg.sh
35else
36 MSGFMT ?= msgfmt
37 ifneq ($(shell $(MSGFMT) --tcl -l C -d . /dev/null 2>/dev/null; echo $$?),0)
38 MSGFMT := $(TCL_PATH) po/po2msg.sh
39 endif
40endif
41
42PO_TEMPLATE = po/gitk.pot
43ALL_POFILES = $(wildcard po/*.po)
44ALL_MSGFILES = $(subst .po,.msg,$(ALL_POFILES))
45
46ifneq ($(findstring s,$(firstword -$(MAKEFLAGS))),s)
47ifndef V
48 QUIET = @
49 QUIET_GEN = $(QUIET)echo ' ' GEN $@ &&
50 QUIET_MSGFMT = $(QUIET)echo ' ' MSGFMT $@ &&
51endif
52endif
53
54all:: gitk-wish $(ALL_MSGFILES)
55
56install:: all
57 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
58 $(INSTALL) -m 755 gitk-wish '$(DESTDIR_SQ)$(bindir_SQ)'/gitk
59 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(msgsdir_SQ)'
60 $(foreach p,$(ALL_MSGFILES), $(INSTALL) -m 644 $p '$(DESTDIR_SQ)$(msgsdir_SQ)' &&) true
61
62uninstall::
63 $(foreach p,$(ALL_MSGFILES), $(RM) '$(DESTDIR_SQ)$(msgsdir_SQ)'/$(notdir $p) &&) true
64 $(RM) '$(DESTDIR_SQ)$(bindir_SQ)'/gitk
65
66clean::
67 $(RM) gitk-wish po/*.msg GIT-TCLTK-VARS
68
69gitk-wish: gitk GIT-TCLTK-VARS
70 $(QUIET_GEN)$(RM) $@ $@+ && \
71 $(SHELL_PATH) ./generate-tcl.sh "$(TCLTK_PATH_SQ)" "$<" "$@"
72
73$(PO_TEMPLATE): gitk
74 $(XGETTEXT) -kmc -LTcl --package-name=Gitk -o $@ gitk
75update-po:: $(PO_TEMPLATE)
76 $(foreach p, $(ALL_POFILES), echo Updating $p ; msgmerge -U --add-location $p $(PO_TEMPLATE) ; )
77 @echo "Before committing changes, ensure that a clean-filter is installed:"; \
78 echo; \
79 echo " git config filter.gettext-no-location.clean \"msgcat --no-location -\""
80$(ALL_MSGFILES): %.msg : %.po
81 $(QUIET_MSGFMT)$(MSGFMT) --tcl -l $(basename $(notdir $<)) -d $(dir $@) $<
82
83.PHONY: all install uninstall clean update-po
84.PHONY: FORCE