##
# RMOL manual pages
#
# The man pages are generated by Doxygen, from "source" files (having the
# .doc extension).
#
# However, as for now, Doxygen is able to produce man pages for only a
# single man section. So, Doxygen needs to be run twice, both with its
# corresponding configuration file: one for man section 1 (section
# corresponding to the commands) and the other one for man section 3
# (section corresponding to the global/general entries).
#
MAINTAINERCLEANFILES = Makefile.in doxygen_man1.cfg doxygen_man3.cfg
#
MAN_SRC_SUFFIX = doc
MAN_CMD_TARGET_SUFFIX = 1
MAN_GEN_TARGET_SUFFIX = 3
MAN1_DIR = man$(MAN_CMD_TARGET_SUFFIX)
MAN3_DIR = man$(MAN_GEN_TARGET_SUFFIX)
# The following man pages belong to section 1 (and generated for that section)
MAN_CMD_SRC = rmol.doc rmol-config.doc
MAN_CMD_MANS = $(MAN_CMD_SRC:%.doc=%.$(MAN_CMD_TARGET_SUFFIX))
# The following man pages belong to section 3 (and generated for that section)
MAN_GEN_SRC = rmol-library.doc
MAN_GEN_MANS = $(MAN_GEN_SRC:%.doc=%.$(MAN_GEN_TARGET_SUFFIX))
#
MAN_SRC = $(MAN_CMD_SRC) $(MAN_GEN_SRC)
man_MANS = $(MAN_CMD_MANS) $(MAN_GEN_MANS)
#
EXTRA_DIST = $(MAN_SRC) doxygen_man1.cfg.in doxygen_man3.cfg.in
#
all-local: man-local
man-local: man1-local man3-local
man1-local: doxygen_man1.cfg $(MAN1_SRC)
doxygen $< ; \
mv -f $(MAN1_DIR)/* . && rmdir $(MAN1_DIR)
man3-local: doxygen_man3.cfg $(MAN3_SRC)
doxygen $< ; \
mv -f $(MAN3_DIR)/* . && rmdir $(MAN3_DIR)
install-data-local: man-local
$(mkinstalldirs) $(DESTDIR)$(mandir)/$(MAN1_DIR) $(DESTDIR)$(mandir)/$(MAN3_DIR)
$(INSTALL_DATA) $(MAN_CMD_MANS) $(DESTDIR)$(mandir)/$(MAN1_DIR)
$(INSTALL_DATA) $(MAN_GEN_MANS) $(DESTDIR)$(mandir)/$(MAN3_DIR)
uninstall-local:
rm -rf $(DESTDIR)$(mandir)
clean-local:
rm -f *.$(MAN_CMD_TARGET_SUFFIX) *.$(MAN_GEN_TARGET_SUFFIX)