3 cmddir
= $(prefix)/libexec
/topgit
4 sharedir
= $(prefix)/share
/topgit
5 hooksdir
= $(cmddir
)/hooks
8 commands_in
= $(wildcard tg-
*.sh
)
9 hooks_in
= hooks
/pre-commit.sh
11 commands_out
= $(patsubst %.sh
,%,$(commands_in
))
12 hooks_out
= $(patsubst %.sh
,%,$(hooks_in
))
13 help_out
= $(patsubst %.sh
,%.txt
,$(commands_in
))
15 all:: tg
$(commands_out
) $(hooks_out
) $(help_out
)
17 tg
$(commands_out
) $(hooks_out
): % : %.sh Makefile
19 @sed
-e
's#@cmddir@#$(cmddir)#g;' \
20 -e
's#@hooksdir@#$(hooksdir)#g' \
21 -e
's#@bindir@#$(bindir)#g' \
22 -e
's#@sharedir@#$(sharedir)#g' \
28 @CMD
=`echo $@ | sed -e 's/tg-//' -e 's/\.txt//'` && \
29 echo
'[HELP]' $$CMD && \
30 .
/create-help.sh
$$CMD
33 install -d
-m
755 "$(DESTDIR)$(bindir)"
34 install tg
"$(DESTDIR)$(bindir)"
35 install -d
-m
755 "$(DESTDIR)$(cmddir)"
36 install $(commands_out
) "$(DESTDIR)$(cmddir)"
37 install -d
-m
755 "$(DESTDIR)$(hooksdir)"
38 install $(hooks_out
) "$(DESTDIR)$(hooksdir)"
39 install -d
-m
755 "$(DESTDIR)$(sharedir)"
40 install -m
644 $(help_out
) "$(DESTDIR)$(sharedir)"
43 rm -f tg
$(commands_out
) $(hooks_out
) $(help_out
)