chiark / gitweb /
Merge branch 'i/build' into refs/top-bases/i/basis-merge
[topgit.git] / Makefile
index 07b549b40cc6e4f106ade5fb6c4edeba32fa7ef1..31cc98e6fecdc1cec803f8c5744eb9b324d5b4b0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,21 +1,20 @@
-# Set PREFIX to wherever you want to install TopGit
-PREFIX = $(HOME)
-bindir = $(PREFIX)/bin
-cmddir = $(PREFIX)/share/topgit
-docdir = $(PREFIX)/share/doc/topgit
-hooksdir = $(cmddir)/hooks
+prefix ?= $(HOME)
+bindir := $(prefix)/bin
+cmddir := $(prefix)/share/topgit
+docdir := $(prefix)/share/doc/topgit
+hooksdir := $(cmddir)/hooks
 
 
-commands_in = tg-create.sh tg-delete.sh tg-export.sh tg-info.sh tg-patch.sh tg-summary.sh tg-update.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' \