tg-info.sh: Fix list of >1 dependencies
[topgit/greenrd.git] / Makefile
blob3913d66b9de41db4bb2b78c0af2980a6dbc31cea
1 # Set PREFIX to wherever you want to install TopGit
2 PREFIX = $(HOME)
3 bindir = $(PREFIX)/bin
4 cmddir = $(PREFIX)/libexec/topgit
5 hooksdir = $(cmddir)/hooks
8 commands_in = tg-create.sh tg-delete.sh tg-info.sh tg-patch.sh tg-summary.sh tg-update.sh
9 hooks_in = hooks/pre-commit.sh
11 commands_out = $(patsubst %.sh,%,$(commands_in))
12 hooks_out = $(patsubst %.sh,%,$(hooks_in))
14 all:: tg $(commands_out) $(hooks_out)
16 tg $(commands_out) $(hooks_out): % : %.sh
17 @echo "[SED] $@"
18 @sed -e 's#@cmddir@#$(cmddir)#g;' \
19 -e 's#@hooksdir@#$(hooksdir)#g' \
20 -e 's#@bindir@#$(bindir)#g' \
21 $@.sh >$@+ && \
22 chmod +x $@+ && \
23 mv $@+ $@
26 install:: all
27 install tg "$(bindir)"
28 install -d -m 755 "$(cmddir)"
29 install $(commands_out) "$(cmddir)"
30 install -d -m 755 "$(hooksdir)"
31 install $(hooks_out) "$(hooksdir)"
33 clean::
34 rm -f tg $(commands_out) $(hooks_out)