Annotation of mandoc/Makefile, Revision 1.81
1.79 kristaps 1: .SUFFIXES: .html .sgml
2:
1.81 ! kristaps 3: VERSION = 1.3.3
1.31 kristaps 4:
1.73 kristaps 5: CFLAGS += -W -Wall -Wstrict-prototypes -Wno-unused-parameter -g
1.7 kristaps 6:
1.60 kristaps 7: LIBLNS = macro.ln mdoc.ln hash.ln strings.ln xstd.ln argv.ln \
1.69 kristaps 8: validate.ln action.ln
1.60 kristaps 9:
1.77 kristaps 10: TREELNS = mdoctree.ln mmain.ln
1.60 kristaps 11:
1.77 kristaps 12: TERMLNS = mdoctree.ln mmain.ln term.ln
1.4 kristaps 13:
1.78 kristaps 14: LINTLNS = mdoclint.ln mmain.ln
15:
1.75 kristaps 16: LNS = $(LIBLNS) $(TREELNS) $(TERMLNS)
17:
18: LLNS = llib-llibmdoc.ln llib-lmdoctree.ln llib-lmdocterm.ln
1.4 kristaps 19:
1.50 kristaps 20: LIBS = libmdoc.a
1.4 kristaps 21:
1.60 kristaps 22: LIBOBJS = macro.o mdoc.o hash.o strings.o xstd.o argv.o \
1.75 kristaps 23: validate.o action.o
24:
1.77 kristaps 25: TERMOBJS= mdocterm.o mmain.o term.o
1.60 kristaps 26:
1.77 kristaps 27: TREEOBJS= mdoctree.o mmain.o
1.60 kristaps 28:
1.78 kristaps 29: LINTOBJS= mdoclint.o mmain.o
30:
1.75 kristaps 31: OBJS = $(LIBOBJS) $(TERMOBJS) $(TREEOBJS)
1.4 kristaps 32:
1.75 kristaps 33: SRCS = macro.c mdoc.c hash.c strings.c xstd.c argv.c validate.c \
1.78 kristaps 34: action.c term.c mdoctree.c mdocterm.c mmain.c mdoclint.c
1.4 kristaps 35:
1.76 kristaps 36: HEADS = mdoc.h private.h term.h mmain.h
1.1 kristaps 37:
1.79 kristaps 38: SGMLS = index.sgml
39:
40: HTMLS = index.html
41:
42: STATICS = style.css external.png
43:
1.81 ! kristaps 44: TARGZS = mdocml-$(VERSION).tar.gz mdocml-oport-$(VERSION).tar.gz
! 45:
! 46: MANS = mdoctree.1 mdocterm.1 mdoclint.1 mdoc.3
1.63 kristaps 47:
1.78 kristaps 48: BINS = mdocterm mdoctree mdoclint
1.4 kristaps 49:
1.81 ! kristaps 50: CLEAN = $(BINS) $(LNS) $(LLNS) $(LIBS) $(OBJS) $(HTMLS) \
! 51: $(TARGZS)
1.29 kristaps 52:
1.79 kristaps 53: INSTALL = $(SRCS) $(HEADS) Makefile Makefile.port DESCR $(MANS) \
54: $(SGMLS) $(STATICS)
1.59 kristaps 55:
1.64 kristaps 56: FAIL = regress/test.empty \
57: regress/test.prologue.00 \
58: regress/test.prologue.01 \
59: regress/test.prologue.02 \
60: regress/test.prologue.03 \
61: regress/test.prologue.04 \
62: regress/test.prologue.06 \
63: regress/test.prologue.13 \
64: regress/test.prologue.15 \
65: regress/test.prologue.16 \
66: regress/test.prologue.18 \
67: regress/test.prologue.19 \
68: regress/test.prologue.21 \
69: regress/test.prologue.22 \
70: regress/test.prologue.23 \
1.65 kristaps 71: regress/test.prologue.24 \
72: regress/test.prologue.25 \
73: regress/test.prologue.26 \
74: regress/test.prologue.27 \
75: regress/test.prologue.28 \
76: regress/test.prologue.29 \
77: regress/test.prologue.30 \
78: regress/test.prologue.31 \
79: regress/test.prologue.32 \
80: regress/test.prologue.33 \
81: regress/test.sh.01 \
82: regress/test.sh.02 \
1.78 kristaps 83: regress/test.sh.03
1.64 kristaps 84:
85: SUCCEED = regress/test.prologue.05 \
86: regress/test.prologue.07 \
87: regress/test.prologue.08 \
88: regress/test.prologue.09 \
89: regress/test.prologue.10 \
90: regress/test.prologue.11 \
91: regress/test.prologue.12 \
92: regress/test.prologue.14 \
93: regress/test.prologue.17 \
1.65 kristaps 94: regress/test.prologue.20 \
95: regress/test.sh.00 \
1.66 kristaps 96: regress/test.name.00 \
1.78 kristaps 97: regress/test.name.01 \
98: regress/test.name.02 \
99: regress/test.name.03 \
1.66 kristaps 100: regress/test.list.00 \
101: regress/test.list.01 \
102: regress/test.list.02 \
103: regress/test.list.03 \
1.67 kristaps 104: regress/test.list.04 \
105: regress/test.list.05 \
106: regress/test.list.06
1.64 kristaps 107:
1.81 ! kristaps 108: REGRESS = $(FAIL) $(SUCCEED)
! 109:
1.50 kristaps 110: all: $(BINS)
1.32 kristaps 111:
1.50 kristaps 112: lint: $(LLNS)
1.42 kristaps 113:
1.1 kristaps 114: clean:
115: rm -f $(CLEAN)
116:
1.60 kristaps 117: dist: mdocml-$(VERSION).tar.gz
1.59 kristaps 118:
1.60 kristaps 119: port: mdocml-oport-$(VERSION).tar.gz
1.20 kristaps 120:
1.81 ! kristaps 121: www: $(HTMLS) $(TARGZS)
1.79 kristaps 122:
1.80 kristaps 123: installwww: www
124: install -m 0444 $(HTMLS) $(STATICS) $(PREFIX)/
1.81 ! kristaps 125: install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/
! 126: install -m 0444 mdocml-oport-$(VERSION).tar.gz $(PREFIX)/ports-openbsd/
! 127: install -m 0444 mdocml-$(VERSION).tar.gz $(PREFIX)/snapshots/mdocml.tar.gz
! 128: install -m 0444 mdocml-oport-$(VERSION).tar.gz $(PREFIX)/ports-openbsd/mdocml.tar.gz
1.80 kristaps 129:
1.78 kristaps 130: regress:: mdoclint
1.64 kristaps 131: @for f in $(FAIL); do \
1.78 kristaps 132: echo "./mdoclint $$f" ; \
133: ./mdoclint $$f 2>/dev/null || continue ; exit 1 ; done
1.64 kristaps 134: @for f in $(SUCCEED); do \
1.78 kristaps 135: echo "./mdoclint $$f" ; \
136: ./mdoclint $$f 2>/dev/null || exit 1 ; done
1.64 kristaps 137:
1.60 kristaps 138: install:
139: mkdir -p $(PREFIX)/bin/
140: mkdir -p $(PREFIX)/include/mdoc/
141: mkdir -p $(PREFIX)/lib/
142: mkdir -p $(PREFIX)/man/man1/
1.75 kristaps 143: install -m 0755 mdocterm $(PREFIX)/bin/
144: install -m 0755 mdoctree $(PREFIX)/bin/
1.81 ! kristaps 145: install -m 0755 mdoclint $(PREFIX)/bin/
1.75 kristaps 146: install -m 0444 mdocterm.1 $(PREFIX)/man/man1/
1.81 ! kristaps 147: install -m 0444 mdoctree.1 $(PREFIX)/man/man1/
! 148: install -m 0444 mdoclint.1 $(PREFIX)/man/man1/
1.60 kristaps 149: install -m 0444 mdoc.3 $(PREFIX)/man/man3/
150: install -m 0644 libmdoc.a $(PREFIX)/lib/
151: install -m 0444 mdoc.h $(PREFIX)/include/
152:
153: uninstall:
1.75 kristaps 154: rm -f $(PREFIX)/bin/mdocterm
155: rm -f $(PREFIX)/bin/mdoctree
1.81 ! kristaps 156: rm -f $(PREFIX)/bin/mdoclint
1.75 kristaps 157: rm -f $(PREFIX)/man/man1/mdocterm.1
158: rm -f $(PREFIX)/man/man1/mdoctree.1
1.81 ! kristaps 159: rm -f $(PREFIX)/man/man1/mdoclint.1
1.60 kristaps 160: rm -f $(PREFIX)/man/man3/mdoc.3
161: rm -f $(PREFIX)/lib/libmdoc.a
162: rm -f $(PREFIX)/include/mdoc.h
1.20 kristaps 163:
1.50 kristaps 164: macro.ln: macro.c private.h
165: macro.o: macro.c private.h
1.21 kristaps 166:
1.74 kristaps 167: term.ln: term.c term.h
168: term.o: term.c term.h
169:
1.52 kristaps 170: strings.ln: strings.c private.h
171: strings.o: strings.c private.h
172:
1.50 kristaps 173: hash.ln: hash.c private.h
174: hash.o: hash.c private.h
1.21 kristaps 175:
1.50 kristaps 176: mdoc.ln: mdoc.c private.h
177: mdoc.o: mdoc.c private.h
1.47 kristaps 178:
1.76 kristaps 179: mdocterm.ln: mdocterm.c mmain.h
180: mdocterm.o: mdocterm.c mmain.h
1.47 kristaps 181:
1.78 kristaps 182: mdoclint.ln: mdoclint.c mmain.h
183: mdoclint.o: mdoclint.c mmain.h
184:
1.76 kristaps 185: mdoctree.ln: mdoctree.c mmain.h
186: mdoctree.o: mdoctree.c mmain.h
1.39 kristaps 187:
1.53 kristaps 188: xstd.ln: xstd.c private.h
189: xstd.o: xstd.c private.h
190:
191: argv.ln: argv.c private.h
192: argv.o: argv.c private.h
193:
1.54 kristaps 194: validate.ln: validate.c private.h
195: validate.o: validate.c private.h
196:
1.56 kristaps 197: action.ln: action.c private.h
1.76 kristaps 198: action.o: action.c private.h
1.56 kristaps 199:
1.76 kristaps 200: mmain.ln: mmain.c mmain.h
201: mmain.o: mmain.c mmain.h
1.56 kristaps 202:
1.50 kristaps 203: private.h: mdoc.h
1.39 kristaps 204:
1.76 kristaps 205: mmain.h: mdoc.h
206:
207: term.h: mdoc.h
208:
1.81 ! kristaps 209: mdocml-oport-$(VERSION).tar.gz: mdocml-$(VERSION).tar.gz Makefile.port DESCR
1.60 kristaps 210: mkdir -p .dist/mdocml/pkg
1.81 ! kristaps 211: sed -e "s!@VERSION@!$(VERSION)!" Makefile.port > \
! 212: .dist/mdocml/Makefile
1.60 kristaps 213: md5 mdocml-$(VERSION).tar.gz > .dist/mdocml/distinfo
214: rmd160 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
215: sha1 mdocml-$(VERSION).tar.gz >> .dist/mdocml/distinfo
216: install -m 0644 DESCR .dist/mdocml/pkg/DESCR
217: echo @comment $$OpenBSD$$ > .dist/mdocml/pkg/PLIST
1.75 kristaps 218: echo bin/mdocterm >> .dist/mdocml/pkg/PLIST
219: echo bin/mdoctree >> .dist/mdocml/pkg/PLIST
1.78 kristaps 220: echo bin/mdoclint >> .dist/mdocml/pkg/PLIST
1.60 kristaps 221: echo lib/libmdoc.a >> .dist/mdocml/pkg/PLIST
222: echo include/mdoc.h >> .dist/mdocml/pkg/PLIST
1.75 kristaps 223: echo @man man/man1/mdoctree.1 >> .dist/mdocml/pkg/PLIST
224: echo @man man/man1/mdocterm.1 >> .dist/mdocml/pkg/PLIST
1.78 kristaps 225: echo @man man/man1/mdoclint.1 >> .dist/mdocml/pkg/PLIST
1.60 kristaps 226: echo @man man/man3/mdoc.3 >> .dist/mdocml/pkg/PLIST
227: ( cd .dist/ && tar zcf ../$@ mdocml/ )
228: rm -rf .dist/
229:
230: mdocml-$(VERSION).tar.gz: $(INSTALL)
231: mkdir -p .dist/mdocml/mdocml-$(VERSION)/
1.81 ! kristaps 232: mkdir -p .dist/mdocml/mdocml-$(VERSION)/regress/
1.60 kristaps 233: install -m 0644 $(INSTALL) .dist/mdocml/mdocml-$(VERSION)/
1.81 ! kristaps 234: install -m 0644 $(REGRESS) .dist/mdocml/mdocml-$(VERSION)/regress/
1.60 kristaps 235: ( cd .dist/mdocml/ && tar zcf ../../$@ mdocml-$(VERSION)/ )
236: rm -rf .dist/
237:
238: llib-llibmdoc.ln: $(LIBLNS)
239: $(LINT) $(LINTFLAGS) -Clibmdoc $(LIBLNS)
240:
1.75 kristaps 241: llib-lmdoctree.ln: $(TREELNS) llib-llibmdoc.ln
242: $(LINT) $(LINTFLAGS) -Cmdoctree $(TREELNS) llib-llibmdoc.ln
243:
244: llib-lmdocterm.ln: $(TERMLNS) llib-llibmdoc.ln
245: $(LINT) $(LINTFLAGS) -Cmdocterm $(TERMLNS) llib-llibmdoc.ln
1.60 kristaps 246:
247: libmdoc.a: $(LIBOBJS)
248: $(AR) rs $@ $(LIBOBJS)
249:
1.75 kristaps 250: mdocterm: $(TERMOBJS) libmdoc.a
251: $(CC) $(CFLAGS) -o $@ $(TERMOBJS) libmdoc.a
252:
253: mdoctree: $(TREEOBJS) libmdoc.a
254: $(CC) $(CFLAGS) -o $@ $(TREEOBJS) libmdoc.a
1.39 kristaps 255:
1.78 kristaps 256: mdoclint: $(LINTOBJS) libmdoc.a
257: $(CC) $(CFLAGS) -o $@ $(LINTOBJS) libmdoc.a
1.79 kristaps 258:
259: .sgml.html:
260: validate $<
261: cp -f $< $@
CVSweb