Windows ANSI - hook write()
[git/mingw/4msysgit/peterh.git] / gitk-git / Makefile
blob2dda57cbaef9f3ae9708b00ba149d2513cdcefef
1 # The default target of this Makefile is...
2 all::
4 prefix ?= $(HOME)
5 bindir ?= $(prefix)/bin
6 sharedir ?= $(prefix)/share
7 gitk_libdir ?= $(sharedir)/gitk/lib
8 msgsdir ?= $(gitk_libdir)/msgs
9 msgsdir_SQ = $(subst ','\'',$(msgsdir))
11 TCL_PATH ?= tclsh
12 TCLTK_PATH ?= wish
13 INSTALL ?= install
14 RM ?= rm -f
16 DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
17 bindir_SQ = $(subst ','\'',$(bindir))
18 TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
20 ## po-file creation rules
21 XGETTEXT ?= xgettext
22 uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
23 ifneq (,$(findstring MINGW,$(uname_S)))
24 NO_MSGFMT=1
25 endif
26 ifdef NO_MSGFMT
27 MSGFMT ?= $(TCL_PATH) po/po2msg.sh
28 else
29 MSGFMT ?= msgfmt
30 ifneq ($(shell $(MSGFMT) --tcl -l C -d . /dev/null 2>/dev/null; echo $$?),0)
31 MSGFMT := $(TCL_PATH) po/po2msg.sh
32 endif
33 endif
35 PO_TEMPLATE = po/gitk.pot
36 ALL_POFILES = $(wildcard po/*.po)
37 ALL_MSGFILES = $(subst .po,.msg,$(ALL_POFILES))
39 ifndef V
40 QUIET = @
41 QUIET_GEN = $(QUIET)echo ' ' GEN $@ &&
42 endif
44 all:: gitk-wish $(ALL_MSGFILES)
46 install:: all
47 $(INSTALL) -m 755 gitk-wish '$(DESTDIR_SQ)$(bindir_SQ)'/gitk
48 $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(msgsdir_SQ)'
49 $(foreach p,$(ALL_MSGFILES), $(INSTALL) -m 644 $p '$(DESTDIR_SQ)$(msgsdir_SQ)' &&) true
51 uninstall::
52 $(foreach p,$(ALL_MSGFILES), $(RM) '$(DESTDIR_SQ)$(msgsdir_SQ)'/$(notdir $p) &&) true
53 $(RM) '$(DESTDIR_SQ)$(bindir_SQ)'/gitk
55 clean::
56 $(RM) gitk-wish po/*.msg
58 gitk-wish: gitk
59 $(QUIET_GEN)$(RM) $@ $@+ && \
60 sed -e '1,3s|^exec .* "$$0"|exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' <gitk >$@+ && \
61 chmod +x $@+ && \
62 mv -f $@+ $@
64 $(PO_TEMPLATE): gitk
65 $(XGETTEXT) -kmc -LTcl -o $@ gitk
66 update-po:: $(PO_TEMPLATE)
67 $(foreach p, $(ALL_POFILES), echo Updating $p ; msgmerge -U $p $(PO_TEMPLATE) ; )
68 $(ALL_MSGFILES): %.msg : %.po
69 @echo Generating catalog $@
70 $(MSGFMT) --statistics --tcl $< -l $(basename $(notdir $<)) -d $(dir $@)