aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--mk/sys.mk13
-rw-r--r--runlevels/Makefile2
-rw-r--r--sh/Makefile2
4 files changed, 12 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 7fe80718..6d5e562e 100644
--- a/Makefile
+++ b/Makefile
@@ -17,5 +17,5 @@ include ${MK}/subdir.mk
include ${MK}/dist.mk
_installafter:
- ${INSTALL} -d ${DESTDIR}${RC_LIB}/init.d
- ${INSTALL} -d ${DESTDIR}${RC_LIB}/tmp
+ ${INSTALL} -d ${DESTDIR}/${PREFIX}/${RC_LIB}/init.d
+ ${INSTALL} -d ${DESTDIR}/${PREFIX}/${RC_LIB}/tmp
diff --git a/mk/sys.mk b/mk/sys.mk
index e3111e37..2e62b652 100644
--- a/mk/sys.mk
+++ b/mk/sys.mk
@@ -7,7 +7,10 @@ INSTALL?= install
RANLIB?= ranlib
SH= /bin/sh
-PREFIX=
+PREFIX?=
+_UPREFIX_SH= case "${PREFIX}" in "") echo /usr;; *) echo "${PREFIX}";; esac
+_UPREFIX!= ${_UPREFIX_SH}
+UPREFIX= ${_UPREFIX}$(shell ${_UPREFIX_SH})
PKG_PREFIX= /usr/local
PICFLAG?= -fPIC
@@ -15,18 +18,18 @@ PICFLAG?= -fPIC
BINDIR?= ${PREFIX}/sbin
BINMODE?= 0755
-INCDIR?= ${PREFIX}/usr/include
+INCDIR?= ${UPREFIX}/include
INCMODE?= 0444
LIBNAME?= lib
-LIBDIR?= ${PREFIX}/usr/${LIBNAME}
+LIBDIR?= ${UPREFIX}/${LIBNAME}
LIBMODE?= 0444
SHLIBDIR?= ${PREFIX}/${LIBNAME}
-MANDIR?= ${PREFIX}/usr/share/man/man
+MANDIR?= ${UPREFIX}/share/man/man
MANMODE?= 0444
-DOCDIR?= ${PREFIX}/usr/share/doc
+DOCDIR?= ${UPREFIX}/share/doc
DOCMODE?= 0644
CONFMODE?= 0644
diff --git a/runlevels/Makefile b/runlevels/Makefile
index 05e45399..4634d6c4 100644
--- a/runlevels/Makefile
+++ b/runlevels/Makefile
@@ -2,7 +2,7 @@ BOOT= bootmisc fsck hostname localmount \
root swap sysctl urandom
DEFAULT= local netmount
-LEVELDIR= ${DESTDIR}/etc/runlevels
+LEVELDIR= ${DESTDIR}/${PREFIX}/etc/runlevels
BOOTDIR= ${LEVELDIR}/boot
DEFAULTDIR= ${LEVELDIR}/default
diff --git a/sh/Makefile b/sh/Makefile
index bda82a03..aae07a32 100644
--- a/sh/Makefile
+++ b/sh/Makefile
@@ -11,7 +11,7 @@ include Makefile.${SUBOS}
include ${MK}/scripts.mk
_installafter:
- ${INSTALL} -d ${DESTDIR}/etc/init.d
+ ${INSTALL} -d ${DESTDIR}/${PREFIX}/etc/init.d
@# Provide an init script for the loopback interface
ln -snf ${RC_LIB}/sh/net.sh ${DESTDIR}/${PREFIX}/etc/init.d/${NET_LO} || exit $$?
@# Put functions.sh into the init.d dir so 3rd party apps don't have to