=================================================================== RCS file: /cvs/mandoc/Makefile,v retrieving revision 1.420 retrieving revision 1.426 diff -u -p -r1.420 -r1.426 --- mandoc/Makefile 2014/06/20 02:55:49 1.420 +++ mandoc/Makefile 2014/08/05 01:07:00 1.426 @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.420 2014/06/20 02:55:49 schwarze Exp $ +# $Id: Makefile,v 1.426 2014/08/05 01:07:00 schwarze Exp $ # # Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons # Copyright (c) 2011, 2013, 2014 Ingo Schwarze @@ -19,6 +19,8 @@ VERSION = 1.13.0 # === USER SETTINGS ==================================================== +# --- user settings relevant for all builds ---------------------------- + # Specify this if you want to hard-code the operating system to appear # in the lower-left hand corner of -mdoc manuals. # @@ -32,28 +34,15 @@ VERSION = 1.13.0 # CFLAGS += -DUSE_WCHAR -# If your system has manpath(1), uncomment this. This is most any -# system that's not OpenBSD or NetBSD. If uncommented, manpage(1) and -# makewhatis(8) will use manpath(1) to get the MANPATH variable. -#CFLAGS += -DUSE_MANPATH - -# If your system does not support static binaries, comment this, -# for example on Mac OS X. -STATIC = -static -# Linux requires -pthread to statically link with libdb. -#STATIC += -pthread - CFLAGS += -I/usr/local/include -g -DHAVE_CONFIG_H CFLAGS += -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings PREFIX = /usr/local -WWWPREFIX = /var/www -HTDOCDIR = $(WWWPREFIX)/htdocs -CGIBINDIR = $(WWWPREFIX)/cgi-bin 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 @@ -61,18 +50,48 @@ INSTALL_LIB = $(INSTALL) -m 0644 INSTALL_SOURCE = $(INSTALL) -m 0644 INSTALL_MAN = $(INSTALL_DATA) +# --- user settings related to database support ------------------------ + # If you want to build without database support, for example to avoid -# the dependency on SQLite3, comment the following two lines. -DBLIB = -L/usr/local/lib -lsqlite3 +# the dependency on SQLite3, comment the following line. +# DBBIN = makewhatis manpage apropos +# If your system has manpath(1), uncomment this. This is most any +# system that's not OpenBSD or NetBSD. If uncommented, apropos(1) +# and makewhatis(8) will use manpath(1) to get the MANPATH variable. +# +#CFLAGS += -DUSE_MANPATH + # OpenBSD has the ohash functions in libutil. # Comment the following line if your system doesn't. +# DBLIB += -lutil +# --- user settings related to man.cgi --------------------------------- + +# To build man.cgi, copy cgi.h.example to cgi.h, edit it, +# and enable the following line. +# +#DBBIN += man.cgi + +# If your system does not support static binaries, comment this, +# for example on Mac OS X. +# +STATIC = -static + +# Linux requires -pthread for statical linking. +# +#STATIC += -pthread + +WWWPREFIX = /var/www +HTDOCDIR = $(WWWPREFIX)/htdocs +CGIBINDIR = $(WWWPREFIX)/cgi-bin + # === END OF USER SETTINGS ============================================= ALLBIN = mandoc preconv demandoc $(DBBIN) +DBLIB += -L/usr/local/lib -lsqlite3 all: $(ALLBIN) @@ -83,7 +102,6 @@ TESTSRCS = test-fgetln.c \ test-reallocarray.c \ test-strlcat.c \ test-strlcpy.c \ - test-strnlen.c \ test-strptime.c SRCS = LICENSE \ @@ -107,7 +125,6 @@ SRCS = LICENSE \ compat_strcasestr.c \ compat_strlcat.c \ compat_strlcpy.c \ - compat_strnlen.c \ compat_strsep.c \ config.h.post \ config.h.pre \ @@ -133,6 +150,7 @@ SRCS = LICENSE \ makewhatis.8 \ man.7 \ man.c \ + man.cgi.8 \ man-cgi.css \ man.h \ man_hash.c \ @@ -235,7 +253,6 @@ COMPAT_OBJS = compat_fgetln.o \ compat_strcasestr.o \ compat_strlcat.o \ compat_strlcpy.o \ - compat_strnlen.o \ compat_strsep.o # === DEPENDENCY HANDLING ============================================== @@ -248,6 +265,7 @@ msec.o: msec.in roff.o: predefs.in st.o: st.in vol.o: vol.in +cgi.o: cgi.h $(LIBMAN_OBJS): libman.h $(LIBMDOC_OBJS): libmdoc.h @@ -291,6 +309,14 @@ $(PRECONV_OBJS): config.h APROPOS_OBJS = apropos.o mansearch.o mansearch_const.o manpath.o $(APROPOS_OBJS): config.h mandoc.h mandoc_aux.h manpath.h mansearch.h +CGI_OBJS = $(MANDOC_HTML_OBJS) \ + cgi.o \ + mansearch.o \ + mansearch_const.o \ + out.o +$(CGI_OBJS): main.h out.h config.h mandoc.h mandoc_aux.h \ + manpath.h mansearch.h + MANPAGE_OBJS = manpage.o mansearch.o mansearch_const.o manpath.o $(MANPAGE_OBJS): config.h mandoc.h mandoc_aux.h manpath.h mansearch.h @@ -312,6 +338,7 @@ WWW_MANS = apropos.1.html \ roff.7.html \ tbl.7.html \ makewhatis.8.html \ + man.cgi.8.html \ man.h.html \ mandoc.h.html \ mandoc_aux.h.html \ @@ -331,6 +358,7 @@ clean: rm -f apropos $(APROPOS_OBJS) rm -f makewhatis $(MAKEWHATIS_OBJS) rm -f preconv $(PRECONV_OBJS) + rm -f man.cgi $(CGI_OBJS) rm -f manpage $(MANPAGE_OBJS) rm -f demandoc $(DEMANDOC_OBJS) rm -f mandoc $(MANDOC_OBJS) @@ -360,9 +388,13 @@ install: all installcgi: all mkdir -p $(DESTDIR)$(CGIBINDIR) mkdir -p $(DESTDIR)$(HTDOCDIR) - #$(INSTALL_PROGRAM) man.cgi $(DESTDIR)$(CGIBINDIR) + mkdir -p $(DESTDIR)$(WWWPREFIX)/man/mandoc/man1 + mkdir -p $(DESTDIR)$(WWWPREFIX)/man/mandoc/man8 + $(INSTALL_PROGRAM) man.cgi $(DESTDIR)$(CGIBINDIR) $(INSTALL_DATA) example.style.css $(DESTDIR)$(HTDOCDIR)/man.css $(INSTALL_DATA) man-cgi.css $(DESTDIR)$(HTDOCDIR) + $(INSTALL_MAN) apropos.1 $(DESTDIR)$(WWWPREFIX)/man/mandoc/man1/ + $(INSTALL_MAN) man.cgi.8 $(DESTDIR)$(WWWPREFIX)/man/mandoc/man8/ installwww: www mkdir -p $(DESTDIR)$(HTDOCDIR)/snapshots @@ -390,6 +422,9 @@ manpage: $(MANPAGE_OBJS) libmandoc.a apropos: $(APROPOS_OBJS) libmandoc.a $(CC) $(LDFLAGS) -o $@ $(APROPOS_OBJS) libmandoc.a $(DBLIB) + +man.cgi: $(CGI_OBJS) libmandoc.a + $(CC) $(LDFLAGS) $(STATIC) -o $@ $(CGI_OBJS) libmandoc.a $(DBLIB) demandoc: $(DEMANDOC_OBJS) libmandoc.a $(CC) $(LDFLAGS) -o $@ $(DEMANDOC_OBJS) libmandoc.a