X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=topgit.git;a=blobdiff_plain;f=Makefile;h=31cc98e6fecdc1cec803f8c5744eb9b324d5b4b0;hp=b73a1f15b9c298e0e922df1c61f6fb15df8f7821;hb=fb1f5d8decc74bf60a3075ec92908d60e6b3402b;hpb=4c8ab25482e6f47878090d87a295eba50d04a564 diff --git a/Makefile b/Makefile index b73a1f1..31cc98e 100644 --- a/Makefile +++ b/Makefile @@ -1,25 +1,25 @@ -prefix = $(HOME) -bindir = $(prefix)/bin -cmddir = $(prefix)/libexec/topgit -sharedir = $(prefix)/share/topgit -hooksdir = $(cmddir)/hooks +prefix ?= $(HOME) +bindir := $(prefix)/bin +cmddir := $(prefix)/share/topgit +docdir := $(prefix)/share/doc/topgit +hooksdir := $(cmddir)/hooks -commands_in = $(wildcard tg-*.sh) +commands_in := $(wildcard tg-*.sh) 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)) +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) $(help_out) -tg $(commands_out) $(hooks_out): % : %.sh +tg $(commands_out) $(hooks_out): % : %.sh Makefile @echo "[SED] $@" @sed -e 's#@cmddir@#$(cmddir)#g;' \ -e 's#@hooksdir@#$(hooksdir)#g' \ -e 's#@bindir@#$(bindir)#g' \ - -e 's#@sharedir@#$(sharedir)#g' \ + -e 's#@docdir@#$(docdir)#g' \ $@.sh >$@+ && \ chmod +x $@+ && \ mv $@+ $@ @@ -36,8 +36,8 @@ install:: all install $(commands_out) "$(DESTDIR)$(cmddir)" install -d -m 755 "$(DESTDIR)$(hooksdir)" install $(hooks_out) "$(DESTDIR)$(hooksdir)" - install -d -m 755 "$(DESTDIR)$(sharedir)" - install -m 644 $(help_out) "$(DESTDIR)$(sharedir)" + install -d -m 755 "$(DESTDIR)$(docdir)" + install -m 644 $(help_out) "$(DESTDIR)$(docdir)" clean:: rm -f tg $(commands_out) $(hooks_out) $(help_out)