aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-01-11 17:21:21 +0000
committerRoy Marples <roy@marples.name>2008-01-11 17:21:21 +0000
commitcd685410bd7d8f1893a9f585c784e43878e13913 (patch)
treea9e10856edc5134b1ddcad51d360cc73b0eb2fdc
parent28afeac09e15c9983021d7afb7af523f8f62c5fa (diff)
NetBSD doesn't include /lib in its link path, so we need to add it as an RPATH.
-rw-r--r--etc.BSD/.gitignore2
-rw-r--r--mk/prog.mk13
-rw-r--r--mk/scripts.mk4
3 files changed, 17 insertions, 2 deletions
diff --git a/etc.BSD/.gitignore b/etc.BSD/.gitignore
new file mode 100644
index 00000000..fe38bc1f
--- /dev/null
+++ b/etc.BSD/.gitignore
@@ -0,0 +1,2 @@
+rc
+rc.shutdown
diff --git a/mk/prog.mk b/mk/prog.mk
index 75562508..c475427e 100644
--- a/mk/prog.mk
+++ b/mk/prog.mk
@@ -5,13 +5,22 @@
OBJS+= ${SRCS:.c=.o}
+include ${MK}/sys.mk
+# Some systems don't include /lib in their standard link path
+# so we should embed it if different
+_RPATH_SH= if test "${SHLIBDIR}" != "/usr/${LIBNAME}"; then \
+ echo "-Wl,-rpath-link,${DESTDIR}${SHLIBDIR}:${DESTDIR}/usr/lib -R${SHLIBDIR}"; \
+ fi
+_RPATH!= ${_RPATH_SH}
+LDFLAGS+= ${_RPATH}$(shell ${_RPATH_SH})
+LDFLAGS+= ${PROGLDFLAGS}
+
all: depend ${PROG}
${PROG}: ${SCRIPTS} ${OBJS}
- ${CC} ${CFLAGS} ${LDFLAGS} ${PROGLDFLAGS} -o $@ ${OBJS} ${LDADD}
+ ${CC} ${CFLAGS} ${LDFLAGS} -o $@ ${OBJS} ${LDADD}
clean:
rm -f ${OBJS} ${PROG} ${CLEANFILES}
-include ${MK}/sys.mk
include ${MK}/depend.mk
diff --git a/mk/scripts.mk b/mk/scripts.mk
index ac231cef..35815b57 100644
--- a/mk/scripts.mk
+++ b/mk/scripts.mk
@@ -29,5 +29,9 @@ realinstall: ${BIN} ${CONF} ${CONF_APPEND}
install: realinstall ${INSTALLAFTER}
+# A lot of scripts don't have anything to clean
+# Also, some rm implentation require a file argument regardless of error
+# so we ensure that it has a bogus argument
+CLEANFILES?= .bogus
clean:
rm -f ${OBJS} ${CLEANFILES}