1 1.1.1.8 joerg .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.ps .3.ps .7.ps .1.pdf .3.pdf .7.pdf 2 1.1 joerg 3 1.1.1.4 joerg PREFIX = /usr/local 4 1.1 joerg BINDIR = $(PREFIX)/bin 5 1.1 joerg INCLUDEDIR = $(PREFIX)/include 6 1.1 joerg LIBDIR = $(PREFIX)/lib 7 1.1 joerg MANDIR = $(PREFIX)/man 8 1.1 joerg EXAMPLEDIR = $(PREFIX)/share/examples/mandoc 9 1.1.1.4 joerg INSTALL = install 10 1.1.1.4 joerg INSTALL_PROGRAM = $(INSTALL) -m 0755 11 1.1.1.4 joerg INSTALL_DATA = $(INSTALL) -m 0444 12 1.1.1.4 joerg INSTALL_LIB = $(INSTALL) -m 0644 13 1.1 joerg INSTALL_MAN = $(INSTALL_DATA) 14 1.1 joerg 15 1.1.1.8 joerg VERSION = 1.10.5 16 1.1.1.8 joerg VDATE = 27 July 2010 17 1.1 joerg 18 1.1.1.2 joerg VFLAGS = -DVERSION="\"$(VERSION)\"" 19 1.1 joerg WFLAGS = -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings 20 1.1.1.2 joerg CFLAGS += -g $(WFLAGS) $(VFLAGS) -DHAVE_CONFIG_H 21 1.1.1.2 joerg 22 1.1.1.2 joerg # Specify this if you want to hard-code the operating system to appear 23 1.1.1.2 joerg # in the lower-left hand corner of -mdoc manuals. 24 1.1.1.2 joerg # CFLAGS += -DOSNAME="\"OpenBSD 4.5\"" 25 1.1.1.2 joerg 26 1.1 joerg LINTFLAGS += $(VFLAGS) 27 1.1 joerg 28 1.1.1.4 joerg ROFFLNS = roff.ln 29 1.1.1.4 joerg 30 1.1.1.4 joerg ROFFSRCS = roff.c 31 1.1.1.4 joerg 32 1.1.1.4 joerg ROFFOBJS = roff.o 33 1.1.1.4 joerg 34 1.1.1.4 joerg MANDOCLNS = mandoc.ln 35 1.1.1.4 joerg 36 1.1.1.4 joerg MANDOCSRCS = mandoc.c 37 1.1.1.4 joerg 38 1.1.1.4 joerg MANDOCOBJS = mandoc.o 39 1.1.1.4 joerg 40 1.1 joerg MDOCLNS = mdoc_macro.ln mdoc.ln mdoc_hash.ln mdoc_strings.ln \ 41 1.1 joerg mdoc_argv.ln mdoc_validate.ln mdoc_action.ln \ 42 1.1.1.4 joerg lib.ln att.ln arch.ln vol.ln msec.ln st.ln 43 1.1.1.4 joerg 44 1.1 joerg MDOCOBJS = mdoc_macro.o mdoc.o mdoc_hash.o mdoc_strings.o \ 45 1.1 joerg mdoc_argv.o mdoc_validate.o mdoc_action.o lib.o att.o \ 46 1.1.1.4 joerg arch.o vol.o msec.o st.o 47 1.1.1.4 joerg 48 1.1 joerg MDOCSRCS = mdoc_macro.c mdoc.c mdoc_hash.c mdoc_strings.c \ 49 1.1 joerg mdoc_argv.c mdoc_validate.c mdoc_action.c lib.c att.c \ 50 1.1.1.4 joerg arch.c vol.c msec.c st.c 51 1.1 joerg 52 1.1 joerg MANLNS = man_macro.ln man.ln man_hash.ln man_validate.ln \ 53 1.1.1.4 joerg man_action.ln man_argv.ln 54 1.1.1.4 joerg 55 1.1 joerg MANOBJS = man_macro.o man.o man_hash.o man_validate.o \ 56 1.1.1.4 joerg man_action.o man_argv.o 57 1.1 joerg MANSRCS = man_macro.c man.c man_hash.c man_validate.c \ 58 1.1.1.7 joerg man_action.c man_argv.c 59 1.1 joerg 60 1.1 joerg MAINLNS = main.ln mdoc_term.ln chars.ln term.ln tree.ln \ 61 1.1 joerg compat.ln man_term.ln html.ln mdoc_html.ln \ 62 1.1.1.6 joerg man_html.ln out.ln term_ps.ln term_ascii.ln 63 1.1.1.4 joerg 64 1.1 joerg MAINOBJS = main.o mdoc_term.o chars.o term.o tree.o compat.o \ 65 1.1.1.6 joerg man_term.o html.o mdoc_html.o man_html.o out.o \ 66 1.1.1.6 joerg term_ps.o term_ascii.o 67 1.1.1.4 joerg 68 1.1 joerg MAINSRCS = main.c mdoc_term.c chars.c term.c tree.c compat.c \ 69 1.1.1.6 joerg man_term.c html.c mdoc_html.c man_html.c out.c \ 70 1.1.1.6 joerg term_ps.c term_ascii.c 71 1.1 joerg 72 1.1.1.4 joerg LLNS = llib-llibmdoc.ln llib-llibman.ln llib-lmandoc.ln \ 73 1.1.1.4 joerg llib-llibmandoc.ln llib-llibroff.ln 74 1.1.1.4 joerg 75 1.1.1.4 joerg LNS = $(MAINLNS) $(MDOCLNS) $(MANLNS) \ 76 1.1.1.4 joerg $(MANDOCLNS) $(ROFFLNS) 77 1.1.1.4 joerg 78 1.1.1.4 joerg LIBS = libmdoc.a libman.a libmandoc.a libroff.a 79 1.1.1.4 joerg 80 1.1.1.4 joerg OBJS = $(MDOCOBJS) $(MAINOBJS) $(MANOBJS) \ 81 1.1.1.4 joerg $(MANDOCOBJS) $(ROFFOBJS) 82 1.1.1.4 joerg 83 1.1.1.4 joerg SRCS = $(MDOCSRCS) $(MAINSRCS) $(MANSRCS) \ 84 1.1.1.4 joerg $(MANDOCSRCS) $(ROFFSRCS) 85 1.1.1.4 joerg 86 1.1 joerg DATAS = arch.in att.in lib.in msec.in st.in \ 87 1.1 joerg vol.in chars.in 88 1.1.1.4 joerg 89 1.1 joerg HEADS = mdoc.h libmdoc.h man.h libman.h term.h \ 90 1.1.1.4 joerg libmandoc.h html.h chars.h out.h main.h roff.h \ 91 1.1.1.4 joerg mandoc.h 92 1.1.1.4 joerg 93 1.1.1.5 joerg GSGMLS = mandoc.1.sgml mdoc.3.sgml mdoc.7.sgml \ 94 1.1.1.4 joerg mandoc_char.7.sgml man.7.sgml man.3.sgml roff.7.sgml \ 95 1.1.1.4 joerg roff.3.sgml 96 1.1.1.4 joerg 97 1.1 joerg SGMLS = index.sgml 98 1.1.1.4 joerg 99 1.1.1.4 joerg HTMLS = ChangeLog.html index.html man.h.html mdoc.h.html \ 100 1.1.1.4 joerg mandoc.h.html roff.h.html mandoc.1.html mdoc.3.html \ 101 1.1.1.4 joerg man.3.html mdoc.7.html man.7.html mandoc_char.7.html \ 102 1.1.1.5 joerg roff.7.html roff.3.html 103 1.1.1.5 joerg 104 1.1.1.5 joerg PSS = mandoc.1.ps mdoc.3.ps man.3.ps mdoc.7.ps man.7.ps \ 105 1.1.1.5 joerg mandoc_char.7.ps roff.7.ps roff.3.ps 106 1.1.1.4 joerg 107 1.1.1.8 joerg PDFS = mandoc.1.pdf mdoc.3.pdf man.3.pdf mdoc.7.pdf man.7.pdf \ 108 1.1.1.8 joerg mandoc_char.7.pdf roff.7.pdf roff.3.pdf 109 1.1.1.8 joerg 110 1.1 joerg XSLS = ChangeLog.xsl 111 1.1.1.4 joerg 112 1.1 joerg TEXTS = mandoc.1.txt mdoc.3.txt man.3.txt mdoc.7.txt man.7.txt \ 113 1.1.1.5 joerg mandoc_char.7.txt ChangeLog.txt \ 114 1.1.1.4 joerg roff.7.txt roff.3.txt 115 1.1.1.4 joerg 116 1.1 joerg EXAMPLES = example.style.css 117 1.1.1.4 joerg 118 1.1 joerg XMLS = ChangeLog.xml 119 1.1.1.4 joerg 120 1.1 joerg STATICS = index.css style.css external.png 121 1.1.1.4 joerg 122 1.1 joerg MD5S = mdocml-$(VERSION).md5 123 1.1.1.4 joerg 124 1.1 joerg TARGZS = mdocml-$(VERSION).tar.gz 125 1.1.1.4 joerg 126 1.1.1.5 joerg MANS = mandoc.1 mdoc.3 mdoc.7 mandoc_char.7 man.7 \ 127 1.1.1.4 joerg man.3 roff.7 roff.3 128 1.1.1.4 joerg 129 1.1 joerg BINS = mandoc 130 1.1.1.4 joerg 131 1.1 joerg TESTS = test-strlcat.c test-strlcpy.c 132 1.1.1.4 joerg 133 1.1 joerg CONFIGS = config.h.pre config.h.post 134 1.1.1.4 joerg 135 1.1.1.4 joerg DOCLEAN = $(BINS) $(LNS) $(LLNS) $(LIBS) $(OBJS) $(HTMLS) \ 136 1.1 joerg $(TARGZS) tags $(MD5S) $(XMLS) $(TEXTS) $(GSGMLS) \ 137 1.1.1.8 joerg config.h config.log $(PSS) $(PDFS) 138 1.1.1.4 joerg 139 1.1.1.4 joerg DOINSTALL = $(SRCS) $(HEADS) Makefile $(MANS) $(SGMLS) $(STATICS) \ 140 1.1 joerg $(DATAS) $(XSLS) $(EXAMPLES) $(TESTS) $(CONFIGS) 141 1.1 joerg 142 1.1 joerg all: $(BINS) 143 1.1 joerg 144 1.1 joerg lint: $(LLNS) 145 1.1 joerg 146 1.1 joerg clean: 147 1.1.1.4 joerg rm -f $(DOCLEAN) 148 1.1 joerg 149 1.1 joerg dist: mdocml-$(VERSION).tar.gz 150 1.1 joerg 151 1.1.1.8 joerg www: all $(GSGMLS) $(HTMLS) $(TEXTS) $(MD5S) $(TARGZS) $(PSS) $(PDFS) 152 1.1.1.5 joerg 153 1.1.1.5 joerg ps: $(PSS) 154 1.1 joerg 155 1.1.1.8 joerg pdf: $(PDFS) 156 1.1.1.8 joerg 157 1.1 joerg installwww: www 158 1.1.1.8 joerg $(INSTALL_DATA) $(HTMLS) $(PSS) $(PDFS) $(TEXTS) $(STATICS) $(DESTDIR)$(PREFIX)/ 159 1.1.1.4 joerg $(INSTALL_DATA) mdocml-$(VERSION).tar.gz $(DESTDIR)$(PREFIX)/snapshots/ 160 1.1.1.4 joerg $(INSTALL_DATA) mdocml-$(VERSION).md5 $(DESTDIR)$(PREFIX)/snapshots/ 161 1.1.1.4 joerg $(INSTALL_DATA) mdocml-$(VERSION).tar.gz $(DESTDIR)$(PREFIX)/snapshots/mdocml.tar.gz 162 1.1.1.4 joerg $(INSTALL_DATA) mdocml-$(VERSION).md5 $(DESTDIR)$(PREFIX)/snapshots/mdocml.md5 163 1.1 joerg 164 1.1 joerg install: 165 1.1.1.4 joerg mkdir -p $(DESTDIR)$(BINDIR) 166 1.1.1.4 joerg mkdir -p $(DESTDIR)$(EXAMPLEDIR) 167 1.1.1.4 joerg mkdir -p $(DESTDIR)$(MANDIR)/man1 168 1.1.1.4 joerg mkdir -p $(DESTDIR)$(MANDIR)/man7 169 1.1.1.4 joerg $(INSTALL_PROGRAM) mandoc $(DESTDIR)$(BINDIR) 170 1.1.1.4 joerg $(INSTALL_MAN) mandoc.1 $(DESTDIR)$(MANDIR)/man1 171 1.1.1.4 joerg $(INSTALL_MAN) man.7 mdoc.7 roff.7 mandoc_char.7 $(DESTDIR)$(MANDIR)/man7 172 1.1.1.4 joerg $(INSTALL_DATA) example.style.css $(DESTDIR)$(EXAMPLEDIR) 173 1.1 joerg 174 1.1 joerg uninstall: 175 1.1.1.4 joerg rm -f $(DESTDIR)$(BINDIR)/mandoc 176 1.1.1.4 joerg rm -f $(DESTDIR)$(MANDIR)/man1/mandoc.1 177 1.1.1.4 joerg rm -f $(DESTDIR)$(MANDIR)/man7/mdoc.7 178 1.1.1.4 joerg rm -f $(DESTDIR)$(MANDIR)/man7/roff.7 179 1.1.1.4 joerg rm -f $(DESTDIR)$(MANDIR)/man7/man.7 180 1.1.1.4 joerg rm -f $(DESTDIR)$(MANDIR)/man7/mandoc_char.7 181 1.1.1.4 joerg rm -f $(DESTDIR)$(EXAMPLEDIR)/example.style.css 182 1.1 joerg 183 1.1 joerg $(OBJS): config.h 184 1.1 joerg 185 1.1 joerg $(LNS): config.h 186 1.1 joerg 187 1.1.1.2 joerg man_macro.ln man_macro.o: man_macro.c libman.h 188 1.1 joerg 189 1.1.1.2 joerg lib.ln lib.o: lib.c lib.in libmdoc.h 190 1.1 joerg 191 1.1.1.2 joerg att.ln att.o: att.c att.in libmdoc.h 192 1.1 joerg 193 1.1.1.2 joerg arch.ln arch.o: arch.c arch.in libmdoc.h 194 1.1 joerg 195 1.1.1.2 joerg vol.ln vol.o: vol.c vol.in libmdoc.h 196 1.1 joerg 197 1.1.1.2 joerg chars.ln chars.o: chars.c chars.in chars.h 198 1.1 joerg 199 1.1.1.2 joerg msec.ln msec.o: msec.c msec.in libmdoc.h 200 1.1 joerg 201 1.1.1.2 joerg st.ln st.o: st.c st.in libmdoc.h 202 1.1 joerg 203 1.1.1.2 joerg mdoc_macro.ln mdoc_macro.o: mdoc_macro.c libmdoc.h 204 1.1 joerg 205 1.1.1.2 joerg mdoc_term.ln mdoc_term.o: mdoc_term.c term.h mdoc.h 206 1.1 joerg 207 1.1.1.2 joerg mdoc_strings.ln mdoc_strings.o: mdoc_strings.c libmdoc.h 208 1.1 joerg 209 1.1.1.2 joerg man_hash.ln man_hash.o: man_hash.c libman.h 210 1.1 joerg 211 1.1.1.2 joerg mdoc_hash.ln mdoc_hash.o: mdoc_hash.c libmdoc.h 212 1.1 joerg 213 1.1.1.2 joerg mdoc.ln mdoc.o: mdoc.c libmdoc.h 214 1.1 joerg 215 1.1.1.2 joerg man.ln man.o: man.c libman.h 216 1.1 joerg 217 1.1.1.4 joerg main.ln main.o: main.c mdoc.h man.h roff.h 218 1.1 joerg 219 1.1.1.2 joerg compat.ln compat.o: compat.c 220 1.1 joerg 221 1.1.1.2 joerg term.ln term.o: term.c term.h man.h mdoc.h chars.h 222 1.1 joerg 223 1.1.1.6 joerg term_ps.ln term_ps.o: term_ps.c term.h main.h 224 1.1.1.6 joerg 225 1.1.1.6 joerg term_ascii.ln term_ascii.o: term_ascii.c term.h main.h 226 1.1.1.6 joerg 227 1.1.1.2 joerg html.ln html.o: html.c html.h chars.h 228 1.1 joerg 229 1.1.1.2 joerg mdoc_html.ln mdoc_html.o: mdoc_html.c html.h mdoc.h 230 1.1 joerg 231 1.1.1.2 joerg man_html.ln man_html.o: man_html.c html.h man.h out.h 232 1.1 joerg 233 1.1.1.2 joerg out.ln out.o: out.c out.h 234 1.1 joerg 235 1.1.1.4 joerg mandoc.ln mandoc.o: mandoc.c libmandoc.h 236 1.1.1.4 joerg 237 1.1.1.2 joerg tree.ln tree.o: tree.c man.h mdoc.h 238 1.1 joerg 239 1.1.1.2 joerg mdoc_argv.ln mdoc_argv.o: mdoc_argv.c libmdoc.h 240 1.1 joerg 241 1.1.1.2 joerg man_argv.ln man_argv.o: man_argv.c libman.h 242 1.1 joerg 243 1.1.1.2 joerg man_validate.ln man_validate.o: man_validate.c libman.h 244 1.1 joerg 245 1.1.1.2 joerg mdoc_validate.ln mdoc_validate.o: mdoc_validate.c libmdoc.h 246 1.1 joerg 247 1.1.1.2 joerg mdoc_action.ln mdoc_action.o: mdoc_action.c libmdoc.h 248 1.1 joerg 249 1.1 joerg libmdoc.h: mdoc.h 250 1.1 joerg 251 1.1 joerg ChangeLog.xml: 252 1.1 joerg cvs2cl --xml --xml-encoding iso-8859-15 -t --noxmlns -f $@ 253 1.1 joerg 254 1.1 joerg ChangeLog.txt: 255 1.1 joerg cvs2cl -t -f $@ 256 1.1 joerg 257 1.1 joerg ChangeLog.html: ChangeLog.xml ChangeLog.xsl 258 1.1 joerg xsltproc -o $@ ChangeLog.xsl ChangeLog.xml 259 1.1 joerg 260 1.1.1.4 joerg mdocml-$(VERSION).tar.gz: $(DOINSTALL) 261 1.1 joerg mkdir -p .dist/mdocml/mdocml-$(VERSION)/ 262 1.1.1.4 joerg cp -f $(DOINSTALL) .dist/mdocml/mdocml-$(VERSION)/ 263 1.1 joerg ( cd .dist/mdocml/ && tar zcf ../../$@ mdocml-$(VERSION)/ ) 264 1.1 joerg rm -rf .dist/ 265 1.1 joerg 266 1.1 joerg llib-llibmdoc.ln: $(MDOCLNS) 267 1.1 joerg $(LINT) -Clibmdoc $(MDOCLNS) 268 1.1 joerg 269 1.1 joerg llib-llibman.ln: $(MANLNS) 270 1.1 joerg $(LINT) -Clibman $(MANLNS) 271 1.1 joerg 272 1.1.1.4 joerg llib-llibmandoc.ln: $(MANDOCLNS) 273 1.1.1.4 joerg $(LINT) -Clibmandoc $(MANDOCLNS) 274 1.1.1.4 joerg 275 1.1.1.4 joerg llib-llibroff.ln: $(ROFFLNS) 276 1.1.1.4 joerg $(LINT) -Clibroff $(ROFFLNS) 277 1.1.1.4 joerg 278 1.1.1.4 joerg llib-lmandoc.ln: $(MAINLNS) llib-llibmdoc.ln llib-llibman.ln llib-llibmandoc.ln llib-llibroff.ln 279 1.1.1.4 joerg $(LINT) -Cmandoc $(MAINLNS) llib-llibmdoc.ln llib-llibman.ln llib-llibmandoc.ln llib-llibroff.ln 280 1.1 joerg 281 1.1 joerg libmdoc.a: $(MDOCOBJS) 282 1.1 joerg $(AR) rs $@ $(MDOCOBJS) 283 1.1 joerg 284 1.1 joerg libman.a: $(MANOBJS) 285 1.1 joerg $(AR) rs $@ $(MANOBJS) 286 1.1 joerg 287 1.1.1.4 joerg libmandoc.a: $(MANDOCOBJS) 288 1.1.1.4 joerg $(AR) rs $@ $(MANDOCOBJS) 289 1.1.1.4 joerg 290 1.1.1.4 joerg libroff.a: $(ROFFOBJS) 291 1.1.1.4 joerg $(AR) rs $@ $(ROFFOBJS) 292 1.1.1.4 joerg 293 1.1.1.4 joerg mandoc: $(MAINOBJS) libroff.a libmdoc.a libman.a libmandoc.a 294 1.1.1.4 joerg $(CC) $(CFLAGS) -o $@ $(MAINOBJS) libroff.a libmdoc.a libman.a libmandoc.a 295 1.1 joerg 296 1.1 joerg .sgml.html: 297 1.1 joerg validate --warn $< 298 1.1 joerg sed -e "s!@VERSION@!$(VERSION)!" -e "s!@VDATE@!$(VDATE)!" $< > $@ 299 1.1 joerg 300 1.1 joerg .1.1.txt .3.3.txt .7.7.txt: 301 1.1.1.8 joerg ./mandoc -Tascii -Wall,error -fstrict $< | col -b > $@ 302 1.1 joerg 303 1.1 joerg .1.1.sgml .3.3.sgml .7.7.sgml: 304 1.1.1.8 joerg ./mandoc -Thtml -Wall,error -fstrict -Ostyle=style.css,man=%N.%S.html,includes=%I.html $< > $@ 305 1.1 joerg 306 1.1.1.5 joerg .1.1.ps .3.3.ps .7.7.ps: 307 1.1.1.8 joerg ./mandoc -Tps -Wall,error -fstrict $< > $@ 308 1.1.1.8 joerg 309 1.1.1.8 joerg .1.1.pdf .3.3.pdf .7.7.pdf: 310 1.1.1.8 joerg ./mandoc -Tpdf -Wall,error -fstrict $< > $@ 311 1.1.1.5 joerg 312 1.1 joerg .tar.gz.md5: 313 1.1 joerg md5 $< > $@ 314 1.1 joerg 315 1.1.1.3 joerg .h.h.html: 316 1.1.1.3 joerg highlight -I $< >$@ 317 1.1.1.3 joerg 318 1.1 joerg config.h: config.h.pre config.h.post 319 1.1 joerg rm -f config.log 320 1.1 joerg ( cat config.h.pre; \ 321 1.1 joerg echo; \ 322 1.1 joerg if $(CC) $(CFLAGS) -Werror -c test-strlcat.c >> config.log 2>&1; then \ 323 1.1 joerg echo '#define HAVE_STRLCAT'; \ 324 1.1 joerg rm test-strlcat.o; \ 325 1.1 joerg fi; \ 326 1.1 joerg if $(CC) $(CFLAGS) -Werror -c test-strlcpy.c >> config.log 2>&1; then \ 327 1.1 joerg echo '#define HAVE_STRLCPY'; \ 328 1.1 joerg rm test-strlcpy.o; \ 329 1.1 joerg fi; \ 330 1.1 joerg echo; \ 331 1.1 joerg cat config.h.post \ 332 1.1 joerg ) > $@ 333