[BACK]Return to Makefile CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Annotation of mandoc/Makefile, Revision 1.268

1.260     kristaps    1: .SUFFIXES:     .html .xml .sgml .1 .3 .7 .md5 .tar.gz .1.txt .3.txt .7.txt .1.sgml .3.sgml .7.sgml .h .h.html
1.79      kristaps    2:
1.99      kristaps    3: BINDIR         = $(PREFIX)/bin
                      4: INCLUDEDIR     = $(PREFIX)/include
                      5: LIBDIR         = $(PREFIX)/lib
                      6: MANDIR         = $(PREFIX)/man
1.243     kristaps    7: EXAMPLEDIR     = $(PREFIX)/share/examples/mandoc
1.266     kristaps    8: INSTALL                = install
1.263     kristaps    9: INSTALL_PROGRAM        = $(INSTALL) -m 0755
                     10: INSTALL_DATA   = $(INSTALL) -m 0444
                     11: INSTALL_LIB    = $(INSTALL) -m 0644
1.99      kristaps   12: INSTALL_MAN    = $(INSTALL_DATA)
                     13:
1.267     kristaps   14: VERSION           = 1.9.25
                     15: VDATE     = 13 May 2010
1.7       kristaps   16:
1.259     kristaps   17: VFLAGS    = -DVERSION="\"$(VERSION)\""
1.246     kristaps   18: WFLAGS     = -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings
1.259     kristaps   19: CFLAGS    += -g $(WFLAGS) $(VFLAGS) -DHAVE_CONFIG_H
                     20:
                     21: # Specify this if you want to hard-code the operating system to appear
                     22: # in the lower-left hand corner of -mdoc manuals.
                     23: # CFLAGS += -DOSNAME="\"OpenBSD 4.5\""
                     24:
1.264     kristaps   25: # Unset this if you don't want Xo/Xc allowing split `It' lines, which
                     26: # breaks symmetry.
                     27: CFLAGS   += -DUGLY
1.259     kristaps   28:
1.182     kristaps   29: LINTFLAGS += $(VFLAGS)
1.132     kristaps   30:
1.231     kristaps   31: MANDOCFLAGS = -Wall -fstrict
1.234     kristaps   32: MANDOCHTML = -Thtml -Ostyle=style.css,man=%N.%S.html,includes=%I.html
1.222     kristaps   33:
1.268   ! kristaps   34: MANDOCLNS  = mandoc.ln
        !            35:
        !            36: MANDOCSRCS = mandoc.c
        !            37:
        !            38: MANDOCOBJS = mandoc.o
        !            39:
1.165     kristaps   40: MDOCLNS           = mdoc_macro.ln mdoc.ln mdoc_hash.ln mdoc_strings.ln \
                     41:             mdoc_argv.ln mdoc_validate.ln mdoc_action.ln \
1.268   ! kristaps   42:             lib.ln att.ln arch.ln vol.ln msec.ln st.ln
        !            43:
1.165     kristaps   44: MDOCOBJS   = mdoc_macro.o mdoc.o mdoc_hash.o mdoc_strings.o \
1.163     kristaps   45:             mdoc_argv.o mdoc_validate.o mdoc_action.o lib.o att.o \
1.268   ! kristaps   46:             arch.o vol.o msec.o st.o
        !            47:
1.165     kristaps   48: MDOCSRCS   = mdoc_macro.c mdoc.c mdoc_hash.c mdoc_strings.c \
1.163     kristaps   49:             mdoc_argv.c mdoc_validate.c mdoc_action.c lib.c att.c \
1.268   ! kristaps   50:             arch.c vol.c msec.c st.c
1.148     kristaps   51:
1.156     kristaps   52: MANLNS    = man_macro.ln man.ln man_hash.ln man_validate.ln \
1.268   ! kristaps   53:             man_action.ln man_argv.ln
        !            54:
1.156     kristaps   55: MANOBJS           = man_macro.o man.o man_hash.o man_validate.o \
1.268   ! kristaps   56:             man_action.o man_argv.o
1.156     kristaps   57: MANSRCS           = man_macro.c man.c man_hash.c man_validate.c \
1.203     kristaps   58:             man_action.c mandoc.c man_argv.c
1.132     kristaps   59:
1.210     kristaps   60: MAINLNS           = main.ln mdoc_term.ln chars.ln term.ln tree.ln \
1.214     kristaps   61:             compat.ln man_term.ln html.ln mdoc_html.ln \
1.223     kristaps   62:             man_html.ln out.ln
1.268   ! kristaps   63:
1.210     kristaps   64: MAINOBJS   = main.o mdoc_term.o chars.o term.o tree.o compat.o \
1.223     kristaps   65:             man_term.o html.o mdoc_html.o man_html.o out.o
1.268   ! kristaps   66:
1.210     kristaps   67: MAINSRCS   = main.c mdoc_term.c chars.c term.c tree.c compat.c \
1.223     kristaps   68:             man_term.c html.c mdoc_html.c man_html.c out.c
1.132     kristaps   69:
1.268   ! kristaps   70: LLNS      = llib-llibmdoc.ln llib-llibman.ln llib-lmandoc.ln \
        !            71:             llib-llibmandoc.ln
        !            72:
        !            73: LNS       = $(MAINLNS) $(MDOCLNS) $(MANLNS) $(MANDOCLNS)
        !            74:
        !            75: LIBS      = libmdoc.a libman.a libmandoc.a
        !            76:
        !            77: OBJS      = $(MDOCOBJS) $(MAINOBJS) $(MANOBJS) $(MANDOCOBJS)
        !            78:
        !            79: SRCS      = $(MDOCSRCS) $(MAINSRCS) $(MANSRCS) $(MANDOCSRCS)
        !            80:
1.217     kristaps   81: DATAS     = arch.in att.in lib.in msec.in st.in \
                     82:             vol.in chars.in
1.268   ! kristaps   83:
1.217     kristaps   84: HEADS     = mdoc.h libmdoc.h man.h libman.h term.h \
1.227     kristaps   85:             libmandoc.h html.h chars.h out.h main.h
1.268   ! kristaps   86:
1.219     kristaps   87: GSGMLS    = mandoc.1.sgml mdoc.3.sgml mdoc.7.sgml manuals.7.sgml \
                     88:             mandoc_char.7.sgml man.7.sgml man.3.sgml
1.268   ! kristaps   89:
1.240     kristaps   90: SGMLS     = index.sgml
1.268   ! kristaps   91:
1.260     kristaps   92: HTMLS     = ChangeLog.html index.html man.h.html mdoc.h.html
1.268   ! kristaps   93:
1.193     kristaps   94: XSLS      = ChangeLog.xsl
1.268   ! kristaps   95:
1.241     kristaps   96: GHTMLS    = mandoc.1.html mdoc.3.html man.3.html mdoc.7.html \
                     97:             man.7.html mandoc_char.7.html manuals.7.html
1.268   ! kristaps   98:
1.218     kristaps   99: TEXTS     = mandoc.1.txt mdoc.3.txt man.3.txt mdoc.7.txt man.7.txt \
1.221     kristaps  100:             mandoc_char.7.txt manuals.7.txt ChangeLog.txt
1.268   ! kristaps  101:
1.216     kristaps  102: EXAMPLES   = example.style.css
1.268   ! kristaps  103:
1.193     kristaps  104: XMLS      = ChangeLog.xml
1.268   ! kristaps  105:
1.213     kristaps  106: STATICS           = index.css style.css external.png
1.268   ! kristaps  107:
1.195     kristaps  108: MD5S      = mdocml-$(VERSION).md5
1.268   ! kristaps  109:
1.195     kristaps  110: TARGZS    = mdocml-$(VERSION).tar.gz
1.268   ! kristaps  111:
1.168     kristaps  112: MANS      = mandoc.1 mdoc.3 mdoc.7 manuals.7 mandoc_char.7 \
                    113:             man.7 man.3
1.268   ! kristaps  114:
1.132     kristaps  115: BINS      = mandoc
1.268   ! kristaps  116:
1.246     kristaps  117: TESTS     = test-strlcat.c test-strlcpy.c
1.268   ! kristaps  118:
1.246     kristaps  119: CONFIGS           = config.h.pre config.h.post
1.268   ! kristaps  120:
1.263     kristaps  121: DOCLEAN           = $(BINS) $(LNS) $(LLNS) $(LIBS) $(OBJS) $(HTMLS) \
1.241     kristaps  122:             $(TARGZS) tags $(MD5S) $(XMLS) $(TEXTS) $(GSGMLS) \
1.246     kristaps  123:             $(GHTMLS) config.h config.log
1.268   ! kristaps  124:
1.263     kristaps  125: DOINSTALL  = $(SRCS) $(HEADS) Makefile $(MANS) $(SGMLS) $(STATICS) \
1.246     kristaps  126:             $(DATAS) $(XSLS) $(EXAMPLES) $(TESTS) $(CONFIGS)
1.81      kristaps  127:
1.50      kristaps  128: all:   $(BINS)
1.32      kristaps  129:
1.50      kristaps  130: lint:  $(LLNS)
1.42      kristaps  131:
1.1       kristaps  132: clean:
1.263     kristaps  133:        rm -f $(DOCLEAN)
1.1       kristaps  134:
1.89      kristaps  135: cleanlint:
                    136:        rm -f $(LNS) $(LLNS)
                    137:
1.237     kristaps  138: cleanhtml:
1.241     kristaps  139:        rm -f $(HTMLS) $(GSGMLS) $(GHTMLS)
1.237     kristaps  140:
1.60      kristaps  141: dist:  mdocml-$(VERSION).tar.gz
1.59      kristaps  142:
1.241     kristaps  143: www:   all $(GSGMLS) $(GHTMLS) $(HTMLS) $(TEXTS) $(MD5S) $(TARGZS)
                    144:
                    145: htmls: all $(GSGMLS) $(GHTMLS)
1.79      kristaps  146:
1.80      kristaps  147: installwww: www
1.263     kristaps  148:        $(INSTALL_DATA) $(GHTMLS) $(HTMLS) $(TEXTS) $(STATICS) $(PREFIX)/
                    149:        $(INSTALL_DATA) mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/
                    150:        $(INSTALL_DATA) mdocml-$(VERSION).md5 $(PREFIX)/snapshots/
                    151:        $(INSTALL_DATA) mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/mdocml.tar.gz
                    152:        $(INSTALL_DATA) mdocml-$(VERSION).md5 $(PREFIX)/snapshots/mdocml.md5
1.80      kristaps  153:
1.60      kristaps  154: install:
1.101     kristaps  155:        mkdir -p $(BINDIR)
1.245     kristaps  156:        mkdir -p $(EXAMPLEDIR)
1.101     kristaps  157:        mkdir -p $(MANDIR)/man1
1.131     kristaps  158:        mkdir -p $(MANDIR)/man7
1.132     kristaps  159:        $(INSTALL_PROGRAM) mandoc $(BINDIR)
                    160:        $(INSTALL_MAN) mandoc.1 $(MANDIR)/man1
1.261     kristaps  161:        $(INSTALL_MAN) man.7 mdoc.7 mandoc_char.7 $(MANDIR)/man7
1.243     kristaps  162:        $(INSTALL_DATA) example.style.css $(EXAMPLEDIR)
1.60      kristaps  163:
                    164: uninstall:
1.132     kristaps  165:        rm -f $(BINDIR)/mandoc
                    166:        rm -f $(MANDIR)/man1/mandoc.1
1.131     kristaps  167:        rm -f $(MANDIR)/man7/mdoc.7
1.245     kristaps  168:        rm -f $(MANDIR)/man7/man.7
1.261     kristaps  169:        rm -f $(MANDIR)/man7/mandoc_char.7
1.245     kristaps  170:        rm -f $(EXAMPLEDIR)/example.style.css
1.20      kristaps  171:
1.246     kristaps  172: $(OBJS): config.h
                    173:
1.249     kristaps  174: $(LNS): config.h
                    175:
1.251     kristaps  176: man_macro.ln man_macro.o: man_macro.c libman.h
1.108     kristaps  177:
1.251     kristaps  178: lib.ln lib.o: lib.c lib.in libmdoc.h
1.108     kristaps  179:
1.251     kristaps  180: att.ln att.o: att.c att.in libmdoc.h
1.108     kristaps  181:
1.251     kristaps  182: arch.ln arch.o: arch.c arch.in libmdoc.h
1.148     kristaps  183:
1.251     kristaps  184: vol.ln vol.o: vol.c vol.in libmdoc.h
1.108     kristaps  185:
1.251     kristaps  186: chars.ln chars.o: chars.c chars.in chars.h
1.108     kristaps  187:
1.251     kristaps  188: msec.ln msec.o: msec.c msec.in libmdoc.h
1.108     kristaps  189:
1.251     kristaps  190: st.ln st.o: st.c st.in libmdoc.h
1.108     kristaps  191:
1.251     kristaps  192: mdoc_macro.ln mdoc_macro.o: mdoc_macro.c libmdoc.h
1.21      kristaps  193:
1.251     kristaps  194: mdoc_term.ln mdoc_term.o: mdoc_term.c term.h mdoc.h
1.74      kristaps  195:
1.251     kristaps  196: mdoc_strings.ln mdoc_strings.o: mdoc_strings.c libmdoc.h
1.148     kristaps  197:
1.251     kristaps  198: man_hash.ln man_hash.o: man_hash.c libman.h
1.148     kristaps  199:
1.251     kristaps  200: mdoc_hash.ln mdoc_hash.o: mdoc_hash.c libmdoc.h
1.52      kristaps  201:
1.251     kristaps  202: mdoc.ln mdoc.o: mdoc.c libmdoc.h
1.21      kristaps  203:
1.251     kristaps  204: man.ln man.o: man.c libman.h
1.47      kristaps  205:
1.251     kristaps  206: main.ln main.o: main.c mdoc.h
1.132     kristaps  207:
1.251     kristaps  208: compat.ln compat.o: compat.c
1.173     kristaps  209:
1.251     kristaps  210: term.ln term.o: term.c term.h man.h mdoc.h chars.h
1.53      kristaps  211:
1.251     kristaps  212: html.ln html.o: html.c html.h chars.h
1.214     kristaps  213:
1.251     kristaps  214: mdoc_html.ln mdoc_html.o: mdoc_html.c html.h mdoc.h
1.214     kristaps  215:
1.251     kristaps  216: man_html.ln man_html.o: man_html.c html.h man.h out.h
1.223     kristaps  217:
1.251     kristaps  218: out.ln out.o: out.c out.h
1.209     kristaps  219:
1.268   ! kristaps  220: mandoc.ln mandoc.o: mandoc.c libmandoc.h
        !           221:
1.251     kristaps  222: tree.ln tree.o: tree.c man.h mdoc.h
1.207     kristaps  223:
1.251     kristaps  224: mdoc_argv.ln mdoc_argv.o: mdoc_argv.c libmdoc.h
1.53      kristaps  225:
1.251     kristaps  226: man_argv.ln man_argv.o: man_argv.c libman.h
1.203     kristaps  227:
1.251     kristaps  228: man_validate.ln man_validate.o: man_validate.c libman.h
1.155     kristaps  229:
1.251     kristaps  230: mdoc_validate.ln mdoc_validate.o: mdoc_validate.c libmdoc.h
1.54      kristaps  231:
1.251     kristaps  232: mdoc_action.ln mdoc_action.o: mdoc_action.c libmdoc.h
1.56      kristaps  233:
1.148     kristaps  234: libmdoc.h: mdoc.h
1.39      kristaps  235:
1.193     kristaps  236: ChangeLog.xml:
1.196     kristaps  237:        cvs2cl --xml --xml-encoding iso-8859-15 -t --noxmlns -f $@
1.193     kristaps  238:
1.221     kristaps  239: ChangeLog.txt:
                    240:        cvs2cl -t -f $@
                    241:
1.194     kristaps  242: ChangeLog.html: ChangeLog.xml ChangeLog.xsl
1.193     kristaps  243:        xsltproc -o $@ ChangeLog.xsl ChangeLog.xml
1.175     kristaps  244:
1.263     kristaps  245: mdocml-$(VERSION).tar.gz: $(DOINSTALL)
1.60      kristaps  246:        mkdir -p .dist/mdocml/mdocml-$(VERSION)/
1.263     kristaps  247:        cp -f $(DOINSTALL) .dist/mdocml/mdocml-$(VERSION)/
1.60      kristaps  248:        ( cd .dist/mdocml/ && tar zcf ../../$@ mdocml-$(VERSION)/ )
                    249:        rm -rf .dist/
                    250:
1.148     kristaps  251: llib-llibmdoc.ln: $(MDOCLNS)
1.181     kristaps  252:        $(LINT) -Clibmdoc $(MDOCLNS)
1.148     kristaps  253:
                    254: llib-llibman.ln: $(MANLNS)
1.181     kristaps  255:        $(LINT) -Clibman $(MANLNS)
1.60      kristaps  256:
1.268   ! kristaps  257: llib-llibmandoc.ln: $(MANDOCLNS)
        !           258:        $(LINT) -Clibmandoc $(MANDOCLNS)
        !           259:
        !           260: llib-lmandoc.ln: $(MAINLNS) llib-llibmdoc.ln llib-llibman.ln llib-llibmandoc.ln
        !           261:        $(LINT) -Cmandoc $(MAINLNS) llib-llibmdoc.ln llib-llibman.ln llib-llibmandoc.ln
1.60      kristaps  262:
1.148     kristaps  263: libmdoc.a: $(MDOCOBJS)
                    264:        $(AR) rs $@ $(MDOCOBJS)
                    265:
                    266: libman.a: $(MANOBJS)
                    267:        $(AR) rs $@ $(MANOBJS)
1.60      kristaps  268:
1.268   ! kristaps  269: libmandoc.a: $(MANDOCOBJS)
        !           270:        $(AR) rs $@ $(MANDOCOBJS)
        !           271:
        !           272: mandoc: $(MAINOBJS) libmdoc.a libman.a libmandoc.a
        !           273:        $(CC) $(CFLAGS) -o $@ $(MAINOBJS) libmdoc.a libman.a libmandoc.a
1.75      kristaps  274:
1.79      kristaps  275: .sgml.html:
1.238     kristaps  276:        validate --warn $<
1.85      kristaps  277:        sed -e "s!@VERSION@!$(VERSION)!" -e "s!@VDATE@!$(VDATE)!" $< > $@
1.168     kristaps  278:
1.228     kristaps  279: .1.1.txt .3.3.txt .7.7.txt:
1.222     kristaps  280:        ./mandoc $(MANDOCFLAGS) $< | col -b > $@
1.168     kristaps  281:
1.230     kristaps  282: .1.1.sgml .3.3.sgml .7.7.sgml:
1.222     kristaps  283:        ./mandoc $(MANDOCFLAGS) $(MANDOCHTML) $< > $@
1.212     kristaps  284:
1.185     kristaps  285: .tar.gz.md5:
1.186     kristaps  286:        md5 $< > $@
1.260     kristaps  287:
                    288: .h.h.html:
                    289:        highlight -I $< >$@
1.246     kristaps  290:
                    291: config.h: config.h.pre config.h.post
                    292:        rm -f config.log
                    293:        ( cat config.h.pre; \
                    294:        echo; \
1.247     kristaps  295:        if $(CC) $(CFLAGS) -Werror -c test-strlcat.c >> config.log 2>&1; then \
1.246     kristaps  296:                echo '#define HAVE_STRLCAT'; \
                    297:                rm test-strlcat.o; \
                    298:        fi; \
1.247     kristaps  299:        if $(CC) $(CFLAGS) -Werror -c test-strlcpy.c >> config.log 2>&1; then \
1.246     kristaps  300:                echo '#define HAVE_STRLCPY'; \
                    301:                rm test-strlcpy.o; \
                    302:        fi; \
                    303:        echo; \
                    304:        cat config.h.post \
                    305:        ) > $@

CVSweb