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