2007-11-17 18:51:16 +00:00
|
|
|
# The default target of this Makefile is...
|
|
|
|
all::
|
|
|
|
|
|
|
|
prefix ?= $(HOME)
|
|
|
|
bindir ?= $(prefix)/bin
|
2008-01-09 06:41:15 +00:00
|
|
|
sharedir ?= $(prefix)/share
|
|
|
|
gitk_libdir ?= $(sharedir)/gitk/lib
|
|
|
|
msgsdir ?= $(gitk_libdir)/msgs
|
|
|
|
msgsdir_SQ = $(subst ','\'',$(msgsdir))
|
|
|
|
|
2008-03-15 00:49:40 +00:00
|
|
|
TCL_PATH ?= tclsh
|
2007-11-17 18:51:16 +00:00
|
|
|
TCLTK_PATH ?= wish
|
|
|
|
INSTALL ?= install
|
|
|
|
RM ?= rm -f
|
|
|
|
|
|
|
|
DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
|
|
|
|
bindir_SQ = $(subst ','\'',$(bindir))
|
|
|
|
TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
|
|
|
|
|
2013-01-30 21:52:44 +00:00
|
|
|
### Detect Tck/Tk interpreter path changes
|
|
|
|
TRACK_TCLTK = $(subst ','\'',-DTCLTK_PATH='$(TCLTK_PATH_SQ)')
|
|
|
|
|
|
|
|
GIT-TCLTK-VARS: FORCE
|
|
|
|
@VARS='$(TRACK_TCLTK)'; \
|
|
|
|
if test x"$$VARS" != x"`cat $@ 2>/dev/null`" ; then \
|
|
|
|
echo 1>&2 " * new Tcl/Tk interpreter location"; \
|
|
|
|
echo "$$VARS" >$@; \
|
|
|
|
fi
|
|
|
|
|
2008-01-09 06:41:15 +00:00
|
|
|
## po-file creation rules
|
|
|
|
XGETTEXT ?= xgettext
|
2008-01-11 08:51:30 +00:00
|
|
|
ifdef NO_MSGFMT
|
|
|
|
MSGFMT ?= $(TCL_PATH) po/po2msg.sh
|
|
|
|
else
|
|
|
|
MSGFMT ?= msgfmt
|
2024-04-08 15:51:44 +00:00
|
|
|
ifneq ($(shell $(MSGFMT) --tcl -l C -d . /dev/null 2>/dev/null; echo $$?),0)
|
2008-03-15 00:49:40 +00:00
|
|
|
MSGFMT := $(TCL_PATH) po/po2msg.sh
|
2024-04-08 15:51:44 +00:00
|
|
|
endif
|
2008-01-11 08:51:30 +00:00
|
|
|
endif
|
|
|
|
|
2008-01-09 06:41:15 +00:00
|
|
|
PO_TEMPLATE = po/gitk.pot
|
|
|
|
ALL_POFILES = $(wildcard po/*.po)
|
|
|
|
ALL_MSGFILES = $(subst .po,.msg,$(ALL_POFILES))
|
|
|
|
|
2007-11-17 18:51:16 +00:00
|
|
|
ifndef V
|
|
|
|
QUIET = @
|
|
|
|
QUIET_GEN = $(QUIET)echo ' ' GEN $@ &&
|
|
|
|
endif
|
|
|
|
|
2008-01-09 06:41:15 +00:00
|
|
|
all:: gitk-wish $(ALL_MSGFILES)
|
|
|
|
|
2007-11-17 18:51:16 +00:00
|
|
|
install:: all
|
2017-01-18 18:27:59 +00:00
|
|
|
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
|
2008-05-15 04:27:55 +00:00
|
|
|
$(INSTALL) -m 755 gitk-wish '$(DESTDIR_SQ)$(bindir_SQ)'/gitk
|
|
|
|
$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(msgsdir_SQ)'
|
|
|
|
$(foreach p,$(ALL_MSGFILES), $(INSTALL) -m 644 $p '$(DESTDIR_SQ)$(msgsdir_SQ)' &&) true
|
2008-01-09 06:41:15 +00:00
|
|
|
|
|
|
|
uninstall::
|
|
|
|
$(foreach p,$(ALL_MSGFILES), $(RM) '$(DESTDIR_SQ)$(msgsdir_SQ)'/$(notdir $p) &&) true
|
|
|
|
$(RM) '$(DESTDIR_SQ)$(bindir_SQ)'/gitk
|
|
|
|
|
2007-11-17 18:51:16 +00:00
|
|
|
clean::
|
2013-01-30 21:52:44 +00:00
|
|
|
$(RM) gitk-wish po/*.msg GIT-TCLTK-VARS
|
2007-11-17 18:51:16 +00:00
|
|
|
|
2013-01-30 21:52:44 +00:00
|
|
|
gitk-wish: gitk GIT-TCLTK-VARS
|
2007-11-17 18:51:16 +00:00
|
|
|
$(QUIET_GEN)$(RM) $@ $@+ && \
|
|
|
|
sed -e '1,3s|^exec .* "$$0"|exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' <gitk >$@+ && \
|
|
|
|
chmod +x $@+ && \
|
|
|
|
mv -f $@+ $@
|
2008-01-09 06:41:15 +00:00
|
|
|
|
|
|
|
$(PO_TEMPLATE): gitk
|
|
|
|
$(XGETTEXT) -kmc -LTcl -o $@ gitk
|
|
|
|
update-po:: $(PO_TEMPLATE)
|
|
|
|
$(foreach p, $(ALL_POFILES), echo Updating $p ; msgmerge -U $p $(PO_TEMPLATE) ; )
|
|
|
|
$(ALL_MSGFILES): %.msg : %.po
|
|
|
|
@echo Generating catalog $@
|
|
|
|
$(MSGFMT) --statistics --tcl $< -l $(basename $(notdir $<)) -d $(dir $@)
|
|
|
|
|
2013-01-30 21:52:44 +00:00
|
|
|
.PHONY: all install uninstall clean update-po
|
|
|
|
.PHONY: FORCE
|