Automagically link our man pages.
This commit is contained in:
parent
c876853859
commit
3e8695f6f0
14
man/Makefile
14
man/Makefile
@ -9,12 +9,26 @@ MAN8 = $(_MAN8)$(shell $(_MAN8_SH))
|
|||||||
TOPDIR = ..
|
TOPDIR = ..
|
||||||
include $(TOPDIR)/default.mk
|
include $(TOPDIR)/default.mk
|
||||||
|
|
||||||
|
# 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)/$(DIR)/man$${suffix}/$${link}.$${suffix} ; \
|
||||||
|
fi; \
|
||||||
|
done;
|
||||||
|
|
||||||
install::
|
install::
|
||||||
$(INSTALL) -d $(DESTDIR)/$(DIR)/man3
|
$(INSTALL) -d $(DESTDIR)/$(DIR)/man3
|
||||||
for man in $(MAN3); do \
|
for man in $(MAN3); do \
|
||||||
$(INSTALL) -m 0644 "$$man" $(DESTDIR)/$(DIR)/man3 || exit $$?; \
|
$(INSTALL) -m 0644 "$$man" $(DESTDIR)/$(DIR)/man3 || exit $$?; \
|
||||||
|
$(MAKE_LINKS) \
|
||||||
done
|
done
|
||||||
$(INSTALL) -d $(DESTDIR)/$(DIR)/man8
|
$(INSTALL) -d $(DESTDIR)/$(DIR)/man8
|
||||||
for man in $(MAN8); do \
|
for man in $(MAN8); do \
|
||||||
$(INSTALL) -m 0644 "$$man" $(DESTDIR)/$(DIR)/man8 || exit $$?; \
|
$(INSTALL) -m 0644 "$$man" $(DESTDIR)/$(DIR)/man8 || exit $$?; \
|
||||||
|
$(MAKE_LINKS) \
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user