#--*- Makefile -*--------------------------------------------------------------
#$Author: antanas $
#$Revision: 8840 $
#$Date: 2021-07-30 19:52:52 +0300 (Fri, 30 Jul 2021) $
#$URL: svn+ssh://www.crystallography.net/home/coder/svn-repositories/cod-tools/tags/v3.8.1/Makelocal-manpages $
#------------------------------------------------------------------------------

MAN_DIR = doc/man
C_PROGRAM_EXE_FILE_BASES = ${notdir ${C_PROGRAM_EXE_FILES}}
MAN_FILES = ${CODTOOLS_SCRIPTS:scripts/%=${MAN_DIR}/%.1} \
            ${C_PROGRAM_EXE_FILE_BASES:%=${MAN_DIR}/%.1}

BUGS_EMAIL = cod-bugs@ibt.lt

man: ${MAN_FILES}

all: man

${MAN_DIR}/%.1: scripts/%
	-tools/help2man $< --bugs-email ${BUGS_EMAIL} > $@

${MAN_DIR}/%.1: src/components/codcif/%
	-$< --help | tools/help2man --stdin --name $* --bugs-email ${BUGS_EMAIL} > $@

clean-man:
	rm -f ${MAN_FILES}

cleanAll distclean: clean-man
