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-export.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 @CMD
=`echo $@ | sed -e 's/tg-//' -e 's/\.txt//'` && \
30 echo
'[HELP]' $$CMD && \
31 .
/create-help.sh
$$CMD
34 install -d
-m
755 "$(bindir)"
35 install tg
"$(bindir)"
36 install -d
-m
755 "$(cmddir)"
37 install $(commands_out
) "$(cmddir)"
38 install -d
-m
755 "$(hooksdir)"
39 install $(hooks_out
) "$(hooksdir)"
40 install -d
-m
755 "$(sharedir)"
41 install -m
644 $(help_out
) "$(sharedir)"
44 rm -f tg
$(commands_out
) $(hooks_out
) $(help_out
)