aboutsummaryrefslogtreecommitdiff
path: root/man/Makefile
blob: f8c8dedb81dd2a15d105908f9ef9c7f6da6fc4b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
MAN3=		einfo.3 \
		rc_config.3 rc_deptree.3 rc_find_pids.3 rc_plugin_hook.3 \
		rc_runlevel.3 rc_service.3 rc_strcatpaths.3 rc_stringlist.3
MAN8=		rc-status.8 rc-update.8 rc.8 runscript.8 start-stop-daemon.8

# 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} \
		${DESTDIR}/${MANDIR}$${suffix}/$${link}.$${suffix} ; \
		fi; \
		done;

MK=		../mk
include ${MK}/sys.mk
include ${MK}/gitignore.mk

all:

install:
	${INSTALL} -d ${DESTDIR}/${MANDIR}3
	for man in ${MAN3}; do \
		${INSTALL} -m ${MANMODE} "$$man" ${DESTDIR}/${MANDIR}3 || exit $$?; \
		${MAKE_LINKS} \
	done	
	${INSTALL} -d ${DESTDIR}/${MANDIR}8
	for man in ${MAN8}; do \
		${INSTALL} -m ${MANMODE} "$$man" ${DESTDIR}/${MANDIR}8 || exit $$?; \
		${MAKE_LINKS} \
	done

clean: