X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;ds=sidebyside;f=Makefile;h=cf842d686a1ff7db9f15a330ac5e565a29940824;hb=73faba23cdeffa3181bcfdb0c5966f01412f4013;hp=3913d66b9de41db4bb2b78c0af2980a6dbc31cea;hpb=308892d0c071135031994606170c8be6653e7197;p=topgit.git diff --git a/Makefile b/Makefile index 3913d66..cf842d6 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ PREFIX = $(HOME) bindir = $(PREFIX)/bin cmddir = $(PREFIX)/libexec/topgit +sharedir = $(PREFIX)/share/topgit hooksdir = $(cmddir)/hooks @@ -10,25 +11,34 @@ hooks_in = hooks/pre-commit.sh commands_out = $(patsubst %.sh,%,$(commands_in)) hooks_out = $(patsubst %.sh,%,$(hooks_in)) +help_out = $(patsubst %.sh,%.txt,$(commands_in)) -all:: tg $(commands_out) $(hooks_out) +all:: tg $(commands_out) $(hooks_out) $(help_out) tg $(commands_out) $(hooks_out): % : %.sh @echo "[SED] $@" @sed -e 's#@cmddir@#$(cmddir)#g;' \ -e 's#@hooksdir@#$(hooksdir)#g' \ -e 's#@bindir@#$(bindir)#g' \ + -e 's#@sharedir@#$(sharedir)#g' \ $@.sh >$@+ && \ chmod +x $@+ && \ mv $@+ $@ +$(help_out): README + @CMD=`echo $@ | sed -e 's/tg-//' -e 's/\.txt//'` && \ + echo '[HELP]' $$CMD && \ + ./create-help.sh $$CMD install:: all + install -d -m 755 "$(bindir)" install tg "$(bindir)" install -d -m 755 "$(cmddir)" install $(commands_out) "$(cmddir)" install -d -m 755 "$(hooksdir)" install $(hooks_out) "$(hooksdir)" + install -d -m 755 "$(sharedir)" + install -m 644 $(help_out) "$(sharedir)" clean:: - rm -f tg $(commands_out) $(hooks_out) + rm -f tg $(commands_out) $(hooks_out) $(help_out)