summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-05-12 20:38:24 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-05-12 20:38:24 -0400
commitd66b53cf13bb491618ab96335cb422445f8e4395 (patch)
treec81430a563b8c7449541dc77f89ff741019f92a3 /Makefile
parentbd6489c9c43cf3d92f248844e1663c11daedf291 (diff)
adjust to not hardcode where the jh-* programs are
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 7 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 810b0c4..c2465b5 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,9 @@
prefix = /usr
bindir = $(prefix)/bin
-# pkgdatadir is hardcoded into jh.sh
-pkgdatadir = /usr/share/jh
-
+jh-bindir = $(prefix)/share/jh
subcommands = help list-commands mvn-basename mvn-install mvn-localrepo checksource
-dirs = $(DESTDIR)$(bindir) $(DESTDIR)$(pkgdatadir)
+dirs = $(DESTDIR)$(bindir) $(DESTDIR)$(jh-bindir)
####
@@ -17,11 +15,14 @@ all: PHONY build
####
build: PHONY jh $(subcommand_files)
-install: PHONY $(DESTDIR)$(bindir)/jh $(addprefix $(DESTDIR)$(pkgdatadir)/,$(subcommand_files) $(help_files))
+install: PHONY $(DESTDIR)$(bindir)/jh $(addprefix $(DESTDIR)$(jh-bindir)/,$(subcommand_files) $(help_files))
clean: PHONY
rm -f jh $(subcommand_files)
-$(DESTDIR)$(pkgdatadir)/%: % | $(DESTDIR)$(pkgdatadir)
+jh.sh: jh.sh.in
+ sed 's|@jh-bindir@|$(jh-bindir)|g' < $< > $@
+
+$(DESTDIR)$(jh-bindir)/%: % | $(DESTDIR)$(jh-bindir)
cp '$<' '$@'
$(DESTDIR)$(bindir)/jh: jh | $(DESTDIR)$(bindir)