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