=================================================================== RCS file: /cvs/mandoc/Makefile,v retrieving revision 1.440 retrieving revision 1.451 diff -u -p -r1.440 -r1.451 --- mandoc/Makefile 2014/08/16 19:00:01 1.440 +++ mandoc/Makefile 2014/12/09 06:31:03 1.451 @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.440 2014/08/16 19:00:01 schwarze Exp $ +# $Id: Makefile,v 1.451 2014/12/09 06:31:03 schwarze Exp $ # # Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons # Copyright (c) 2011, 2013, 2014 Ingo Schwarze @@ -15,9 +15,7 @@ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -BASEBIN = mandoc preconv demandoc -DBBIN = apropos makewhatis -CGIBIN = man.cgi +# === LIST OF FILES ==================================================== TESTSRCS = test-dirent-namlen.c \ test-fgetln.c \ @@ -35,9 +33,7 @@ TESTSRCS = test-dirent-namlen.c \ test-strsep.c \ test-wchar.c -SRCS = apropos.c \ - arch.c \ - att.c \ +SRCS = att.c \ cgi.c \ chars.c \ compat_fgetln.c \ @@ -94,7 +90,6 @@ SRCS = apropos.c \ term_ascii.c \ term_ps.c \ tree.c \ - vol.c \ $(TESTSRCS) DISTFILES = INSTALL \ @@ -104,8 +99,6 @@ DISTFILES = INSTALL \ NEWS \ TODO \ apropos.1 \ - arch.in \ - att.in \ cgi.h.example \ chars.in \ compat_fts.h \ @@ -125,6 +118,7 @@ DISTFILES = INSTALL \ main.h \ makewhatis.8 \ man-cgi.css \ + man.1 \ man.7 \ man.cgi.8 \ man.h \ @@ -135,6 +129,7 @@ DISTFILES = INSTALL \ mandoc_aux.h \ mandoc_char.7 \ mandoc_escape.3 \ + mandoc_headers.3 \ mandoc_html.3 \ mandoc_malloc.3 \ manpath.h \ @@ -145,7 +140,6 @@ DISTFILES = INSTALL \ mdoc.h \ msec.in \ out.h \ - preconv.1 \ predefs.in \ roff.7 \ st.in \ @@ -153,7 +147,6 @@ DISTFILES = INSTALL \ tbl.3 \ tbl.7 \ term.h \ - vol.in \ $(SRCS) LIBMAN_OBJS = man.o \ @@ -161,16 +154,14 @@ LIBMAN_OBJS = man.o \ man_macro.o \ man_validate.o -LIBMDOC_OBJS = arch.o \ - att.o \ +LIBMDOC_OBJS = att.o \ lib.o \ mdoc.o \ mdoc_argv.o \ mdoc_hash.o \ mdoc_macro.o \ mdoc_validate.o \ - st.o \ - vol.o + st.o LIBROFF_OBJS = eqn.o \ roff.o \ @@ -186,6 +177,7 @@ LIBMANDOC_OBJS = $(LIBMAN_OBJS) \ mandoc.o \ mandoc_aux.o \ msec.o \ + preconv.o \ read.o COMPAT_OBJS = compat_fgetln.o \ @@ -222,12 +214,12 @@ MANDOC_OBJS = $(MANDOC_HTML_OBJS) \ out.o \ tree.o +MAN_OBJS = $(MANDOC_OBJS) + MAKEWHATIS_OBJS = mandocdb.o mansearch_const.o manpath.o -PRECONV_OBJS = preconv.o +APROPOS_OBJS = mansearch.o mansearch_const.o manpath.o -APROPOS_OBJS = apropos.o mansearch.o mansearch_const.o manpath.o - CGI_OBJS = $(MANDOC_HTML_OBJS) \ cgi.o \ mansearch.o \ @@ -240,10 +232,11 @@ DEMANDOC_OBJS = demandoc.o WWW_MANS = apropos.1.html \ demandoc.1.html \ + man.1.html \ mandoc.1.html \ - preconv.1.html \ mandoc.3.html \ mandoc_escape.3.html \ + mandoc_headers.3.html \ mandoc_html.3.html \ mandoc_malloc.3.html \ mansearch.3.html \ @@ -268,6 +261,8 @@ WWW_MANS = apropos.1.html \ WWW_OBJS = mdocml.tar.gz \ mdocml.sha256 +# === USER CONFIGURATION =============================================== + include Makefile.local INSTALL_TARGETS = $(BUILD_TARGETS:-build=-install) @@ -276,16 +271,21 @@ INSTALL_TARGETS = $(BUILD_TARGETS:-build=-install) all: base-build $(BUILD_TARGETS) Makefile.local -base-build: $(BASEBIN) +base-build: mandoc demandoc -db-build: $(DBBIN) +db-build: makewhatis -cgi-build: $(CGIBIN) +cgi-build: man.cgi install: base-install $(INSTALL_TARGETS) www: $(WWW_OBJS) $(WWW_MANS) +$(WWW_MANS): mandoc + +.PHONY: base-install cgi-install db-install install www-install +.PHONY: clean distclean depend + include Makefile.depend # === TARGETS CONTAINING SHELL COMMANDS ================================ @@ -295,13 +295,11 @@ distclean: clean clean: rm -f libmandoc.a $(LIBMANDOC_OBJS) $(COMPAT_OBJS) - rm -f apropos $(APROPOS_OBJS) + rm -f mandoc $(MANDOC_OBJS) $(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) rm -f $(WWW_MANS) $(WWW_OBJS) rm -rf *.dSYM @@ -313,11 +311,11 @@ base-install: base-build mkdir -p $(DESTDIR)$(MANDIR)/man1 mkdir -p $(DESTDIR)$(MANDIR)/man3 mkdir -p $(DESTDIR)$(MANDIR)/man7 - $(INSTALL_PROGRAM) $(BASEBIN) $(DESTDIR)$(BINDIR) + $(INSTALL_PROGRAM) mandoc demandoc $(DESTDIR)$(BINDIR) $(INSTALL_LIB) libmandoc.a $(DESTDIR)$(LIBDIR) $(INSTALL_LIB) man.h mandoc.h mandoc_aux.h mdoc.h \ $(DESTDIR)$(INCLUDEDIR) - $(INSTALL_MAN) mandoc.1 preconv.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1 + $(INSTALL_MAN) mandoc.1 demandoc.1 $(DESTDIR)$(MANDIR)/man1 $(INSTALL_MAN) mandoc.3 mandoc_escape.3 mandoc_malloc.3 \ mchars_alloc.3 tbl.3 $(DESTDIR)$(MANDIR)/man3 $(INSTALL_MAN) man.7 mdoc.7 roff.7 eqn.7 tbl.7 mandoc_char.7 \ @@ -331,10 +329,11 @@ db-install: db-build mkdir -p $(DESTDIR)$(MANDIR)/man3 mkdir -p $(DESTDIR)$(MANDIR)/man5 mkdir -p $(DESTDIR)$(MANDIR)/man8 - $(INSTALL_PROGRAM) apropos $(DESTDIR)$(BINDIR) - ln -f $(DESTDIR)$(BINDIR)/apropos $(DESTDIR)$(BINDIR)/whatis + ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/apropos + ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/man + ln -f $(DESTDIR)$(BINDIR)/mandoc $(DESTDIR)$(BINDIR)/whatis $(INSTALL_PROGRAM) makewhatis $(DESTDIR)$(SBINDIR) - $(INSTALL_MAN) apropos.1 $(DESTDIR)$(MANDIR)/man1 + $(INSTALL_MAN) apropos.1 man.1 $(DESTDIR)$(MANDIR)/man1 ln -f $(DESTDIR)$(MANDIR)/man1/apropos.1 \ $(DESTDIR)$(MANDIR)/man1/whatis.1 $(INSTALL_MAN) mansearch.3 $(DESTDIR)$(MANDIR)/man3 @@ -352,49 +351,46 @@ cgi-install: cgi-build $(INSTALL_MAN) apropos.1 $(DESTDIR)$(WWWPREFIX)/man/mandoc/man1/ $(INSTALL_MAN) man.cgi.8 $(DESTDIR)$(WWWPREFIX)/man/mandoc/man8/ -www-install: www - mkdir -p $(DESTDIR)$(HTDOCDIR)/snapshots - $(INSTALL_DATA) $(WWW_MANS) style.css $(DESTDIR)$(HTDOCDIR) - $(INSTALL_DATA) $(WWW_OBJS) $(DESTDIR)$(HTDOCDIR)/snapshots - $(INSTALL_DATA) mdocml.tar.gz \ - $(DESTDIR)$(HTDOCDIR)/snapshots/mdocml-$(VERSION).tar.gz - $(INSTALL_DATA) mdocml.sha256 \ - $(DESTDIR)$(HTDOCDIR)/snapshots/mdocml-$(VERSION).sha256 - Makefile.local config.h: configure ${TESTSRCS} @echo "$@ is out of date; please run ./configure" @exit 1 -depend: config.h - mkdep -f Makefile.depend $(CFLAGS) $(SRCS) - perl -e 'undef $$/; $$_ = <>; s|/usr/include/\S+||g; \ - s|\\\n||g; s| +| |g; print;' Makefile.depend > Makefile.tmp - mv Makefile.tmp Makefile.depend - libmandoc.a: $(COMPAT_OBJS) $(LIBMANDOC_OBJS) $(AR) rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS) -mandoc: $(MANDOC_OBJS) libmandoc.a - $(CC) $(LDFLAGS) -o $@ $(MANDOC_OBJS) libmandoc.a +mandoc: $(MAN_OBJS) libmandoc.a + $(CC) $(LDFLAGS) -o $@ $(MAN_OBJS) libmandoc.a $(DBLIB) makewhatis: $(MAKEWHATIS_OBJS) libmandoc.a $(CC) $(LDFLAGS) -o $@ $(MAKEWHATIS_OBJS) libmandoc.a $(DBLIB) -preconv: $(PRECONV_OBJS) - $(CC) $(LDFLAGS) -o $@ $(PRECONV_OBJS) - manpage: $(MANPAGE_OBJS) libmandoc.a $(CC) $(LDFLAGS) -o $@ $(MANPAGE_OBJS) libmandoc.a $(DBLIB) -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 +# --- maintainer targets --- + +www-install: www + mkdir -p $(HTDOCDIR)/snapshots + $(INSTALL_DATA) $(WWW_MANS) style.css $(HTDOCDIR) + $(INSTALL_DATA) $(WWW_OBJS) $(HTDOCDIR)/snapshots + $(INSTALL_DATA) mdocml.tar.gz \ + $(HTDOCDIR)/snapshots/mdocml-$(VERSION).tar.gz + $(INSTALL_DATA) mdocml.sha256 \ + $(HTDOCDIR)/snapshots/mdocml-$(VERSION).sha256 + +depend: config.h + mkdep -f Makefile.depend $(CFLAGS) $(SRCS) + perl -e 'undef $$/; $$_ = <>; s|/usr/include/\S+||g; \ + s|\\\n||g; s| +| |g; s| $$||mg; print;' \ + Makefile.depend > Makefile.tmp + mv Makefile.tmp Makefile.depend + mdocml.sha256: mdocml.tar.gz sha256 mdocml.tar.gz > $@ @@ -405,8 +401,8 @@ mdocml.tar.gz: $(DISTFILES) ( cd .dist/ && tar zcf ../$@ mdocml-$(VERSION) ) rm -rf .dist/ -.PHONY: base-install cgi-install db-install install www-install -.PHONY: clean distclean depend +# === SUFFIX RULES ===================================================== + .SUFFIXES: .1 .3 .5 .7 .8 .h .SUFFIXES: .1.html .3.html .5.html .7.html .8.html .h.html