aboutsummaryrefslogtreecommitdiff
path: root/mk/prog.mk
diff options
context:
space:
mode:
Diffstat (limited to 'mk/prog.mk')
-rw-r--r--mk/prog.mk13
1 files changed, 11 insertions, 2 deletions
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