summaryrefslogtreecommitdiff
path: root/src/devtools/Makefile
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-05-26 22:11:51 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-05-26 22:11:51 -0400
commitca6db7290cacee0d3b5ba836e6acea76ea314e50 (patch)
tree7cf3e4eda33335fdcc245d41e75a3b1602485266 /src/devtools/Makefile
parentb159a370e2b1458c8c3817bdf3cabe2a630732e3 (diff)
redo the library system; avoid hard-coded paths
* install all library files to $(libexecdir)/libretools, instead of - $(bindir) - $(datadir)/libretools - $(datadir)/devtools * symlink the executable library files into $(bindir) * add the tool `librelib` * instead of ". /path/to/lib.sh", use ". $(librelib lib.sh)" * mark all libraries with shebangs of what options they support * move blacklist.sh to libreblacklist
Diffstat (limited to 'src/devtools/Makefile')
-rw-r--r--src/devtools/Makefile24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/devtools/Makefile b/src/devtools/Makefile
index e357675..18f1518 100644
--- a/src/devtools/Makefile
+++ b/src/devtools/Makefile
@@ -4,13 +4,21 @@ DESTDIR=
#prefix=/usr/local
prefix=/usr
exec_prefix=$(prefix)
-datarootdir=$(prefix)/share
-
bindir=$(exec_prefix)/bin
sbindir=$(exec_prefix)/sbin
+#libexecdir=$(exec_prefix)/libexec
+libexecdir=$(exec_prefix)/lib
+
+datarootdir=$(prefix)/share
datadir=$(datarootdir)
+#sysconfdir=$(prefix)/etc
+sysconfdir=/etc
+
+docdir=$(datarootdir)/doc
+
+################################################################################
-pkgdatadir=$(datadir)/devtools
+pkglibexecdir=$(libexecdir)/libretools
devtoolsdir=../../../devtools-par
@@ -47,7 +55,7 @@ build: \
lib/common.sh \
lib/makechrootpkg.sh
-edit = sed -e 's|m4_include(lib/\(.*\))|. @pkgdatadir@/\1|' -e "s|@pkgdatadir[@]|$(pkgdatadir)|g"
+edit = sed -e 's|m4_include(lib/\(.*\))|. $$(librelib \1)|'
indent = emacs --batch $1 \
--eval '(setq sh-basic-offset 8)' \
@@ -62,6 +70,8 @@ indent = emacs --batch $1 \
lib/common.sh: %: %.in Makefile
@echo "GEN $@"
@{ \
+ echo '#!/bin/bash -euE' && \
+ echo '#!/bin/bash' && \
echo 'if [[ -z $${_INCLUDE_COMMON_SH:-} ]]; then' && \
echo '_INCLUDE_COMMON_SH=true' && \
cat "$<" && \
@@ -86,8 +96,8 @@ install: \
$(DESTDIR)$(bindir)/find-libprovides \
$(DESTDIR)$(bindir)/finddeps \
$(DESTDIR)$(bindir)/lddd \
- $(DESTDIR)$(pkgdatadir)/common.sh \
- $(DESTDIR)$(pkgdatadir)/makechrootpkg.sh
+ $(DESTDIR)$(pkglibexecdir)/common.sh \
+ $(DESTDIR)$(pkglibexecdir)/makechrootpkg.sh
$(DESTDIR)$(sbindir)/%: %
install -Dm755 $< $@
@@ -95,7 +105,7 @@ $(DESTDIR)$(sbindir)/%: %
$(DESTDIR)$(bindir)/%: %
install -Dm755 $< $@
-$(DESTDIR)$(pkgdatadir)/%: lib/%
+$(DESTDIR)$(pkglibexecdir)/%: lib/%
install -Dm644 $< $@
$(DESTDIR)$(bindir)/find-libprovides: