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 ::
9
3
10
- # From here on, these are needed in git.git/gitk/Makefile.
4
+ prefix ?= $(HOME )
5
+ bindir ?= $(prefix ) /bin
6
+ sharedir ?= $(prefix ) /share
11
7
gitk_libdir ?= $(sharedir ) /gitk/lib
12
8
msgsdir ?= $(gitk_libdir ) /msgs
13
9
msgsdir_SQ = $(subst ','\'',$(msgsdir ) )
14
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
16
20
XGETTEXT ?= xgettext
17
21
MSGFMT ?= msgfmt
18
22
PO_TEMPLATE = po/gitk.pot
19
23
ALL_POFILES = $(wildcard po/* .po)
20
24
ALL_MSGFILES = $(subst .po,.msg,$(ALL_POFILES ) )
21
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 $@ + $@
23
50
24
51
$(PO_TEMPLATE ) : gitk
25
52
$(XGETTEXT ) -kmc -LTcl -o $@ gitk
@@ -29,17 +56,3 @@ $(ALL_MSGFILES): %.msg : %.po
29
56
@echo Generating catalog $@
30
57
$(MSGFMT ) --statistics --tcl $< -l $(basename $(notdir $< ) ) -d $(dir $@ )
31
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 )
0 commit comments