=================================================================== RCS file: /cvs/mandoc/Makefile,v retrieving revision 1.368 retrieving revision 1.375 diff -u -p -r1.368 -r1.375 --- mandoc/Makefile 2011/08/16 22:21:04 1.368 +++ mandoc/Makefile 2011/10/08 12:47:40 1.375 @@ -9,16 +9,20 @@ # 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.6 -VDATE = 16 August 2011 +VERSION = 1.12.0 +VDATE = 8 October 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 @@ -34,12 +38,19 @@ INSTALL_LIB = $(INSTALL) -m 0644 INSTALL_SOURCE = $(INSTALL) -m 0644 INSTALL_MAN = $(INSTALL_DATA) -# Linux needs -ldb to compile mandocdb. +# Non-BSD systems (Linux, etc.) need -ldb to compile mandocdb and +# apropos. +# However, if you don't have -ldb at all (or it's not native), then +# comment out apropos and mandocdb. +# #DBLIB = -ldb +DBBIN = apropos mandocdb -all: mandoc preconv +all: mandoc preconv demandoc $(DBBIN) SRCS = Makefile \ + apropos.1 \ + apropos.c \ arch.c \ arch.in \ att.c \ @@ -51,6 +62,8 @@ SRCS = Makefile \ compat_strlcpy.c \ config.h.post \ config.h.pre \ + demandoc.c \ + demandoc.1 \ eqn.7 \ eqn.c \ eqn_html.c \ @@ -91,6 +104,7 @@ SRCS = Makefile \ mdoc_hash.c \ mdoc_html.c \ mdoc_macro.c \ + mdoc_man.c \ mdoc_term.c \ mdoc_validate.c \ msec.c \ @@ -218,6 +232,9 @@ MANDOC_HTML_LNS = eqn_html.ln \ mdoc_html.ln \ tbl_html.ln +MANDOC_MAN_OBJS = mdoc_man.o +MANDOC_MAN_LNS = mdoc_man.ln + MANDOC_TERM_OBJS = eqn_term.o \ man_term.o \ mdoc_term.o \ @@ -234,11 +251,13 @@ MANDOC_TERM_LNS = eqn_term.ln \ tbl_term.ln MANDOC_OBJS = $(MANDOC_HTML_OBJS) \ + $(MANDOC_MAN_OBJS) \ $(MANDOC_TERM_OBJS) \ main.o \ out.o \ tree.o MANDOC_LNS = $(MANDOC_HTML_LNS) \ + $(MANDOC_MAN_LNS) \ $(MANDOC_TERM_LNS) \ main.ln \ out.ln \ @@ -258,7 +277,27 @@ PRECONV_LNS = preconv.ln $(PRECONV_OBJS) $(PRECONV_LNS): config.h -INDEX_MANS = mandoc.1.html \ +APROPOS_OBJS = apropos.o +APROPOS_LNS = apropos.ln + +$(APROPOS_OBJS) $(APROPOS_LNS): config.h mandoc.h + +DEMANDOC_OBJS = demandoc.o +DEMANDOC_LNS = demandoc.ln + +$(DEMANDOC_OBJS) $(DEMANDOC_LNS): config.h + +INDEX_MANS = apropos.1.html \ + apropos.1.xhtml \ + apropos.1.ps \ + apropos.1.pdf \ + apropos.1.txt \ + demandoc.1.html \ + demandoc.1.xhtml \ + demandoc.1.ps \ + demandoc.1.pdf \ + demandoc.1.txt \ + mandoc.1.html \ mandoc.1.xhtml \ mandoc.1.ps \ mandoc.1.pdf \ @@ -320,7 +359,7 @@ INDEX_OBJS = $(INDEX_MANS) \ www: index.html -lint: llib-llibmandoc.ln llib-lmandoc.ln llib-lpreconv.ln +lint: llib-llibmandoc.ln llib-lmandoc.ln llib-lpreconv.ln llib-ldemandoc.ln clean: rm -f libmandoc.a $(LIBMANDOC_OBJS) @@ -329,6 +368,10 @@ clean: rm -f llib-lmandocdb.ln $(MANDOCDB_LNS) rm -f preconv $(PRECONV_OBJS) rm -f llib-lpreconv.ln $(PRECONV_LNS) + rm -f apropos $(APROPOS_OBJS) + rm -f llib-lapropos.ln $(APROPOS_LNS) + rm -f demandoc $(DEMANDOC_OBJS) + rm -f llib-ldemandoc.ln $(DEMANDOC_LNS) rm -f mandoc $(MANDOC_OBJS) rm -f llib-lmandoc.ln $(MANDOC_LNS) rm -f config.h config.log $(COMPAT_OBJS) $(COMPAT_LNS) @@ -349,10 +392,10 @@ install: all mkdir -p $(DESTDIR)$(MANDIR)/man3 mkdir -p $(DESTDIR)$(MANDIR)/man7 mkdir -p $(DESTDIR)$(MANDIR)/man8 - $(INSTALL_PROGRAM) mandoc preconv $(DESTDIR)$(BINDIR) + $(INSTALL_PROGRAM) mandoc preconv demandoc $(DESTDIR)$(BINDIR) $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR) $(INSTALL_LIB) man.h mdoc.h mandoc.h $(DESTDIR)$(INCLUDEDIR) - $(INSTALL_MAN) mandoc.1 preconv.1 $(DESTDIR)$(MANDIR)/man1 + $(INSTALL_MAN) mandoc.1 preconv.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1 $(INSTALL_MAN) mandoc.3 $(DESTDIR)$(MANDIR)/man3 $(INSTALL_MAN) man.7 mdoc.7 roff.7 eqn.7 tbl.7 mandoc_char.7 $(DESTDIR)$(MANDIR)/man7 $(INSTALL_DATA) example.style.css $(DESTDIR)$(EXAMPLEDIR) @@ -392,6 +435,18 @@ preconv: $(PRECONV_OBJS) llib-lpreconv.ln: $(PRECONV_LNS) $(LINT) $(LINTFLAGS) -Cpreconv $(PRECONV_LNS) +apropos: $(APROPOS_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(APROPOS_OBJS) libmandoc.a $(DBLIB) + +llib-lapropos.ln: $(APROPOS_LNS) + $(LINT) $(LINTFLAGS) -Capropos $(APROPOS_LNS) + +demandoc: $(DEMANDOC_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(DEMANDOC_OBJS) libmandoc.a + +llib-ldemandoc.ln: $(DEMANDOC_LNS) + $(LINT) $(LINTFLAGS) -Cdemandoc $(DEMANDOC_LNS) + mdocml.md5: mdocml.tar.gz md5 mdocml.tar.gz >$@ @@ -405,7 +460,7 @@ mdocml-win32.zip: $(SRCS) mkdir -p .win32/mdocml-$(VERSION)/ $(INSTALL_SOURCE) $(SRCS) .win32 cp .win32/Makefile .win32/Makefile.old - grep -v DUSE_WCHAR .win32/Makefile.old >.win32/Makefile + egrep -v -e DUSE_WCHAR -e ^DBBIN .win32/Makefile.old >.win32/Makefile ( cd .win32; \ CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar CFLAGS='-DOSNAME=\"Windows\"' make; \ make install PREFIX=mdocml-$(VERSION) ; \ @@ -416,7 +471,7 @@ mdocml-win64.zip: $(SRCS) mkdir -p .win64/mdocml-$(VERSION)/ $(INSTALL_SOURCE) $(SRCS) .win64 cp .win64/Makefile .win64/Makefile.old - grep -v DUSE_WCHAR .win64/Makefile.old >.win64/Makefile + egrep -v -e DUSE_WCHAR -e ^DBBIN .win64/Makefile.old >.win64/Makefile ( cd .win64; \ CC=x86_64-w64-mingw32-gcc AR=x86_64-w64-mingw32-ar CFLAGS='-DOSNAME=\"Windows\"' make; \ make install PREFIX=mdocml-$(VERSION) ; \