freebsd-skq/tools/kerneldoc/subsys/Makefile
Alexander Leidinger 20cb1f56a9 - Update config to doxygen 1.5.2 (I use this with 1.5.9).
- Add linprocfs and linsysfs to the linuxulator dox.
- Take the generated includes from the .m files from a subdirectory
  instead of putting everything into $(.OBJDIR). This imporves the
  human readbility of the source directory contents a lot, if you do not
  create a separate OBJDIR.
- Assume UTF-8 encoding for every input file.
- Strip the source and dest path from the output, we are not interested
  in the absolute location on the machine where the docs are created,
  relative the the root of the FreeBSD source is what interests us.
- Exclude .svn directories.
- Switch to alphabetic index.
- Use one line per INCLUDE_PATH member in the common dox-config.
- Bump the __FreeBSD__ version to 9.		[MFC: to 8]
- Switch from hardcoded .m files to an run-time generated one. Takes
  a little bit more time to get started with actual work, but at least
  is more future-proof. If you generate dox for all subsystems, the
  time to find all .m files in the source is magnitutes lower than
  producing the docs.
- Make the *DEST_PATH overidable from the environment. This allows to
  produce the output directly in the docroot of a webserver.
- Fix the path when telling the user where he can find the API docs.

MFC after:	1 month (after 8.0)
2009-08-24 13:10:55 +00:00

96 lines
2.5 KiB
Makefile

#
# $FreeBSD$
#
_ALL!= cd ${.CURDIR} && ls Doxyfile-*
ALL= ${_ALL:C/Doxyfile-//g}
PDF_ALL=${_ALL:C/Doxyfile/pdf/g}
TARGET_ARCH?= ${MACHINE_ARCH}
S?=/usr/src/sys
LOCALBASE?=/usr/local
MFILES!= find ${S} -name \*.m | sed -e 's:${S}/::g'
HFILES= ${MFILES:T:S/.m$/.h/}
AWK?= awk
.MAIN: usage
usage:
@echo "Possible targets are:"
.for entry in ${ALL}
@echo " ${entry}"
@echo " pdf-${entry}"
@echo " clean-${entry}"
.endfor
@echo
@echo " all"
@echo " pdf-all"
@echo " clean"
all: ${ALL}
pdf-all:${PDF_ALL}
mfiles: ${HFILES:S/^/${.OBJDIR}\/include\//}
DOXYGEN_DEST_PATH?= ${.OBJDIR}
DOXYGEN_LATEX_DEST_PATH?=${.OBJDIR}
DOXYGEN_PDF_DEST_PATH?= ${.OBJDIR}
.if exists(${S}/${TARGET_ARCH}/linux)
DOXYGEN_LINUX_PATH= ${S}/${TARGET_ARCH}/linux
.endif
.if exists(${S}/${TARGET_ARCH}/linux32)
DOXYGEN_LINUX_PATH+= ${S}/${TARGET_ARCH}/linux32
.endif
#
# generate the necessary targets
#
.for target in ${ALL}
${target}: mfiles ${.OBJDIR}/${target}/${target}.tag
${.OBJDIR}/${target}/${target}.tag:
@mkdir -p ${.OBJDIR}/${target}
@cd ${.OBJDIR} && \
env DOXYGEN_INCLUDE_PATH=${.CURDIR} \
DOXYGEN_SRC_PATH=${S} \
DOXYGEN_DEST_PATH=${DOXYGEN_DEST_PATH} \
DOXYGEN_SRC_INCLUDE_PATH="${S}/sys ${S}/../include ${S}/${TARGET_ARCH}/include ${.OBJDIR}/include" \
DOXYGEN_TARGET_ARCH=${TARGET_ARCH} \
DOXYGEN_LINUX_PATH=${DOXYGEN_LINUX_PATH} \
NOTREVIEWED=${.CURDIR}/notreviewed.dox \
PATH=${LOCALBASE}/bin:${PATH} \
doxygen ${.CURDIR}/Doxyfile-${target}
@echo "API docs for ${target} are now available in ${DOXYGEN_DEST_PATH}/${target}/." | /usr/bin/fmt
pdf-${target}: ${.OBJDIR}/${target}/${target}.tag
@cd ${DOXYGEN_LATEX_DEST_PATH}/${target}/latex && ${MAKE} refman.pdf && cp refman.pdf ${DOXYGEN_PDF_DEST_PATH}/${target}.pdf
@echo "API docs for ${target} are now available in ${DOXYGEN_PDF_DEST_PATH}/." | /usr/bin/fmt
CLEANDIRS+= ${DOXYGEN_DEST_PATH}/${target}
CLEANDIRS+= ${.OBJDIR}/${target}/
CLEANFILES+= ${DOXYGEN_PDF_DEST_PATH}/${target}.pdf
clean-${target}:
rm -rf ${DOXYGEN_DEST_PATH}/${target} ${.OBJDIR}/${target}
.endfor
CLEANDIRS+= ${.OBJDIR}/include
.for file in ${MFILES}
CLEANFILES+= ${.OBJDIR}/include/${file:T:S/.m$/.h/}
${.OBJDIR}/include/${file:T:S/.m$/.h/}: ${S}/${file}
@mkdir -p ${.OBJDIR}/include
cd ${.OBJDIR}/include && ${AWK} -f $S/tools/makeobjops.awk ${S}/${file} -h
.endfor
#
# update target for the config files {config syntax change}
#
update-doxys:
.for config_file in ${_ALL}
@doxygen -u ${config_file}
.endfor
.include "Dependencies"
.include <bsd.obj.mk>