xref: /freebsd/usr.bin/mandoc/Makefile (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1# $FreeBSD$
2
3.include <src.opts.mk>
4
5MANDOCDIR=	${SRCTOP}/contrib/mandoc
6.PATH: ${MANDOCDIR}
7
8PROG=	mandoc
9MAN=	mandoc.1 eqn.7 mandoc_char.7 tbl.7 man.7 mdoc.7 roff.7
10MLINKS=	mandoc.1 mdocml.1
11.if ${MK_MAN_UTILS} != no
12MAN+=	apropos.1 makewhatis.8
13MLINKS+=	apropos.1 whatis.1
14LINKS=	${BINDIR}/mandoc ${BINDIR}/whatis \
15	${BINDIR}/mandoc ${BINDIR}/makewhatis \
16	${BINDIR}/mandoc ${BINDIR}/apropos
17.elif defined(BOOTSTRAPPING)
18.error "MK_MAN_UTILS should be set to yes when bootstrapping"
19.endif
20
21LIBMAN_SRCS=	man.c \
22		man_macro.c \
23		man_validate.c
24
25LIBMDOC_SRCS=	arch.c \
26		att.c \
27		lib.c \
28		mdoc.c \
29		mdoc_argv.c \
30		mdoc_macro.c \
31		mdoc_markdown.c \
32		mdoc_state.c \
33		mdoc_validate.c \
34		st.c \
35
36LIBROFF_SRCS=	eqn.c \
37		roff.c \
38		roff_html.c \
39		roff_term.c \
40		roff_validate.c \
41		tbl.c \
42		tbl_data.c \
43		tbl_layout.c \
44		tbl_opts.c \
45
46LIB_SRCS=	${LIBMAN_SRCS} \
47		${LIBMDOC_SRCS} \
48		${LIBROFF_SRCS} \
49		chars.c \
50		mandoc.c \
51		mandoc_aux.c \
52		mandoc_msg.c \
53		mandoc_ohash.c \
54		mandoc_xr.c \
55		msec.c \
56		preconv.c \
57		read.c \
58		compat_recallocarray.c \
59
60HTML_SRCS=	eqn_html.c \
61		html.c \
62		man_html.c \
63		mdoc_html.c \
64		tbl_html.c
65
66MAN_SRCS=	mdoc_man.c
67
68TERM_SRCS=	eqn_term.c \
69		man_term.c \
70		mdoc_term.c \
71		term.c \
72		term_ascii.c \
73		term_ps.c \
74		term_tab.c \
75		tbl_term.c
76
77DBM_SRCS=	dbm.c \
78		dbm_map.c \
79		mansearch.c
80
81DBA_SRCS=	dba.c \
82		dba_array.c \
83		dba_read.c \
84		dba_write.c \
85		mandocdb.c
86
87SRCS=		${LIB_SRCS} \
88		${HTML_SRCS} \
89		${MAN_SRCS} \
90		${TERM_SRCS} \
91		${DBM_SRCS} \
92		${DBA_SRCS} \
93		main.c \
94		manpath.c \
95		out.c \
96		tag.c \
97		tree.c
98
99WARNS?=	3
100CFLAGS+= -DHAVE_CONFIG_H \
101	 -I${SRCTOP}/lib/libopenbsd/
102# This can be removed after swtiching to newer gcc
103CFLAGS.gcc+=	-Wno-format
104LIBADD=	openbsd z
105
106.include <bsd.prog.mk>
107