3 # Define V=1 to have a more verbose compile.
6 GIT-VERSION-FILE
: .FORCE-GIT-VERSION-FILE
7 @
$(SHELL_PATH
) .
/GIT-VERSION-GEN
8 -include GIT-VERSION-FILE
10 GITGUI_BUILT_INS
= git-citool
11 ALL_PROGRAMS
= git-gui
$(GITGUI_BUILT_INS
)
18 gitexecdir
:= $(shell git
--exec-path
)
26 QUIET_GEN
= @echo
' ' GEN
$@
;
27 QUIET_BUILT_IN
= @echo
' ' BUILTIN
$@
;
30 DESTDIR_SQ
= $(subst ','\'',$(DESTDIR))
31 gitexecdir_SQ = $(subst ','\'',$(gitexecdir
))
32 SHELL_PATH_SQ
= $(subst ','\'',$(SHELL_PATH))
34 git-gui: git-gui.sh GIT-VERSION-FILE CREDITS-FILE
35 $(QUIET_GEN)rm -f $@ $@+ && \
37 -e '1s|
#!.*/sh|#!$(SHELL_PATH_SQ)|' \
38 -e
's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \
39 -e
'1,/^set gitgui_credits /p' \
41 cat CREDITS-FILE
>>$@
+ && \
42 sed
-e
'1,/^set gitgui_credits /d' $@.sh
>>$@
+ && \
46 CREDITS-FILE
: CREDITS-GEN .FORCE-CREDITS-FILE
47 $(QUIET_GEN
)$(SHELL_PATH
) .
/CREDITS-GEN
49 $(GITGUI_BUILT_INS
): git-gui
50 $(QUIET_BUILT_IN
)rm -f
$@
&& ln git-gui
$@
55 $(INSTALL
) -d
-m755
'$(DESTDIR_SQ)$(gitexecdir_SQ)'
56 $(INSTALL
) git-gui
'$(DESTDIR_SQ)$(gitexecdir_SQ)'
57 $(foreach p
,$(GITGUI_BUILT_INS
), rm -f
'$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln
'$(DESTDIR_SQ)$(gitexecdir_SQ)/git-gui' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)
59 dist-version
: CREDITS-FILE
61 @echo
$(GITGUI_VERSION
) > $(TARDIR
)/version
62 @cat CREDITS-FILE
> $(TARDIR
)/credits
65 rm -f
$(ALL_PROGRAMS
) GIT-VERSION-FILE CREDITS-FILE
67 .PHONY
: all install dist-version
clean
68 .PHONY
: .FORCE-GIT-VERSION-FILE
69 .PHONY
: .FORCE-CREDITS-FILE