606bec640ee4d8b425d6ef9c8b2313a2e9435f84
1 all::
3 SCRIPT_SH = git-gui.sh
4 GITGUI_BUILT_INS = git-citool
5 ALL_PROGRAMS = $(GITGUI_BUILT_INS) $(patsubst %.sh,%,$(SCRIPT_SH))
6 GITGUI_VERSION := $(shell git describe)
8 ifndef SHELL_PATH
9 SHELL_PATH = /bin/sh
10 endif
12 gitexecdir := $(shell git --exec-path)
13 INSTALL = install
15 DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
16 gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
18 SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
20 $(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh
21 rm -f $@ $@+
22 sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
23 -e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \
24 $@.sh >$@+
25 chmod +x $@+
26 mv $@+ $@
28 $(GITGUI_BUILT_INS): git-gui
29 rm -f $@ && ln git-gui $@
31 all:: $(ALL_PROGRAMS)
33 install: all
34 $(INSTALL) -d -m755 '$(DESTDIR_SQ)$(gitexecdir_SQ)'
35 $(INSTALL) git-gui '$(DESTDIR_SQ)$(gitexecdir_SQ)'
36 $(foreach p,$(GITGUI_BUILT_INS), rm -f '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' && ln '$(DESTDIR_SQ)$(gitexecdir_SQ)/git-gui' '$(DESTDIR_SQ)$(gitexecdir_SQ)/$p' ;)
38 clean::
39 rm -f $(ALL_PROGRAMS)