=================================================================== RCS file: /cvs/mandoc/Makefile,v retrieving revision 1.371 retrieving revision 1.384 diff -u -p -r1.371 -r1.384 --- mandoc/Makefile 2011/09/17 15:00:51 1.371 +++ mandoc/Makefile 2011/11/28 10:10:08 1.384 @@ -9,16 +9,29 @@ # 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.7 -VDATE = 2 September 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 + +# If your system has manpath(1), uncomment this. This is most any +# system that's not OpenBSD or NetBSD. If uncommented, apropos(1), +# mandocdb(8), and man.cgi will popen(3) manpath(1) to get the MANPATH +# variable. +#CFLAGS += -DUSE_MANPATH + +# If your system supports static binaries only, uncomment this. +#STATIC = -static + CFLAGS += -g -DHAVE_CONFIG_H -DVERSION="\"$(VERSION)\"" CFLAGS += -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings PREFIX = /usr/local @@ -34,12 +47,20 @@ 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 man.cgi catman whatis +DBLN = llib-lapropos.ln llib-lmandocdb.ln llib-lman.cgi.ln llib-lcatman.ln -all: mandoc preconv demandoc +all: mandoc preconv demandoc $(DBBIN) SRCS = Makefile \ + apropos.1 \ + apropos.c \ arch.c \ arch.in \ att.c \ @@ -74,6 +95,7 @@ SRCS = Makefile \ man.h \ man.7 \ man.c \ + man.cgi.7 \ man_hash.c \ man_html.c \ man_macro.c \ @@ -85,7 +107,12 @@ SRCS = Makefile \ mandoc.h \ mandocdb.8 \ mandocdb.c \ + mandocdb.h \ mandoc_char.7 \ + manpath.c \ + manpath.h \ + catman.c \ + catman.8 \ mdoc.h \ mdoc.7 \ mdoc.c \ @@ -256,22 +283,57 @@ $(MANDOC_HTML_OBJS) $(MANDOC_HTML_LNS): html.h $(MANDOC_TERM_OBJS) $(MANDOC_TERM_LNS): term.h $(MANDOC_OBJS) $(MANDOC_LNS): main.h mandoc.h mdoc.h man.h config.h out.h -MANDOCDB_OBJS = mandocdb.o -MANDOCDB_LNS = mandocdb.ln +MANDOCDB_OBJS = mandocdb.o manpath.o +MANDOCDB_LNS = mandocdb.ln manpath.ln -$(MANDOCDB_OBJS) $(MANDOCDB_LNS): mandoc.h mdoc.h man.h config.h +$(MANDOCDB_OBJS) $(MANDOCDB_LNS): mandocdb.h mandoc.h mdoc.h man.h config.h manpath.h PRECONV_OBJS = preconv.o PRECONV_LNS = preconv.ln $(PRECONV_OBJS) $(PRECONV_LNS): config.h +APROPOS_OBJS = apropos.o apropos_db.o manpath.o +APROPOS_LNS = apropos.ln apropos_db.ln manpath.ln + +$(APROPOS_OBJS) $(APROPOS_LNS): config.h mandoc.h apropos_db.h manpath.h mandocdb.h + +CGI_OBJS = $(MANDOC_HTML_OBJS) \ + $(MANDOC_MAN_OBJS) \ + $(MANDOC_TERM_OBJS) \ + cgi.o \ + apropos_db.o \ + manpath.o \ + out.o \ + tree.o + +CGI_LNS = $(MANDOC_HTML_LNS) \ + $(MANDOC_MAN_LNS) \ + $(MANDOC_TERM_LNS) \ + cgi.ln \ + apropos_db.ln \ + manpath.ln \ + out.ln \ + tree.ln + +$(CGI_OBJS) $(CGI_LNS): main.h mdoc.h man.h out.h config.h mandoc.h apropos_db.h manpath.h mandocdb.h + +CATMAN_OBJS = catman.o manpath.o +CATMAN_LNS = catman.ln manpath.ln + +$(CATMAN_OBJS) $(CATMAN_LNS): config.h mandoc.h manpath.h + DEMANDOC_OBJS = demandoc.o DEMANDOC_LNS = demandoc.ln $(DEMANDOC_OBJS) $(DEMANDOC_LNS): config.h -INDEX_MANS = demandoc.1.html \ +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 \ @@ -338,7 +400,7 @@ INDEX_OBJS = $(INDEX_MANS) \ www: index.html -lint: llib-llibmandoc.ln llib-lmandoc.ln llib-lpreconv.ln llib-ldemandoc.ln +lint: llib-lmandoc.ln llib-lpreconv.ln llib-ldemandoc.ln $(DBLN) clean: rm -f libmandoc.a $(LIBMANDOC_OBJS) @@ -347,6 +409,12 @@ 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 man.cgi $(CGI_OBJS) + rm -f llib-lman.cgi.ln $(CGI_LNS) + rm -f catman $(CATMAN_OBJS) + rm -f llib-lcatman.ln $(CATMAN_LNS) rm -f demandoc $(DEMANDOC_OBJS) rm -f llib-ldemandoc.ln $(DEMANDOC_LNS) rm -f mandoc $(MANDOC_OBJS) @@ -397,26 +465,47 @@ llib-llibmandoc.ln: $(COMPAT_LNS) $(LIBMANDOC_LNS) mandoc: $(MANDOC_OBJS) libmandoc.a $(CC) $(LDFLAGS) -o $@ $(MANDOC_OBJS) libmandoc.a -llib-lmandoc.ln: $(MANDOC_LNS) - $(LINT) $(LINTFLAGS) -Cmandoc $(MANDOC_LNS) +llib-lmandoc.ln: $(MANDOC_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cmandoc $(MANDOC_LNS) llib-llibmandoc.ln mandocdb: $(MANDOCDB_OBJS) libmandoc.a $(CC) $(LDFLAGS) -o $@ $(MANDOCDB_OBJS) libmandoc.a $(DBLIB) -llib-lmandocdb.ln: $(MANDOCDB_LNS) - $(LINT) $(LINTFLAGS) -Cmandocdb $(MANDOCDB_LNS) +llib-lmandocdb.ln: $(MANDOCDB_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cmandocdb $(MANDOCDB_LNS) llib-llibmandoc.ln preconv: $(PRECONV_OBJS) $(CC) $(LDFLAGS) -o $@ $(PRECONV_OBJS) -llib-lpreconv.ln: $(PRECONV_LNS) - $(LINT) $(LINTFLAGS) -Cpreconv $(PRECONV_LNS) +llib-lpreconv.ln: $(PRECONV_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cpreconv $(PRECONV_LNS) llib-llibmandoc.ln +whatis: apropos + cp -f apropos whatis + +apropos: $(APROPOS_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(APROPOS_OBJS) libmandoc.a $(DBLIB) + +llib-lapropos.ln: $(APROPOS_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Capropos $(APROPOS_LNS) llib-llibmandoc.ln + +catman: $(CATMAN_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(CATMAN_OBJS) libmandoc.a $(DBLIB) + +llib-lcatman.ln: $(CATMAN_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Ccatman $(CATMAN_LNS) llib-llibmandoc.ln + +man.cgi: $(CGI_OBJS) libmandoc.a + $(CC) $(LDFLAGS) $(STATIC) -o $@ $(CGI_OBJS) libmandoc.a $(DBLIB) + +llib-lman.cgi.ln: $(CGI_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cman.cgi $(CGI_LNS) llib-llibmandoc.ln + demandoc: $(DEMANDOC_OBJS) libmandoc.a $(CC) $(LDFLAGS) -o $@ $(DEMANDOC_OBJS) libmandoc.a -llib-ldemandoc.ln: $(DEMANDOC_LNS) - $(LINT) $(LINTFLAGS) -Cdemandoc $(DEMANDOC_LNS) +llib-ldemandoc.ln: $(DEMANDOC_LNS) llib-llibmandoc.ln + $(LINT) $(LINTFLAGS) -Cdemandoc $(DEMANDOC_LNS) llib-llibmandoc.ln mdocml.md5: mdocml.tar.gz md5 mdocml.tar.gz >$@ @@ -431,7 +520,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) ; \ @@ -442,7 +531,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) ; \