xref: /openbsd/usr.bin/mandoc/Makefile (revision 73471bf0)
1# $OpenBSD: Makefile,v 1.118 2020/03/13 00:31:04 schwarze Exp $
2
3.include <bsd.own.mk>
4
5CFLAGS  += -W -Wall -Wstrict-prototypes -Wno-unused-parameter
6DPADD	+= ${LIBUTIL}
7LDADD	+= -lutil -lz
8
9SRCS=	mandoc_aux.c mandoc_ohash.c mandoc.c mandoc_msg.c mandoc_xr.c \
10	arch.c chars.c msec.c preconv.c read.c tag.c
11SRCS+=	roff.c roff_validate.c tbl.c tbl_opts.c tbl_layout.c tbl_data.c eqn.c
12SRCS+=	mdoc.c mdoc_argv.c mdoc_macro.c mdoc_state.c mdoc_validate.c \
13	att.c st.c
14SRCS+=	man_macro.c man.c man_validate.c
15SRCS+=	main.c out.c tree.c
16SRCS+=	term.c term_ascii.c term_ps.c term_tab.c term_tag.c
17SRCS+=	roff_term.c mdoc_term.c man_term.c eqn_term.c tbl_term.c
18SRCS+=	mdoc_man.c
19SRCS+=	html.c roff_html.c mdoc_html.c man_html.c eqn_html.c tbl_html.c
20SRCS+=	mdoc_markdown.c
21SRCS+=	dbm_map.c dbm.c dba_write.c dba_array.c dba.c dba_read.c
22SRCS+=	manpath.c mandocdb.c mansearch.c
23
24PROG=	mandoc
25
26LINKS =	${BINDIR}/mandoc ${BINDIR}/apropos \
27	${BINDIR}/mandoc ${BINDIR}/help \
28	${BINDIR}/mandoc ${BINDIR}/man \
29	${BINDIR}/mandoc ${BINDIR}/whatis \
30	${BINDIR}/mandoc /usr/sbin/makewhatis \
31	${BINDIR}/mandoc /usr/libexec/makewhatis
32
33MAN =	apropos.1 man.1 mandoc.1 man.conf.5 makewhatis.8
34
35CLEANFILES += man.cgi cgi.o
36
37afterinstall:
38	install -o ${BINOWN} -g ${BINGRP} -m 444 \
39	    ${.CURDIR}/mandoc.css ${DESTDIR}/usr/share/misc
40
41
42# ----------------------------------------------------------------------
43# Variables and targets to build and install man.cgi(8),
44# not used during make build and make release.
45
46# To configure, run:	cp cgi.h.example cgi.h; vi cgi.h
47# To build, run:	make man.cgi
48# To install, run:	sudo make installcgi
49# After that, read:	man man.cgi.8
50
51LIBMDOC_OBJS =	mdoc_argv.o mdoc_macro.o mdoc_state.o \
52		mdoc_validate.o mdoc.o att.o st.o
53LIBMAN_OBJS =	man.o man_macro.o man_validate.o
54LIBROFF_OBJS =	roff.o roff_validate.o eqn.o \
55		tbl.o tbl_data.o tbl_layout.o tbl_opts.o
56LIBMANDOC_OBJS = ${LIBMDOC_OBJS} ${LIBMAN_OBJS} ${LIBROFF_OBJS} \
57		arch.o mandoc.o mandoc_aux.o mandoc_msg.o mandoc_ohash.o \
58		mandoc_xr.o chars.o msec.o preconv.o read.o tag.o
59HTML_OBJS =	html.o roff_html.o mdoc_html.o man_html.o \
60		tbl_html.o eqn_html.o out.o
61CGI_OBJS =	${LIBMANDOC_OBJS} ${HTML_OBJS} \
62		dbm_map.o dbm.o mansearch.o cgi.o
63
64cgi.o: cgi.h main.h manconf.h mandoc.h mandoc_aux.h mandoc_parse.h \
65	mansearch.h man.h mdoc.h roff.h
66
67man.cgi: ${CGI_OBJS}
68	${CC} ${LDFLAGS} ${STATIC} -o ${.TARGET} ${CGI_OBJS} ${LDADD}
69
70installcgi: man.cgi
71	${INSTALL} -d -o root -g wheel -m 755 ${DESTDIR}/var/www/cgi-bin
72	${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP} \
73	    -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
74	    man.cgi ${DESTDIR}/var/www/cgi-bin/man.cgi
75	${INSTALL} ${INSTALL_COPY} -o root -g wheel -m 644 \
76	    ${.CURDIR}/mandoc.css ${DESTDIR}/var/www/htdocs/
77
78.include <bsd.prog.mk>
79