1# Id: Makefile,v 1.530 2019/03/06 16:08:41 schwarze Exp
2#
3# Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
4# Copyright (c) 2011, 2013-2019 Ingo Schwarze <schwarze@openbsd.org>
5#
6# Permission to use, copy, modify, and distribute this software for any
7# purpose with or without fee is hereby granted, provided that the above
8# copyright notice and this permission notice appear in all copies.
9#
10# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17
18VERSION = 1.14.5
19
20# === LIST OF FILES ====================================================
21
22TESTSRCS   = test-be32toh.c \
23                       test-cmsg.c \
24                       test-dirent-namlen.c \
25                       test-EFTYPE.c \
26                       test-err.c \
27                       test-fts.c \
28                       test-getline.c \
29                       test-getsubopt.c \
30                       test-isblank.c \
31                       test-mkdtemp.c \
32                       test-nanosleep.c \
33                       test-noop.c \
34                       test-ntohl.c \
35                       test-O_DIRECTORY.c \
36                       test-ohash.c \
37                       test-PATH_MAX.c \
38                       test-pledge.c \
39                       test-progname.c \
40                       test-reallocarray.c \
41                       test-recallocarray.c \
42                       test-recvmsg.c \
43                       test-rewb-bsd.c \
44                       test-rewb-sysv.c \
45                       test-sandbox_init.c \
46                       test-strcasestr.c \
47                       test-stringlist.c \
48                       test-strlcat.c \
49                       test-strlcpy.c \
50                       test-strndup.c \
51                       test-strptime.c \
52                       test-strsep.c \
53                       test-strtonum.c \
54                       test-vasprintf.c \
55                       test-wchar.c
56
57SRCS                 = arch.c \
58                       att.c \
59                       catman.c \
60                       cgi.c \
61                       chars.c \
62                       compat_err.c \
63                       compat_fts.c \
64                       compat_getline.c \
65                       compat_getsubopt.c \
66                       compat_isblank.c \
67                       compat_mkdtemp.c \
68                       compat_ohash.c \
69                       compat_progname.c \
70                       compat_reallocarray.c \
71                       compat_recallocarray.c \
72                       compat_strcasestr.c \
73                       compat_stringlist.c \
74                       compat_strlcat.c \
75                       compat_strlcpy.c \
76                       compat_strndup.c \
77                       compat_strsep.c \
78                       compat_strtonum.c \
79                       compat_vasprintf.c \
80                       dba.c \
81                       dba_array.c \
82                       dba_read.c \
83                       dba_write.c \
84                       dbm.c \
85                       dbm_map.c \
86                       demandoc.c \
87                       eqn.c \
88                       eqn_html.c \
89                       eqn_term.c \
90                       html.c \
91                       lib.c \
92                       main.c \
93                       man.c \
94                       man_html.c \
95                       man_macro.c \
96                       man_term.c \
97                       man_validate.c \
98                       mandoc.c \
99                       mandoc_aux.c \
100                       mandoc_msg.c \
101                       mandoc_ohash.c \
102                       mandoc_xr.c \
103                       mandocd.c \
104                       mandocdb.c \
105                       manpath.c \
106                       mansearch.c \
107                       mdoc.c \
108                       mdoc_argv.c \
109                       mdoc_html.c \
110                       mdoc_macro.c \
111                       mdoc_man.c \
112                       mdoc_markdown.c \
113                       mdoc_state.c \
114                       mdoc_term.c \
115                       mdoc_validate.c \
116                       msec.c \
117                       out.c \
118                       preconv.c \
119                       read.c \
120                       roff.c \
121                       roff_html.c \
122                       roff_term.c \
123                       roff_validate.c \
124                       soelim.c \
125                       st.c \
126                       tag.c \
127                       tbl.c \
128                       tbl_data.c \
129                       tbl_html.c \
130                       tbl_layout.c \
131                       tbl_opts.c \
132                       tbl_term.c \
133                       term.c \
134                       term_ascii.c \
135                       term_ps.c \
136                       term_tab.c \
137                       tree.c
138
139DISTFILES  = INSTALL \
140                       LICENSE \
141                       Makefile \
142                       Makefile.depend \
143                       NEWS \
144                       TODO \
145                       apropos.1 \
146                       catman.8 \
147                       cgi.h.example \
148                       compat_fts.h \
149                       compat_ohash.h \
150                       compat_stringlist.h \
151                       configure \
152                       configure.local.example \
153                       dba.h \
154                       dba_array.h \
155                       dba_write.h \
156                       dbm.h \
157                       dbm_map.h \
158                       demandoc.1 \
159                       eqn.7 \
160                       eqn.h \
161                       eqn_parse.h \
162                       gmdiff \
163                       html.h \
164                       lib.in \
165                       libman.h \
166                       libmandoc.h \
167                       libmdoc.h \
168                       main.h \
169                       makewhatis.8 \
170                       man.1 \
171                       man.7 \
172                       man.cgi.3 \
173                       man.cgi.8 \
174                       man.conf.5 \
175                       man.h \
176                       man.options.1 \
177                       manconf.h \
178                       mandoc.1 \
179                       mandoc.3 \
180                       mandoc.css \
181                       mandoc.db.5 \
182                       mandoc.h \
183                       mandoc_aux.h \
184                       mandoc_char.7 \
185                       mandoc_escape.3 \
186                       mandoc_headers.3 \
187                       mandoc_html.3 \
188                       mandoc_malloc.3 \
189                       mandoc_ohash.h \
190                       mandoc_parse.h \
191                       mandoc_xr.h \
192                       mandocd.8 \
193                       mansearch.3 \
194                       mansearch.h \
195                       mchars_alloc.3 \
196                       mdoc.7 \
197                       mdoc.h \
198                       msec.in \
199                       out.h \
200                       predefs.in \
201                       roff.7 \
202                       roff.h \
203                       roff_int.h \
204                       soelim.1 \
205                       tag.h \
206                       tbl.3 \
207                       tbl.7 \
208                       tbl.h \
209                       tbl_int.h \
210                       tbl_parse.h \
211                       term.h \
212                       $(SRCS) \
213                       $(TESTSRCS)
214
215LIBMAN_OBJS          = man.o \
216                       man_macro.o \
217                       man_validate.o
218
219LIBMDOC_OBJS         = att.o \
220                       lib.o \
221                       mdoc.o \
222                       mdoc_argv.o \
223                       mdoc_macro.o \
224                       mdoc_state.o \
225                       mdoc_validate.o \
226                       st.o
227
228LIBROFF_OBJS         = eqn.o \
229                       roff.o \
230                       roff_validate.o \
231                       tbl.o \
232                       tbl_data.o \
233                       tbl_layout.o \
234                       tbl_opts.o
235
236LIBMANDOC_OBJS       = $(LIBMAN_OBJS) \
237                       $(LIBMDOC_OBJS) \
238                       $(LIBROFF_OBJS) \
239                       arch.o \
240                       chars.o \
241                       mandoc.o \
242                       mandoc_aux.o \
243                       mandoc_msg.o \
244                       mandoc_ohash.o \
245                       mandoc_xr.o \
246                       msec.o \
247                       preconv.o \
248                       read.o
249
250COMPAT_OBJS          = compat_err.o \
251                       compat_fts.o \
252                       compat_getline.o \
253                       compat_getsubopt.o \
254                       compat_isblank.o \
255                       compat_mkdtemp.o \
256                       compat_ohash.o \
257                       compat_progname.o \
258                       compat_reallocarray.o \
259                       compat_recallocarray.o \
260                       compat_strcasestr.o \
261                       compat_strlcat.o \
262                       compat_strlcpy.o \
263                       compat_strndup.o \
264                       compat_strsep.o \
265                       compat_strtonum.o \
266                       compat_vasprintf.o
267
268MANDOC_HTML_OBJS = eqn_html.o \
269                       html.o \
270                       man_html.o \
271                       mdoc_html.o \
272                       roff_html.o \
273                       tbl_html.o
274
275MANDOC_TERM_OBJS = eqn_term.o \
276                       man_term.o \
277                       mdoc_term.o \
278                       roff_term.o \
279                       term.o \
280                       term_ascii.o \
281                       term_ps.o \
282                       term_tab.o \
283                       tbl_term.o
284
285DBM_OBJS   = dbm.o \
286                       dbm_map.o \
287                       mansearch.o
288
289DBA_OBJS   = dba.o \
290                       dba_array.o \
291                       dba_read.o \
292                       dba_write.o \
293                       mandocdb.o
294
295MAIN_OBJS  = $(MANDOC_HTML_OBJS) \
296                       $(MANDOC_MAN_OBJS) \
297                       $(MANDOC_TERM_OBJS) \
298                       $(DBM_OBJS) \
299                       $(DBA_OBJS) \
300                       main.o \
301                       manpath.o \
302                       mdoc_man.o \
303                       mdoc_markdown.o \
304                       out.o \
305                       tag.o \
306                       tree.o
307
308CGI_OBJS   = $(MANDOC_HTML_OBJS) \
309                       $(DBM_OBJS) \
310                       cgi.o \
311                       out.o
312
313MANDOCD_OBJS         = $(MANDOC_HTML_OBJS) \
314                       $(MANDOC_TERM_OBJS) \
315                       mandocd.o \
316                       out.o \
317                       tag.o
318
319DEMANDOC_OBJS        = demandoc.o
320
321SOELIM_OBJS          = soelim.o \
322                       compat_err.o \
323                       compat_getline.o \
324                       compat_progname.o \
325                       compat_reallocarray.o \
326                       compat_stringlist.o
327
328WWW_MANS   = apropos.1.html \
329                       demandoc.1.html \
330                       man.1.html \
331                       man.options.1.html \
332                       mandoc.1.html \
333                       soelim.1.html \
334                       man.cgi.3.html \
335                       mandoc.3.html \
336                       mandoc_escape.3.html \
337                       mandoc_headers.3.html \
338                       mandoc_html.3.html \
339                       mandoc_malloc.3.html \
340                       mansearch.3.html \
341                       mchars_alloc.3.html \
342                       tbl.3.html \
343                       man.conf.5.html \
344                       mandoc.db.5.html \
345                       eqn.7.html \
346                       man.7.html \
347                       mandoc_char.7.html \
348                       mdoc.7.html \
349                       roff.7.html \
350                       tbl.7.html \
351                       catman.8.html \
352                       makewhatis.8.html \
353                       man.cgi.8.html \
354                       mandocd.8.html
355
356WWW_INCS   = eqn.h.html \
357                       html.h.html \
358                       man.h.html \
359                       manconf.h.html \
360                       mandoc.h.html \
361                       mandoc_aux.h.html \
362                       mandoc_parse.h.html \
363                       mansearch.h.html \
364                       mdoc.h.html \
365                       roff.h.html \
366                       tbl.h.html \
367                       tbl_int.h.html \
368                       tbl_parse.h.html
369
370# === USER CONFIGURATION ===============================================
371
372-include Makefile.local
373
374# === DEPENDENCY HANDLING ==============================================
375
376all: mandoc demandoc soelim $(BUILD_TARGETS) Makefile.local
377
378install: base-install $(INSTALL_TARGETS)
379
380www: $(WWW_MANS) $(WWW_INCS)
381
382$(WWW_MANS) $(WWW_INCS): mandoc
383
384.PHONY: base-install cgi-install install www-install
385.PHONY: clean distclean depend
386
387include Makefile.depend
388
389# === TARGETS CONTAINING SHELL COMMANDS ================================
390
391distclean: clean
392          rm -f Makefile.local config.h config.h.old config.log config.log.old
393
394clean:
395          rm -f libmandoc.a $(LIBMANDOC_OBJS) $(COMPAT_OBJS)
396          rm -f mandoc $(MAIN_OBJS)
397          rm -f man.cgi $(CGI_OBJS)
398          rm -f mandocd catman catman.o $(MANDOCD_OBJS)
399          rm -f demandoc $(DEMANDOC_OBJS)
400          rm -f soelim $(SOELIM_OBJS)
401          rm -f $(WWW_MANS) $(WWW_INCS) mandoc*.tar.gz mandoc*.sha256
402          rm -rf *.dSYM
403
404base-install: mandoc demandoc soelim
405          mkdir -p $(DESTDIR)$(BINDIR)
406          mkdir -p $(DESTDIR)$(SBINDIR)
407          mkdir -p $(DESTDIR)$(MANDIR)/man1
408          mkdir -p $(DESTDIR)$(MANDIR)/man5
409          mkdir -p $(DESTDIR)$(MANDIR)/man7
410          mkdir -p $(DESTDIR)$(MANDIR)/man8
411          $(INSTALL_PROGRAM) mandoc demandoc $(DESTDIR)$(BINDIR)
412          $(INSTALL_PROGRAM) soelim $(DESTDIR)$(BINDIR)/$(BINM_SOELIM)
413          cd $(DESTDIR)$(BINDIR) && $(LN) mandoc $(BINM_MAN)
414          cd $(DESTDIR)$(BINDIR) && $(LN) mandoc $(BINM_APROPOS)
415          cd $(DESTDIR)$(BINDIR) && $(LN) mandoc $(BINM_WHATIS)
416          cd $(DESTDIR)$(SBINDIR) && \
417                    $(LN) ${BIN_FROM_SBIN}/mandoc $(BINM_MAKEWHATIS)
418          $(INSTALL_MAN) mandoc.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1
419          $(INSTALL_MAN) soelim.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_SOELIM).1
420          $(INSTALL_MAN) man.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_MAN).1
421          $(INSTALL_MAN) apropos.1 $(DESTDIR)$(MANDIR)/man1/$(BINM_APROPOS).1
422          cd $(DESTDIR)$(MANDIR)/man1 && $(LN) $(BINM_APROPOS).1 $(BINM_WHATIS).1
423          $(INSTALL_MAN) man.conf.5 $(DESTDIR)$(MANDIR)/man5/$(MANM_MANCONF).5
424          $(INSTALL_MAN) mandoc.db.5 $(DESTDIR)$(MANDIR)/man5
425          $(INSTALL_MAN) man.7 $(DESTDIR)$(MANDIR)/man7/$(MANM_MAN).7
426          $(INSTALL_MAN) mdoc.7 $(DESTDIR)$(MANDIR)/man7/$(MANM_MDOC).7
427          $(INSTALL_MAN) roff.7 $(DESTDIR)$(MANDIR)/man7/$(MANM_ROFF).7
428          $(INSTALL_MAN) eqn.7 $(DESTDIR)$(MANDIR)/man7/$(MANM_EQN).7
429          $(INSTALL_MAN) tbl.7 $(DESTDIR)$(MANDIR)/man7/$(MANM_TBL).7
430          $(INSTALL_MAN) mandoc_char.7 $(DESTDIR)$(MANDIR)/man7
431          $(INSTALL_MAN) makewhatis.8 \
432                    $(DESTDIR)$(MANDIR)/man8/$(BINM_MAKEWHATIS).8
433
434lib-install: libmandoc.a
435          mkdir -p $(DESTDIR)$(LIBDIR)
436          mkdir -p $(DESTDIR)$(INCLUDEDIR)
437          mkdir -p $(DESTDIR)$(MANDIR)/man3
438          $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR)
439          $(INSTALL_LIB) eqn.h man.h mandoc.h mandoc_aux.h mandoc_parse.h \
440                    mdoc.h roff.h tbl.h $(DESTDIR)$(INCLUDEDIR)
441          $(INSTALL_MAN) mandoc.3 mandoc_escape.3 mandoc_malloc.3 \
442                    mansearch.3 mchars_alloc.3 tbl.3 $(DESTDIR)$(MANDIR)/man3
443
444cgi-install: man.cgi
445          mkdir -p $(DESTDIR)$(CGIBINDIR)
446          mkdir -p $(DESTDIR)$(HTDOCDIR)
447          $(INSTALL_PROGRAM) man.cgi $(DESTDIR)$(CGIBINDIR)
448          $(INSTALL_DATA) mandoc.css $(DESTDIR)$(HTDOCDIR)
449
450catman-install: mandocd catman
451          mkdir -p $(DESTDIR)$(SBINDIR)
452          mkdir -p $(DESTDIR)$(MANDIR)/man8
453          $(INSTALL_PROGRAM) mandocd $(DESTDIR)$(SBINDIR)
454          $(INSTALL_PROGRAM) catman $(DESTDIR)$(SBINDIR)/$(BINM_CATMAN)
455          $(INSTALL_MAN) mandocd.8 $(DESTDIR)$(MANDIR)/man8
456          $(INSTALL_MAN) catman.8 $(DESTDIR)$(MANDIR)/man8/$(BINM_CATMAN).8
457
458uninstall:
459          rm -f $(DESTDIR)$(BINDIR)/mandoc
460          rm -f $(DESTDIR)$(BINDIR)/demandoc
461          rm -f $(DESTDIR)$(BINDIR)/$(BINM_SOELIM)
462          rm -f $(DESTDIR)$(BINDIR)/$(BINM_MAN)
463          rm -f $(DESTDIR)$(BINDIR)/$(BINM_APROPOS)
464          rm -f $(DESTDIR)$(BINDIR)/$(BINM_WHATIS)
465          rm -f $(DESTDIR)$(SBINDIR)/$(BINM_MAKEWHATIS)
466          rm -f $(DESTDIR)$(MANDIR)/man1/mandoc.1
467          rm -f $(DESTDIR)$(MANDIR)/man1/demandoc.1
468          rm -f $(DESTDIR)$(MANDIR)/man1/$(BINM_SOELIM).1
469          rm -f $(DESTDIR)$(MANDIR)/man1/$(BINM_MAN).1
470          rm -f $(DESTDIR)$(MANDIR)/man1/$(BINM_APROPOS).1
471          rm -f $(DESTDIR)$(MANDIR)/man1/$(BINM_WHATIS).1
472          rm -f $(DESTDIR)$(MANDIR)/man5/$(MANM_MANCONF).5
473          rm -f $(DESTDIR)$(MANDIR)/man5/mandoc.db.5
474          rm -f $(DESTDIR)$(MANDIR)/man7/$(MANM_MAN).7
475          rm -f $(DESTDIR)$(MANDIR)/man7/$(MANM_MDOC).7
476          rm -f $(DESTDIR)$(MANDIR)/man7/$(MANM_ROFF).7
477          rm -f $(DESTDIR)$(MANDIR)/man7/$(MANM_EQN).7
478          rm -f $(DESTDIR)$(MANDIR)/man7/$(MANM_TBL).7
479          rm -f $(DESTDIR)$(MANDIR)/man7/mandoc_char.7
480          rm -f $(DESTDIR)$(MANDIR)/man8/$(BINM_MAKEWHATIS).8
481          rm -f $(DESTDIR)$(CGIBINDIR)/man.cgi
482          rm -f $(DESTDIR)$(HTDOCDIR)/mandoc.css
483          rm -f $(DESTDIR)$(SBINDIR)/mandocd
484          rm -f $(DESTDIR)$(SBINDIR)/$(BINM_CATMAN)
485          rm -f $(DESTDIR)$(MANDIR)/man8/mandocd.8
486          rm -f $(DESTDIR)$(MANDIR)/man8/$(BINM_CATMAN).8
487          rm -f $(DESTDIR)$(LIBDIR)/libmandoc.a
488          rm -f $(DESTDIR)$(MANDIR)/man3/mandoc.3
489          rm -f $(DESTDIR)$(MANDIR)/man3/mandoc_escape.3
490          rm -f $(DESTDIR)$(MANDIR)/man3/mandoc_malloc.3
491          rm -f $(DESTDIR)$(MANDIR)/man3/mansearch.3
492          rm -f $(DESTDIR)$(MANDIR)/man3/mchars_alloc.3
493          rm -f $(DESTDIR)$(MANDIR)/man3/tbl.3
494          rm -f $(DESTDIR)$(INCLUDEDIR)/eqn.h
495          rm -f $(DESTDIR)$(INCLUDEDIR)/man.h
496          rm -f $(DESTDIR)$(INCLUDEDIR)/mandoc.h
497          rm -f $(DESTDIR)$(INCLUDEDIR)/mandoc_aux.h
498          rm -f $(DESTDIR)$(INCLUDEDIR)/mandoc_parse.h
499          rm -f $(DESTDIR)$(INCLUDEDIR)/mdoc.h
500          rm -f $(DESTDIR)$(INCLUDEDIR)/roff.h
501          rm -f $(DESTDIR)$(INCLUDEDIR)/tbl.h
502          [ ! -e $(DESTDIR)$(INCLUDEDIR) ] || rmdir $(DESTDIR)$(INCLUDEDIR)
503
504regress: all
505          cd regress && ./regress.pl
506
507regress-clean:
508          cd regress && ./regress.pl . clean
509
510Makefile.local config.h: configure $(TESTSRCS)
511          @echo "$@ is out of date; please run ./configure"
512          @exit 1
513
514libmandoc.a: $(COMPAT_OBJS) $(LIBMANDOC_OBJS)
515          ar rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS)
516
517mandoc: $(MAIN_OBJS) libmandoc.a
518          $(CC) -o $@ $(LDFLAGS) $(MAIN_OBJS) libmandoc.a $(LDADD)
519
520man.cgi: $(CGI_OBJS) libmandoc.a
521          $(CC) $(STATIC) -o $@ $(LDFLAGS) $(CGI_OBJS) libmandoc.a $(LDADD)
522
523mandocd: $(MANDOCD_OBJS) libmandoc.a
524          $(CC) -o $@ $(LDFLAGS) $(MANDOCD_OBJS) libmandoc.a $(LDADD)
525
526catman: catman.o libmandoc.a
527          $(CC) -o $@ $(LDFLAGS) catman.o libmandoc.a $(LDADD)
528
529demandoc: $(DEMANDOC_OBJS) libmandoc.a
530          $(CC) -o $@ $(LDFLAGS) $(DEMANDOC_OBJS) libmandoc.a $(LDADD)
531
532soelim: $(SOELIM_OBJS)
533          $(CC) -o $@ $(LDFLAGS) $(SOELIM_OBJS)
534
535# --- maintainer targets ---
536
537www-install: www
538          $(INSTALL_DATA) mandoc.css $(HTDOCDIR)
539          $(INSTALL_DATA) $(WWW_MANS) $(HTDOCDIR)/man
540          $(INSTALL_DATA) $(WWW_INCS) $(HTDOCDIR)/includes
541
542depend: config.h
543          mkdep -f Makefile.depend $(CFLAGS) $(SRCS)
544          perl -e 'undef $$/; $$_ = <>; s|/usr/include/\S+||g; \
545                    s|\\\n||g; s|  +| |g; s| $$||mg; print;' \
546                    Makefile.depend > Makefile.tmp
547          mv Makefile.tmp Makefile.depend
548
549regress-distclean:
550          @find regress \
551                    -name '.#*' -o \
552                    -name '*.orig' -o \
553                    -name '*.rej' -o \
554                    -name '*.core' \
555                    -exec rm -i {} \;
556
557regress-distcheck:
558          @find regress ! -type d ! -type f
559          @find regress -type f \
560                    ! -path '*/CVS/*' \
561                    ! -name Makefile \
562                    ! -name Makefile.inc \
563                    ! -name '*.in' \
564                    ! -name '*.out_ascii' \
565                    ! -name '*.out_utf8' \
566                    ! -name '*.out_html' \
567                    ! -name '*.out_markdown' \
568                    ! -name '*.out_lint' \
569                    ! -path regress/regress.pl \
570                    ! -path regress/regress.pl.1
571
572dist: mandoc-$(VERSION).sha256
573
574mandoc-$(VERSION).sha256: mandoc-$(VERSION).tar.gz
575          sha256 mandoc-$(VERSION).tar.gz > $@
576
577mandoc-$(VERSION).tar.gz: $(DISTFILES)
578          ls regress/*/*/*.mandoc_* && exit 1 || true
579          mkdir -p .dist/mandoc-$(VERSION)/
580          $(INSTALL) -m 0644 $(DISTFILES) .dist/mandoc-$(VERSION)
581          cp -pR regress .dist/mandoc-$(VERSION)
582          find .dist/mandoc-$(VERSION)/regress \
583              -type d -name CVS -print0 | xargs -0 rm -rf
584          chmod 755 .dist/mandoc-$(VERSION)/configure
585          ( cd .dist/ && tar zcf ../$@ mandoc-$(VERSION) )
586          rm -rf .dist/
587
588dist-install: dist
589          $(INSTALL_DATA) mandoc-$(VERSION).tar.gz mandoc-$(VERSION).sha256 \
590              $(HTDOCDIR)/snapshots
591
592# === SUFFIX RULES =====================================================
593
594.SUFFIXES:           .1       .3       .5       .7       .8       .h
595.SUFFIXES:           .1.html  .3.html  .5.html  .7.html  .8.html  .h.html
596
597.h.h.html:
598          highlight -I $< > $@
599
600.1.1.html .3.3.html .5.5.html .7.7.html .8.8.html: mandoc
601          mandoc -Thtml -Wwarning,stop \
602                    -O 'style=/mandoc.css,man=/man/%N.%S.html;https://man.openbsd.org/%N.%S,includes=/includes/%I.html' \
603                    $< > $@
604