diff --git a/support/posix.mk b/support/posix.mk index af84558677..995afc9fab 100644 --- a/support/posix.mk +++ b/support/posix.mk @@ -1,16 +1,24 @@ -prefix ?= $(INSTALLPREFIX) -INSTBIN= $(prefix)/bin -INSTMAN= $(prefix)/share/man1 +INSTBIN= ${DESTDIR}${INSTALLPREFIX}/bin +INSTMAN= ${DESTDIR}${INSTALLPREFIX}/share/man1 +INSTDBG= ${DESTDIR}/usr/lib/debug/${INSTALLPREFIX}/bin MAN=man/tvheadend.1 install: ${PROG} ${MAN} - mkdir -p ${DESTDIR}$(INSTBIN) - install -s ${PROG} ${DESTDIR}$(INSTBIN) + mkdir -p ${INSTBIN} + mkdir -p ${INSTDBG} + install -T ${PROG} ${INSTBIN}/tvheadend - mkdir -p ${DESTDIR}$(INSTMAN) - install ${MAN} ${DESTDIR}$(INSTMAN) + objcopy --only-keep-debug ${INSTBIN}/tvheadend ${INSTDBG}/tvheadend.debug + strip -g ${INSTBIN}/tvheadend + + objcopy --add-gnu-debuglink=${INSTDBG}/tvheadend.debug ${INSTBIN}/tvheadend + + + mkdir -p ${INSTMAN} + install ${MAN} ${INSTMAN} uninstall: - rm -f ${DESTDIR}$(INSTBIN)/${PROG} - rm -f ${DESTDIR}$(INSTMAN)/${MAN} + rm -f ${INSTBIN}/tvheadend + rm -f ${INSTDBG}/tvheadend.debug + rm -f ${INSTMAN}/tvheadend.1