-.PHONY: clean install installwww
-.SUFFIXES: .sgml .html .md5 .h .h.html
-.SUFFIXES: .1 .3 .7 .8
-.SUFFIXES: .1.txt .3.txt .7.txt .8.txt
-.SUFFIXES: .1.pdf .3.pdf .7.pdf .8.pdf
-.SUFFIXES: .1.ps .3.ps .7.ps .8.ps
-.SUFFIXES: .1.html .3.html .7.html .8.html
-.SUFFIXES: .1.xhtml .3.xhtml .7.xhtml .8.xhtml
-
-# Specify this if you want to hard-code the operating system to appear
-# in the lower-left hand corner of -mdoc manuals.
-# CFLAGS += -DOSNAME="\"OpenBSD 4.5\""
-
-VERSION = 1.11.5
-VDATE = 24 July 2011
-# IFF your system supports multi-byte functions (setlocale(), wcwidth(),
-# putwchar()) AND has __STDC_ISO_10646__ (that is, wchar_t is simply a
-# UCS-4 value) should you define USE_WCHAR. If you define it and your
-# system DOESN'T support this, -Tlocale will produce garbage.
-# If you don't define it, -Tlocale is a synonym for -Tacsii.
-CFLAGS += -DUSE_WCHAR
-CFLAGS += -g -DHAVE_CONFIG_H -DVERSION="\"$(VERSION)\""
-CFLAGS += -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings
-PREFIX = /usr/local
-BINDIR = $(PREFIX)/bin
-INCLUDEDIR = $(PREFIX)/include/mandoc
-LIBDIR = $(PREFIX)/lib/mandoc
-MANDIR = $(PREFIX)/man
-EXAMPLEDIR = $(PREFIX)/share/examples/mandoc
-INSTALL = install
-INSTALL_PROGRAM = $(INSTALL) -m 0755
-INSTALL_DATA = $(INSTALL) -m 0444
-INSTALL_LIB = $(INSTALL) -m 0644
-INSTALL_SOURCE = $(INSTALL) -m 0644
-INSTALL_MAN = $(INSTALL_DATA)
-
-# Linux needs -ldb to compile mandocdb.
-#DBLIB = -ldb
-
-all: mandoc preconv
-
-SRCS = Makefile \
- arch.c \
- arch.in \
- att.c \
- att.in \
+# $Id: Makefile,v 1.454 2015/02/03 21:16:02 schwarze Exp $
+#
+# Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
+# Copyright (c) 2011, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
+#
+# Permission to use, copy, modify, and distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+# === LIST OF FILES ====================================================
+
+TESTSRCS = test-dirent-namlen.c \
+ test-fgetln.c \
+ test-fts.c \
+ test-getsubopt.c \
+ test-mmap.c \
+ test-ohash.c \
+ test-reallocarray.c \
+ test-sqlite3.c \
+ test-sqlite3_errstr.c \
+ test-strcasestr.c \
+ test-strlcat.c \
+ test-strlcpy.c \
+ test-strptime.c \
+ test-strsep.c \
+ test-wchar.c
+
+SRCS = att.c \
+ cgi.c \