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

Annotation of mandoc/Makefile, Revision 1.123

1.79      kristaps    1: .SUFFIXES:     .html .sgml
                      2:
1.123   ! kristaps    3: VERSION        = 1.4.15
        !             4: VDATE  = 14 March 2009
1.31      kristaps    5:
1.99      kristaps    6: BINDIR         = $(PREFIX)/bin
                      7: INCLUDEDIR     = $(PREFIX)/include
                      8: LIBDIR         = $(PREFIX)/lib
                      9: MANDIR         = $(PREFIX)/man
                     10:
                     11: INSTALL_PROGRAM        = install -m 0755
                     12: INSTALL_DATA   = install -m 0444
                     13: INSTALL_LIB    = install -m 0644
                     14: INSTALL_MAN    = $(INSTALL_DATA)
                     15:
1.113     kristaps   16: VFLAGS  = -DVERSION=\"$(VERSION)\"
1.73      kristaps   17: CFLAGS += -W -Wall -Wstrict-prototypes -Wno-unused-parameter -g
1.7       kristaps   18:
1.113     kristaps   19: LINTFLAGS += $(VFLAGS)
                     20: CFLAGS    += $(VFLAGS)
                     21:
1.60      kristaps   22: LIBLNS = macro.ln mdoc.ln hash.ln strings.ln xstd.ln argv.ln \
1.108     kristaps   23:          validate.ln action.ln lib.ln att.ln arch.ln vol.ln \
                     24:          msec.ln st.ln
1.60      kristaps   25:
1.77      kristaps   26: TREELNS        = mdoctree.ln mmain.ln
1.60      kristaps   27:
1.77      kristaps   28: TERMLNS        = mdoctree.ln mmain.ln term.ln
1.4       kristaps   29:
1.78      kristaps   30: LINTLNS        = mdoclint.ln mmain.ln
                     31:
1.75      kristaps   32: LNS    = $(LIBLNS) $(TREELNS) $(TERMLNS)
                     33:
                     34: LLNS   = llib-llibmdoc.ln llib-lmdoctree.ln llib-lmdocterm.ln
1.4       kristaps   35:
1.50      kristaps   36: LIBS   = libmdoc.a
1.4       kristaps   37:
1.60      kristaps   38: LIBOBJS        = macro.o mdoc.o hash.o strings.o xstd.o argv.o \
1.108     kristaps   39:          validate.o action.o lib.o att.o arch.o vol.o msec.o \
                     40:          st.o
1.75      kristaps   41:
1.77      kristaps   42: TERMOBJS= mdocterm.o mmain.o term.o
1.60      kristaps   43:
1.77      kristaps   44: TREEOBJS= mdoctree.o mmain.o
1.60      kristaps   45:
1.78      kristaps   46: LINTOBJS= mdoclint.o mmain.o
                     47:
1.108     kristaps   48: OBJS   = $(LIBOBJS) $(TERMOBJS) $(TREEOBJS) $(LINTOBJS)
1.4       kristaps   49:
1.75      kristaps   50: SRCS   = macro.c mdoc.c hash.c strings.c xstd.c argv.c validate.c \
1.78      kristaps   51:          action.c term.c mdoctree.c mdocterm.c mmain.c mdoclint.c
1.4       kristaps   52:
1.108     kristaps   53: SCRIPTS = strings.sh
                     54:
1.111     kristaps   55: DATAS  = arch.in att.in lib.in msec.in st.in vol.in
                     56:
1.108     kristaps   57: GEN    = lib.c att.c arch.c vol.c msec.c st.c
                     58:
1.76      kristaps   59: HEADS  = mdoc.h private.h term.h mmain.h
1.1       kristaps   60:
1.79      kristaps   61: SGMLS  = index.sgml
                     62:
                     63: HTMLS  = index.html
                     64:
                     65: STATICS        = style.css external.png
                     66:
1.91      kristaps   67: TARGZS = mdocml-$(VERSION).tar.gz mdocml-oport-$(VERSION).tar.gz \
                     68:          mdocml-nport-$(VERSION).tar.gz
1.81      kristaps   69:
1.122     kristaps   70: MANS   = mdoctree.1 mdocterm.1 mdoclint.1 mdoc.3 mdoc.7
1.63      kristaps   71:
1.78      kristaps   72: BINS   = mdocterm mdoctree mdoclint
1.4       kristaps   73:
1.81      kristaps   74: CLEAN  = $(BINS) $(LNS) $(LLNS) $(LIBS) $(OBJS) $(HTMLS) \
1.108     kristaps   75:          $(TARGZS) $(GEN)
1.29      kristaps   76:
1.90      kristaps   77: INSTALL        = $(SRCS) $(HEADS) Makefile DESCR $(MANS) $(SGMLS) \
1.111     kristaps   78:          $(STATICS) $(SCRIPTS) Makefile.netbsd Makefile.openbsd \
                     79:          $(DATAS)
1.59      kristaps   80:
1.64      kristaps   81: FAIL   = regress/test.empty \
                     82:          regress/test.prologue.00 \
                     83:          regress/test.prologue.01 \
                     84:          regress/test.prologue.02 \
                     85:          regress/test.prologue.03 \
                     86:          regress/test.prologue.04 \
                     87:          regress/test.prologue.06 \
                     88:          regress/test.prologue.19 \
                     89:          regress/test.prologue.23 \
1.65      kristaps   90:          regress/test.prologue.24 \
                     91:          regress/test.prologue.27 \
                     92:          regress/test.prologue.28 \
                     93:          regress/test.prologue.30 \
                     94:          regress/test.prologue.31 \
                     95:          regress/test.prologue.32 \
1.83      kristaps   96:          regress/test.sh.03 \
                     97:          regress/test.escape.01 \
                     98:          regress/test.escape.02 \
                     99:          regress/test.escape.03 \
1.84      kristaps  100:          regress/test.escape.04 \
                    101:          regress/test.escape.06 \
                    102:          regress/test.escape.07 \
                    103:          regress/test.escape.08 \
1.87      kristaps  104:          regress/test.escape.09 \
                    105:          regress/test.escape.11 \
1.103     kristaps  106:          regress/test.escape.12 \
1.106     kristaps  107:          regress/test.escape.14 \
1.107     kristaps  108:          regress/test.argv.01 \
                    109:          regress/test.argv.02
1.64      kristaps  110:
                    111: SUCCEED        = regress/test.prologue.05 \
                    112:          regress/test.prologue.07 \
                    113:          regress/test.prologue.08 \
                    114:          regress/test.prologue.09 \
                    115:          regress/test.prologue.10 \
                    116:          regress/test.prologue.11 \
                    117:          regress/test.prologue.12 \
1.108     kristaps  118:          regress/test.prologue.13 \
1.64      kristaps  119:          regress/test.prologue.14 \
1.108     kristaps  120:          regress/test.prologue.15 \
                    121:          regress/test.prologue.16 \
1.64      kristaps  122:          regress/test.prologue.17 \
1.108     kristaps  123:          regress/test.prologue.18 \
1.65      kristaps  124:          regress/test.prologue.20 \
1.108     kristaps  125:          regress/test.prologue.21 \
                    126:          regress/test.prologue.22 \
                    127:          regress/test.prologue.25 \
                    128:          regress/test.prologue.26 \
                    129:          regress/test.prologue.29 \
                    130:          regress/test.prologue.33 \
1.65      kristaps  131:          regress/test.sh.00 \
1.66      kristaps  132:          regress/test.name.00 \
1.78      kristaps  133:          regress/test.name.01 \
                    134:          regress/test.name.02 \
                    135:          regress/test.name.03 \
1.66      kristaps  136:          regress/test.list.00 \
                    137:          regress/test.list.01 \
                    138:          regress/test.list.02 \
                    139:          regress/test.list.03 \
1.67      kristaps  140:          regress/test.list.04 \
                    141:          regress/test.list.05 \
1.83      kristaps  142:          regress/test.list.06 \
1.94      kristaps  143:          regress/test.list.07 \
1.83      kristaps  144:          regress/test.sh.01 \
                    145:          regress/test.sh.02 \
1.84      kristaps  146:          regress/test.escape.00 \
1.87      kristaps  147:          regress/test.escape.05 \
1.103     kristaps  148:          regress/test.escape.10 \
1.106     kristaps  149:          regress/test.escape.13 \
                    150:          regress/test.argv.00
1.64      kristaps  151:
1.81      kristaps  152: REGRESS        = $(FAIL) $(SUCCEED)
                    153:
1.50      kristaps  154: all:   $(BINS)
1.32      kristaps  155:
1.50      kristaps  156: lint:  $(LLNS)
1.42      kristaps  157:
1.1       kristaps  158: clean:
                    159:        rm -f $(CLEAN)
                    160:
1.89      kristaps  161: cleanlint:
                    162:        rm -f $(LNS) $(LLNS)
                    163:
1.60      kristaps  164: dist:  mdocml-$(VERSION).tar.gz
1.59      kristaps  165:
1.90      kristaps  166: port:  mdocml-oport-$(VERSION).tar.gz mdocml-nport-$(VERSION).tar.gz
1.20      kristaps  167:
1.81      kristaps  168: www:   $(HTMLS) $(TARGZS)
1.79      kristaps  169:
1.80      kristaps  170: installwww: www
                    171:        install -m 0444 $(HTMLS) $(STATICS) $(PREFIX)/
1.81      kristaps  172:        install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/
1.91      kristaps  173:        install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/mdocml.tar.gz
1.81      kristaps  174:        install -m 0444 mdocml-oport-$(VERSION).tar.gz $(PREFIX)/ports-openbsd/
                    175:        install -m 0444 mdocml-oport-$(VERSION).tar.gz $(PREFIX)/ports-openbsd/mdocml.tar.gz
1.91      kristaps  176:        install -m 0444 mdocml-nport-$(VERSION).tar.gz $(PREFIX)/ports-netbsd/
                    177:        install -m 0444 mdocml-nport-$(VERSION).tar.gz $(PREFIX)/ports-netbsd/mdocml.tar.gz
1.80      kristaps  178:
1.122     kristaps  179: #regress: mdoclint $(FAIL) $(SUCCEED)
                    180: #      @for f in $(FAIL); do \
                    181: #              echo "./mdoclint $$f" ; \
                    182: #              ./mdoclint $$f 2>/dev/null || continue ; exit 1 ; done
                    183: #      @for f in $(SUCCEED); do \
                    184: #              echo "./mdoclint $$f" ; \
1.78      kristaps  185:                ./mdoclint $$f 2>/dev/null || exit 1 ; done
1.64      kristaps  186:
1.60      kristaps  187: install:
1.101     kristaps  188:        mkdir -p $(BINDIR)
                    189:        mkdir -p $(INCLUDEDIR)
                    190:        mkdir -p $(LIBDIR)/lib
                    191:        mkdir -p $(MANDIR)/man1
                    192:        mkdir -p $(MANDIR)/man3
                    193:        $(INSTALL_PROGRAM) mdocterm $(BINDIR)
                    194:        $(INSTALL_PROGRAM) mdoctree $(BINDIR)
                    195:        $(INSTALL_PROGRAM) mdoclint $(BINDIR)
                    196:        $(INSTALL_MAN) mdocterm.1 $(MANDIR)/man1
                    197:        $(INSTALL_MAN) mdoctree.1 $(MANDIR)/man1
                    198:        $(INSTALL_MAN) mdoclint.1 $(MANDIR)/man1
                    199:        $(INSTALL_MAN) mdoc.3 $(MANDIR)/man3
                    200:        $(INSTALL_LIB) libmdoc.a $(LIBDIR)
                    201:        $(INSTALL_DATA) mdoc.h $(INCLUDEDIR)
1.60      kristaps  202:
                    203: uninstall:
1.101     kristaps  204:        rm -f $(BINDIR)/mdocterm
                    205:        rm -f $(BINDIR)/mdoctree
                    206:        rm -f $(BINDIR)/mdoclint
                    207:        rm -f $(MANDIR)/man1/mdocterm.1
                    208:        rm -f $(MANDIR)/man1/mdoctree.1
                    209:        rm -f $(MANDIR)/man1/mdoclint.1
                    210:        rm -f $(MANDIR)/man3/mdoc.3
                    211:        rm -f $(LIBDIR)/libmdoc.a
                    212:        rm -f $(INCLUDEDIR)/mdoc.h
1.20      kristaps  213:
1.108     kristaps  214: lib.ln: lib.c private.h
                    215: lib.o: lib.c private.h
                    216:
                    217: att.ln: att.c private.h
                    218: att.o: att.c private.h
                    219:
                    220: arch.ln: arch.c private.h
                    221: arch.o: arch.c private.h
                    222:
                    223: vol.ln: vol.c private.h
                    224: vol.o: vol.c private.h
                    225:
                    226: msec.ln: msec.c private.h
                    227: msec.o: msec.c private.h
                    228:
                    229: st.ln: st.c private.h
                    230: st.o: st.c private.h
                    231:
                    232: lib.c: lib.in strings.sh
                    233:        sh strings.sh -o $@ lib lib.in
                    234:
                    235: st.c: st.in strings.sh
                    236:        sh strings.sh -o $@ st st.in
                    237:
                    238: msec.c: msec.in strings.sh
                    239:        sh strings.sh -o $@ msec msec.in
                    240:
                    241: att.c: att.in strings.sh
                    242:        sh strings.sh -o $@ att att.in
                    243:
                    244: arch.c: arch.in strings.sh
                    245:        sh strings.sh -o $@ arch arch.in
                    246:
                    247: vol.c: vol.in strings.sh
                    248:        sh strings.sh -o $@ vol vol.in
                    249:
1.50      kristaps  250: macro.ln: macro.c private.h
                    251: macro.o: macro.c private.h
1.21      kristaps  252:
1.74      kristaps  253: term.ln: term.c term.h
                    254: term.o: term.c term.h
                    255:
1.52      kristaps  256: strings.ln: strings.c private.h
                    257: strings.o: strings.c private.h
                    258:
1.50      kristaps  259: hash.ln: hash.c private.h
                    260: hash.o: hash.c private.h
1.21      kristaps  261:
1.50      kristaps  262: mdoc.ln: mdoc.c private.h
                    263: mdoc.o: mdoc.c private.h
1.47      kristaps  264:
1.76      kristaps  265: mdocterm.ln: mdocterm.c mmain.h
                    266: mdocterm.o: mdocterm.c mmain.h
1.47      kristaps  267:
1.78      kristaps  268: mdoclint.ln: mdoclint.c mmain.h
                    269: mdoclint.o: mdoclint.c mmain.h
                    270:
1.76      kristaps  271: mdoctree.ln: mdoctree.c mmain.h
                    272: mdoctree.o: mdoctree.c mmain.h
1.39      kristaps  273:
1.53      kristaps  274: xstd.ln: xstd.c private.h
                    275: xstd.o: xstd.c private.h
                    276:
                    277: argv.ln: argv.c private.h
                    278: argv.o: argv.c private.h
                    279:
1.54      kristaps  280: validate.ln: validate.c private.h
                    281: validate.o: validate.c private.h
                    282:
1.56      kristaps  283: action.ln: action.c private.h
1.76      kristaps  284: action.o: action.c private.h
1.56      kristaps  285:
1.76      kristaps  286: mmain.ln: mmain.c mmain.h
                    287: mmain.o: mmain.c mmain.h
1.56      kristaps  288:
1.50      kristaps  289: private.h: mdoc.h
1.39      kristaps  290:
1.76      kristaps  291: mmain.h: mdoc.h
                    292:
                    293: term.h: mdoc.h
                    294:
1.90      kristaps  295: mdocml-nport-$(VERSION).tar.gz: mdocml-$(VERSION).tar.gz Makefile.netbsd DESCR
                    296:        mkdir -p .dist/mdocml/
                    297:        sed -e "s!@VERSION@!$(VERSION)!" Makefile.netbsd > \
                    298:                .dist/mdocml/Makefile
                    299:        md5 mdocml-$(VERSION).tar.gz > .dist/mdocml/distinfo
                    300:        rmd160 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
                    301:        sha1 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
                    302:        install -m 0644 DESCR .dist/mdocml/
                    303:        echo @comment $$NetBSD$$ > .dist/mdocml/PLIST
                    304:        echo bin/mdocterm >> .dist/mdocml/PLIST
                    305:        echo bin/mdoctree >> .dist/mdocml/PLIST
                    306:        echo bin/mdoclint >> .dist/mdocml/PLIST
                    307:        echo lib/libmdoc.a >> .dist/mdocml/PLIST
                    308:        echo include/mdoc.h >> .dist/mdocml/PLIST
                    309:        echo man/man1/mdoctree.1 >> .dist/mdocml/PLIST
                    310:        echo man/man1/mdocterm.1 >> .dist/mdocml/PLIST
                    311:        echo man/man1/mdoclint.1 >> .dist/mdocml/PLIST
                    312:        echo man/man3/mdoc.3 >> .dist/mdocml/PLIST
                    313:        ( cd .dist/ && tar zcf ../$@ mdocml/ )
                    314:        rm -rf .dist/
                    315:
                    316: mdocml-oport-$(VERSION).tar.gz: mdocml-$(VERSION).tar.gz Makefile.openbsd DESCR
1.60      kristaps  317:        mkdir -p .dist/mdocml/pkg
1.90      kristaps  318:        sed -e "s!@VERSION@!$(VERSION)!" Makefile.openbsd > \
1.81      kristaps  319:                .dist/mdocml/Makefile
1.60      kristaps  320:        md5 mdocml-$(VERSION).tar.gz > .dist/mdocml/distinfo
                    321:        rmd160 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
                    322:        sha1 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
                    323:        install -m 0644 DESCR .dist/mdocml/pkg/DESCR
                    324:        echo @comment $$OpenBSD$$ > .dist/mdocml/pkg/PLIST
1.75      kristaps  325:        echo bin/mdocterm >> .dist/mdocml/pkg/PLIST
                    326:        echo bin/mdoctree >> .dist/mdocml/pkg/PLIST
1.78      kristaps  327:        echo bin/mdoclint >> .dist/mdocml/pkg/PLIST
1.60      kristaps  328:        echo lib/libmdoc.a >> .dist/mdocml/pkg/PLIST
                    329:        echo include/mdoc.h >> .dist/mdocml/pkg/PLIST
1.75      kristaps  330:        echo @man man/man1/mdoctree.1 >> .dist/mdocml/pkg/PLIST
                    331:        echo @man man/man1/mdocterm.1 >> .dist/mdocml/pkg/PLIST
1.78      kristaps  332:        echo @man man/man1/mdoclint.1 >> .dist/mdocml/pkg/PLIST
1.60      kristaps  333:        echo @man man/man3/mdoc.3 >> .dist/mdocml/pkg/PLIST
                    334:        ( cd .dist/ && tar zcf ../$@ mdocml/ )
                    335:        rm -rf .dist/
                    336:
                    337: mdocml-$(VERSION).tar.gz: $(INSTALL)
                    338:        mkdir -p .dist/mdocml/mdocml-$(VERSION)/
1.81      kristaps  339:        mkdir -p .dist/mdocml/mdocml-$(VERSION)/regress/
1.60      kristaps  340:        install -m 0644 $(INSTALL) .dist/mdocml/mdocml-$(VERSION)/
1.81      kristaps  341:        install -m 0644 $(REGRESS) .dist/mdocml/mdocml-$(VERSION)/regress/
1.60      kristaps  342:        ( cd .dist/mdocml/ && tar zcf ../../$@ mdocml-$(VERSION)/ )
                    343:        rm -rf .dist/
                    344:
                    345: llib-llibmdoc.ln: $(LIBLNS)
                    346:        $(LINT) $(LINTFLAGS) -Clibmdoc $(LIBLNS)
                    347:
1.75      kristaps  348: llib-lmdoctree.ln: $(TREELNS) llib-llibmdoc.ln
                    349:        $(LINT) $(LINTFLAGS) -Cmdoctree $(TREELNS) llib-llibmdoc.ln
                    350:
                    351: llib-lmdocterm.ln: $(TERMLNS) llib-llibmdoc.ln
                    352:        $(LINT) $(LINTFLAGS) -Cmdocterm $(TERMLNS) llib-llibmdoc.ln
1.60      kristaps  353:
                    354: libmdoc.a: $(LIBOBJS)
                    355:        $(AR) rs $@ $(LIBOBJS)
                    356:
1.75      kristaps  357: mdocterm: $(TERMOBJS) libmdoc.a
                    358:        $(CC) $(CFLAGS) -o $@ $(TERMOBJS) libmdoc.a
                    359:
                    360: mdoctree: $(TREEOBJS) libmdoc.a
                    361:        $(CC) $(CFLAGS) -o $@ $(TREEOBJS) libmdoc.a
1.39      kristaps  362:
1.78      kristaps  363: mdoclint: $(LINTOBJS) libmdoc.a
                    364:        $(CC) $(CFLAGS) -o $@ $(LINTOBJS) libmdoc.a
1.79      kristaps  365:
                    366: .sgml.html:
                    367:        validate $<
1.85      kristaps  368:        sed -e "s!@VERSION@!$(VERSION)!" -e "s!@VDATE@!$(VDATE)!" $< > $@
                    369:

CVSweb