INCLUDEDIR = $(PREFIX)/include
LIBDIR = $(PREFIX)/lib
MANDIR = $(PREFIX)/man
+EXAMPLEDIR = $(PREFIX)/share/examples/mandoc
INSTALL_PROGRAM = install -m 0755
INSTALL_DATA = install -m 0444
INSTALL_LIB = install -m 0644
INSTALL_MAN = $(INSTALL_DATA)
-VERSION = 1.9.12
-VDATE = 31 October 2009
+VERSION = 1.9.15-pre2
+VDATE = 02 January 2010
-VFLAGS = -DVERSION="\"$(VERSION)\""
-CFLAGS += -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings -g
-CFLAGS += $(VFLAGS)
+VFLAGS = -DVERSION="\"$(VERSION)\"" -DHAVE_CONFIG_H
+WFLAGS = -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings
+CFLAGS += -g $(VFLAGS) $(WFLAGS)
#CFLAGS += -DOSNAME="\"OpenBSD 4.5\""
LINTFLAGS += $(VFLAGS)
MANS = mandoc.1 mdoc.3 mdoc.7 manuals.7 mandoc_char.7 \
man.7 man.3
BINS = mandoc
+TESTS = test-strlcat.c test-strlcpy.c
+CONFIGS = config.h.pre config.h.post
CLEAN = $(BINS) $(LNS) $(LLNS) $(LIBS) $(OBJS) $(HTMLS) \
$(TARGZS) tags $(MD5S) $(XMLS) $(TEXTS) $(GSGMLS) \
- $(GHTMLS)
+ $(GHTMLS) config.h config.log
INSTALL = $(SRCS) $(HEADS) Makefile $(MANS) $(SGMLS) $(STATICS) \
- $(DATAS) $(XSLS) $(EXAMPLES)
+ $(DATAS) $(XSLS) $(EXAMPLES) $(TESTS) $(CONFIGS)
all: $(BINS)
install:
mkdir -p $(BINDIR)
+ mkdir -p $(EXAMPLEDIR)
mkdir -p $(MANDIR)/man1
mkdir -p $(MANDIR)/man7
$(INSTALL_PROGRAM) mandoc $(BINDIR)
$(INSTALL_MAN) mandoc.1 $(MANDIR)/man1
- $(INSTALL_MAN) mdoc.7 $(MANDIR)/man7
+ $(INSTALL_MAN) man.7 mdoc.7 $(MANDIR)/man7
+ $(INSTALL_DATA) example.style.css $(EXAMPLEDIR)
uninstall:
rm -f $(BINDIR)/mandoc
rm -f $(MANDIR)/man1/mandoc.1
rm -f $(MANDIR)/man7/mdoc.7
+ rm -f $(MANDIR)/man7/man.7
+ rm -f $(EXAMPLEDIR)/example.style.css
+
+$(OBJS): config.h
man_macro.ln: man_macro.c libman.h
man_macro.o: man_macro.c libman.h
.tar.gz.md5:
md5 $< > $@
+
+config.h: config.h.pre config.h.post
+ rm -f config.log
+ ( cat config.h.pre; \
+ echo; \
+ if $(CC) $(CFLAGS) -Werror -c test-strlcat.c >> config.log 2>&1; then \
+ echo '#define HAVE_STRLCAT'; \
+ rm test-strlcat.o; \
+ fi; \
+ if $(CC) $(CFLAGS) -Werror -c test-strlcpy.c >> config.log 2>&1; then \
+ echo '#define HAVE_STRLCPY'; \
+ rm test-strlcpy.o; \
+ fi; \
+ echo; \
+ cat config.h.post \
+ ) > $@