xref: /freebsd/tools/kerneldoc/subsys/Makefile (revision 0efd6615cd5f39b67cec82a7034e655f3b5801e3)
1#
2# $FreeBSD$
3#
4
5_ALL!=	cd ${.CURDIR} && ls Doxyfile-*
6ALL=	${_ALL:C/Doxyfile-//g}
7PDF_ALL=${_ALL:C/Doxyfile/pdf/g}
8
9TARGET_ARCH?=	${MACHINE_ARCH}
10S?=/usr/src/sys
11LOCALBASE?=/usr/local
12
13MFILES+=dev/acpica/acpi_if.m
14MFILES+=dev/ata/ata_if.m
15MFILES+=dev/eisa/eisa_if.m
16MFILES+=dev/iicbus/iicbb_if.m
17MFILES+=dev/iicbus/iicbus_if.m
18MFILES+=dev/mii/miibus_if.m
19MFILES+=dev/ofw/ofw_bus_if.m
20MFILES+=dev/pccard/card_if.m
21MFILES+=dev/pccard/power_if.m
22MFILES+=dev/pci/pci_if.m
23MFILES+=dev/pci/pcib_if.m
24MFILES+=dev/ppbus/ppbus_if.m
25MFILES+=dev/scc/scc_if.m
26MFILES+=dev/smbus/smbus_if.m
27MFILES+=dev/sound/midi/mpu_if.m
28MFILES+=dev/sound/midi/mpufoi_if.m
29MFILES+=dev/sound/midi/synth_if.m
30MFILES+=dev/sound/pcm/ac97_if.m
31MFILES+=dev/sound/pcm/channel_if.m
32MFILES+=dev/sound/pcm/feeder_if.m
33MFILES+=dev/sound/pcm/mixer_if.m
34MFILES+=dev/uart/uart_if.m
35MFILES+=dev/usb/usb_if.m
36MFILES+=isa/isa_if.m
37MFILES+=kern/bus_if.m
38MFILES+=kern/clock_if.m
39MFILES+=kern/cpufreq_if.m
40MFILES+=kern/device_if.m
41MFILES+=kern/linker_if.m
42MFILES+=kern/serdev_if.m
43MFILES+=libkern/iconv_converter_if.m
44MFILES+=opencrypto/crypto_if.m
45MFILES+=pc98/pc98/canbus_if.m
46MFILES+=pci/agp_if.m
47MFILES+=powerpc/powerpc/mmu_if.m
48MFILES+=powerpc/powerpc/pic_if.m
49MFILES+=sparc64/pci/ofw_pci_if.m
50
51HFILES=	${MFILES:T:S/.m$/.h/}
52AWK?=	awk
53
54.MAIN:	usage
55
56usage:
57	@echo "Possible targets are:"
58.for entry in ${ALL}
59	@echo "	${entry}"
60	@echo "	pdf-${entry}"
61	@echo "	clean-${entry}"
62.endfor
63	@echo
64	@echo "	all"
65	@echo "	pdf-all"
66	@echo "	clean"
67
68all:	${ALL}
69pdf-all:${PDF_ALL}
70
71mfiles: ${HFILES:S/^/${.OBJDIR}\//}
72
73DOXYGEN_DEST_PATH=	${.OBJDIR}
74DOXYGEN_LATEX_DEST_PATH=${.OBJDIR}
75DOXYGEN_PDF_DEST_PATH=	${.OBJDIR}
76
77.if exists{${S}/${TARGET_ARCH}/linux}
78DOXYGEN_LINUX_PATH=	${S}/${TARGET_ARCH}/linux
79.endif
80.if exists{${S}/${TARGET_ARCH}/linux32}
81DOXYGEN_LINUX_PATH+=	${S}/${TARGET_ARCH}/linux32
82.endif
83
84#
85# generate the necessary targets
86#
87.for target in ${ALL}
88${target}:	mfiles ${.OBJDIR}/${target}/${target}.tag
89
90${.OBJDIR}/${target}/${target}.tag:
91	@mkdir -p ${.OBJDIR}/${target}
92	@cd ${.OBJDIR} && \
93		env DOXYGEN_INCLUDE_PATH=${.CURDIR} \
94		    DOXYGEN_SRC_PATH=${S}  \
95		    DOXYGEN_DEST_PATH=${DOXYGEN_DEST_PATH} \
96		    DOXYGEN_SRC_INCLUDE_PATH="${S}/sys ${S}/../include ${S}/${TARGET_ARCH}/include" \
97		    DOXYGEN_TARGET_ARCH=${TARGET_ARCH} \
98		    DOXYGEN_LINUX_PATH=${DOXYGEN_LINUX_PATH} \
99		    NOTREVIEWED=${.CURDIR}/notreviewed.dox \
100		    PATH=${LOCALBASE}/bin:${PATH} \
101			doxygen ${.CURDIR}/Doxyfile-${target}
102	@echo "API docs for ${target} are now available in ${.OBJDIR}/${target}/." | /usr/bin/fmt
103
104pdf-${target}:	${.OBJDIR}/${target}/${target}.tag
105	@cd ${DOXYGEN_LATEX_DEST_PATH}/${target}/latex && ${MAKE} refman.pdf && cp refman.pdf ${DOXYGEN_PDF_DEST_PATH}/${target}.pdf
106	@echo "API docs for ${target} are now available in ${DOXYGEN_PDF_DEST_PATH}/." | /usr/bin/fmt
107
108CLEANDIRS+=	${DOXYGEN_DEST_PATH}/${target}
109CLEANDIRS+=	${.OBJDIR}/${target}/
110CLEANFILES+=	${DOXYGEN_PDF_DEST_PATH}/${target}.pdf
111clean-${target}:
112	rm -rf ${DOXYGEN_DEST_PATH}/${target} ${.OBJDIR}/${target}
113.endfor
114
115.for file in ${MFILES}
116CLEANDIRS+=     ${.OBJDIR}/${file:T:S/.m$/.h/}
117${.OBJDIR}/${file:T:S/.m$/.h/}: ${S}/${file}
118	cd ${.OBJDIR}; ${AWK} -f $S/tools/makeobjops.awk ${S}/${file} -h
119.endfor
120
121#
122# update target for the config files {config syntax change}
123#
124update-doxys:
125.for config_file in ${_ALL}
126	@doxygen -u ${config_file}
127.endfor
128
129.include "Dependencies"
130.include <bsd.obj.mk>
131