xref: /freebsd/usr.bin/mandoc/Makefile (revision d9a42747950146bf03cda7f6e25d219253f8a57a)
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		term_tag.c \
76		tbl_term.c
77
78DBM_SRCS=	dbm.c \
79		dbm_map.c \
80		mansearch.c
81
82DBA_SRCS=	dba.c \
83		dba_array.c \
84		dba_read.c \
85		dba_write.c \
86		mandocdb.c
87
88SRCS=		${LIB_SRCS} \
89		${HTML_SRCS} \
90		${MAN_SRCS} \
91		${TERM_SRCS} \
92		${DBM_SRCS} \
93		${DBA_SRCS} \
94		main.c \
95		manpath.c \
96		out.c \
97		tag.c \
98		tree.c
99
100WARNS?=	3
101CFLAGS+= -DHAVE_CONFIG_H \
102	 -I${SRCTOP}/lib/libopenbsd/
103# This can be removed after swtiching to newer gcc
104CFLAGS.gcc+=	-Wno-format
105LIBADD=	openbsd z
106
107.include <bsd.prog.mk>
108