1 # Set PREFIX to wherever you want to install TopGit
4 cmddir = $(PREFIX)/libexec/topgit
5 sharedir = $(PREFIX)/share/topgit
6 hooksdir = $(cmddir)/hooks
9 commands_in = tg-create.sh tg-delete.sh tg-info.sh tg-patch.sh tg-summary.sh tg-update.sh
10 hooks_in = hooks/pre-commit.sh
12 commands_out = $(patsubst %.sh,%,$(commands_in))
13 hooks_out = $(patsubst %.sh,%,$(hooks_in))
14 help_out = $(patsubst %.sh,%.txt,$(commands_in))
16 all:: tg $(commands_out) $(hooks_out) $(help_out)
18 tg $(commands_out) $(hooks_out): % : %.sh
20 @sed -e 's#@cmddir@#$(cmddir)#g;' \
21 -e 's#@hooksdir@#$(hooksdir)#g' \
22 -e 's#@bindir@#$(bindir)#g' \
23 -e 's#@sharedir@#$(sharedir)#g' \
29 ./create-help.sh `echo $@ | sed -e 's/tg-//' -e 's/\.txt//'`
32 install tg "$(bindir)"
33 install -d -m 755 "$(cmddir)"
34 install $(commands_out) "$(cmddir)"
35 install -d -m 755 "$(hooksdir)"
36 install $(hooks_out) "$(hooksdir)"
37 install -d -m 755 "$(sharedir)"
38 install $(help_out) "$(sharedir)"
41 rm -f tg $(commands_out) $(hooks_out) $(help_out)