openrc/man/Makefile

38 lines
907 B
Makefile
Raw Normal View History

_MAN3_SH= ls -1 *.3
_MAN3!= ${_MAN3_SH}
MAN3= ${_MAN3}$(shell ${_MAN3_SH})
_MAN8_SH= ls -1 *.8
_MAN8!= ${_MAN8_SH}
MAN8= ${_MAN8}$(shell ${_MAN8_SH})
2007-12-24 17:18:33 +05:30
2007-12-25 04:04:22 +05:30
# Handy macro to create symlinks
# This does rely on correctly formatting our manpages!
MAKE_LINKS= suffix=$${man\#*.}; \
prefix=$${man%%.*}; \
for link in `sed -e 's/ ,//g' \
-n -e '/^\.Sh NAME$$/,/\.Sh/ s/\.Nm //p' $${man}`; do \
if test "$${link}" != "$${prefix}" ; then \
ln -sf $${man} \
2008-01-11 21:33:38 +05:30
${DESTDIR}/${MANDIR}$${suffix}/$${link}.$${suffix} ; \
fi; \
done;
2007-12-25 04:04:22 +05:30
2008-01-11 21:33:38 +05:30
MK= ../mk
include ${MK}/sys.mk
all:
install:
2008-01-11 21:33:38 +05:30
${INSTALL} -d ${DESTDIR}/${MANDIR}3
for man in ${MAN3}; do \
2008-01-11 21:33:38 +05:30
${INSTALL} -m ${MANMODE} "$$man" ${DESTDIR}/${MANDIR}3 || exit $$?; \
${MAKE_LINKS} \
2007-12-24 17:18:33 +05:30
done
2008-01-11 21:33:38 +05:30
${INSTALL} -d ${DESTDIR}/${MANDIR}8
for man in ${MAN8}; do \
2008-01-11 21:33:38 +05:30
${INSTALL} -m ${MANMODE} "$$man" ${DESTDIR}/${MANDIR}8 || exit $$?; \
${MAKE_LINKS} \
done
clean: