[PATCH] gitk: Update and fix Makefile
This Makefile uses the template provided at git.git/gitk-git/Makefile by Junio and adds the rules for the i18n files. Signed-off-by: Christian Stimming <stimming@tuhh.de> Signed-off-by: Paul Mackerras <paulus@samba.org>
Christian Stimming committed
Jan 9, 2008 at 14:12 UTC
73c4f228504324364348247534ee9b22e55f4751
1 file changed
+38
-25
Makefile
+38
-25
@@ -1,25 +1,52 @@
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
1
+# The default target of this Makefile is...
2
+all::
3
10
-# From here on, these are needed in git.git/gitk/Makefile.
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))
10
15
-## Beginning of po-file creation rules
11
+TCLTK_PATH ?= wish
12
+INSTALL ?= install
13
+RM ?= rm -f
14
+
15
+DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
16
+bindir_SQ = $(subst ','\'',$(bindir))
17
+TCLTK_PATH_SQ = $(subst ','\'',$(TCLTK_PATH))
18
+
19
+## po-file creation rules
20
XGETTEXT ?= xgettext
21
MSGFMT ?= msgfmt
22
PO_TEMPLATE = po/gitk.pot
23
ALL_POFILES = $(wildcard po/*.po)
24
ALL_MSGFILES = $(subst .po,.msg,$(ALL_POFILES))
25
22
-all:: $(ALL_MSGFILES)
26
+ifndef V
27
+ QUIET = @
28
+ QUIET_GEN = $(QUIET)echo ' ' GEN $@ &&
29
+endif
30
+
31
+all:: gitk-wish $(ALL_MSGFILES)
32
+
33
+install:: all
34
+ $(INSTALL) gitk-wish '$(DESTDIR_SQ)$(bindir_SQ)'/gitk
35
+ $(INSTALL) -d '$(DESTDIR_SQ)$(msgsdir_SQ)'
36
+ $(foreach p,$(ALL_MSGFILES), $(INSTALL) $p '$(DESTDIR_SQ)$(msgsdir_SQ)' &&) true
37
+
38
+uninstall::
39
+ $(foreach p,$(ALL_MSGFILES), $(RM) '$(DESTDIR_SQ)$(msgsdir_SQ)'/$(notdir $p) &&) true
40
+ $(RM) '$(DESTDIR_SQ)$(bindir_SQ)'/gitk
41
+
42
+clean::
43
+ $(RM) gitk-wish po/*.msg
44
+
45
+gitk-wish: gitk
46
+ $(QUIET_GEN)$(RM) $@ $@+ && \
47
+ sed -e '1,3s|^exec .* "$$0"|exec $(subst |,'\|',$(TCLTK_PATH_SQ)) "$$0"|' <gitk >$@+ && \
48
+ chmod +x $@+ && \
49
+ mv -f $@+ $@
50
51
$(PO_TEMPLATE): gitk
52
$(XGETTEXT) -kmc -LTcl -o $@ gitk
@@ -29,17 +56,3 @@ $(ALL_MSGFILES): %.msg : %.po
56
@echo Generating catalog $@
57
$(MSGFMT) --statistics --tcl $< -l $(basename $(notdir $<)) -d $(dir $@)
58
32
-clean::
33
- rm -f $(ALL_PROGRAMS) po/*.msg
34
-## End of po-file creation rules
35
-
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
40
-
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)