Merge branch 'master' into dev
[git/dscho.git] / Makefile
blob38154b6e08cf144f56a20faebe4d871670b667b6
1 # Set the installation directories; this section is needed only in
2 # gitk.git but probably not in git.git.
3 ifndef gitexecdir
4 gitexecdir := $(shell git --exec-path)
5 endif
6 ifndef sharedir
7 sharedir := $(dir $(gitexecdir))share
8 endif
10 # From here on, these are needed in git.git/gitk/Makefile.
11 gitk_libdir ?= $(sharedir)/gitk/lib
12 msgsdir ?= $(gitk_libdir)/msgs
13 msgsdir_SQ = $(subst ','\'',$(msgsdir))
15 ## Beginning of po-file creation rules
16 XGETTEXT ?= xgettext
17 MSGFMT ?= msgfmt
18 PO_TEMPLATE = po/gitk.pot
19 ALL_POFILES = $(wildcard po/*.po)
20 ALL_MSGFILES = $(subst .po,.msg,$(ALL_POFILES))
22 all:: $(ALL_MSGFILES)
24 $(PO_TEMPLATE): gitk
25 $(XGETTEXT) -kmc -LTcl -o $@ gitk
26 update-po:: $(PO_TEMPLATE)
27 $(foreach p, $(ALL_POFILES), echo Updating $p ; msgmerge -U $p $(PO_TEMPLATE) ; )
28 $(ALL_MSGFILES): %.msg : %.po
29 @echo Generating catalog $@
30 $(MSGFMT) --statistics --tcl $< -l $(basename $(notdir $<)) -d $(dir $@)
32 clean::
33 rm -f $(ALL_PROGRAMS) po/*.msg
34 ## End of po-file creation rules
36 # Install rules for po-files
37 install: all
38 $(QUIET)$(INSTALL_D0)'$(DESTDIR_SQ)$(msgsdir_SQ)' $(INSTALL_D1)
39 $(QUIET)$(foreach p,$(ALL_MSGFILES), $(INSTALL_R0)$p $(INSTALL_R1) '$(DESTDIR_SQ)$(msgsdir_SQ)' &&) true
41 uninstall:
42 $(QUIET)$(foreach p,$(ALL_MSGFILES), $(REMOVE_F0)'$(DESTDIR_SQ)$(msgsdir_SQ)'/$(notdir $p) $(REMOVE_F1) &&) true
43 $(QUIET)$(REMOVE_D0)'$(DESTDIR_SQ)$(msgsdir_SQ)' $(REMOVE_D1)
44 $(QUIET)$(REMOVE_D0)'$(DESTDIR_SQ)$(libdir_SQ)' $(REMOVE_D1)
45 $(QUIET)$(REMOVE_D0)`dirname '$(DESTDIR_SQ)$(libdir_SQ)'` $(REMOVE_D1)