=================================================================== RCS file: /cvs/mandoc/Makefile,v retrieving revision 1.239 retrieving revision 1.246 diff -u -p -r1.239 -r1.246 --- mandoc/Makefile 2009/10/31 06:23:28 1.239 +++ mandoc/Makefile 2010/01/01 17:14:26 1.246 @@ -4,17 +4,18 @@ BINDIR = $(PREFIX)/bin 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.14 +VDATE = 16 November 2009 -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) @@ -58,11 +59,11 @@ HEADS = mdoc.h libmdoc.h man.h libman.h term.h \ libmandoc.h html.h chars.h out.h main.h GSGMLS = mandoc.1.sgml mdoc.3.sgml mdoc.7.sgml manuals.7.sgml \ mandoc_char.7.sgml man.7.sgml man.3.sgml -SGMLS = index.sgml $(GSGMLS) +SGMLS = index.sgml +HTMLS = ChangeLog.html index.html XSLS = ChangeLog.xsl -HTMLS = index.html mandoc.1.html mdoc.3.html ChangeLog.html \ - man.3.html mdoc.7.html man.7.html mandoc_char.7.html \ - manuals.7.html +GHTMLS = mandoc.1.html mdoc.3.html man.3.html mdoc.7.html \ + man.7.html mandoc_char.7.html manuals.7.html TEXTS = mandoc.1.txt mdoc.3.txt man.3.txt mdoc.7.txt man.7.txt \ mandoc_char.7.txt manuals.7.txt ChangeLog.txt EXAMPLES = example.style.css @@ -73,10 +74,13 @@ TARGZS = mdocml-$(VERSION).tar.gz 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) + $(TARGZS) tags $(MD5S) $(XMLS) $(TEXTS) $(GSGMLS) \ + $(GHTMLS) config.h config.log INSTALL = $(SRCS) $(HEADS) Makefile $(MANS) $(SGMLS) $(STATICS) \ - $(DATAS) $(XSLS) $(EXAMPLES) + $(DATAS) $(XSLS) $(EXAMPLES) $(TESTS) $(CONFIGS) all: $(BINS) @@ -89,14 +93,16 @@ cleanlint: rm -f $(LNS) $(LLNS) cleanhtml: - rm -f $(HTML) $(GSGMLS) + rm -f $(HTMLS) $(GSGMLS) $(GHTMLS) dist: mdocml-$(VERSION).tar.gz -www: all $(HTMLS) $(TEXTS) $(MD5S) $(TARGZS) +www: all $(GSGMLS) $(GHTMLS) $(HTMLS) $(TEXTS) $(MD5S) $(TARGZS) +htmls: all $(GSGMLS) $(GHTMLS) + installwww: www - install -m 0444 $(HTMLS) $(TEXTS) $(STATICS) $(PREFIX)/ + install -m 0444 $(GHTMLS) $(HTMLS) $(TEXTS) $(STATICS) $(PREFIX)/ install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/ install -m 0444 mdocml-$(VERSION).md5 $(PREFIX)/snapshots/ install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/mdocml.tar.gz @@ -104,17 +110,23 @@ installwww: www 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 @@ -246,3 +258,19 @@ mandoc: $(MAINOBJS) libmdoc.a libman.a .tar.gz.md5: md5 $< > $@ + +config.h: config.h.pre config.h.post + rm -f config.log + ( cat config.h.pre; \ + echo; \ + if $(CC) $(CFLAGS) -c test-strlcat.c >> config.log 2>&1; then \ + echo '#define HAVE_STRLCAT'; \ + rm test-strlcat.o; \ + fi; \ + if $(CC) $(CFLAGS) -c test-strlcpy.c >> config.log 2>&1; then \ + echo '#define HAVE_STRLCPY'; \ + rm test-strlcpy.o; \ + fi; \ + echo; \ + cat config.h.post \ + ) > $@