]> git.cameronkatri.com Git - mandoc.git/blob - Makefile
Added (prelim.) openbsd port.
[mandoc.git] / Makefile
1 VERSION = 1.0.3
2
3 # FIXME
4 CFLAGS += -W -Wall -Wno-unused-parameter -g -DDEBUG
5
6 LNS = mdocml.ln html.ln xml.ln libmdocml.ln roff.ln ml.ln mlg.ln \
7 compat.ln tokens.ln literals.ln tags.ln noop.ln
8
9 LLNS = llib-lmdocml.ln
10
11 LIBS = libmdocml.a
12
13 OBJS = mdocml.o html.o xml.o libmdocml.o roff.o ml.o mlg.o \
14 compat.o tokens.o literals.o tags.o noop.o
15
16 SRCS = mdocml.c html.c xml.c libmdocml.c roff.c ml.c mlg.c \
17 compat.c tokens.c literals.c tags.c noop.c
18
19 HEADS = libmdocml.h private.h ml.h roff.h html.h
20
21 MANS = mdocml.1 index.7
22
23 HTML = index.html mdocml.html
24
25 XML = index.xml
26
27 TEXT = index.txt
28
29 CLEAN = mdocml mdocml.tgz $(LLNS) $(LNS) $(OBJS) $(LIBS) $(HTML) \
30 $(XML) $(TEXT)
31
32 INSTALL = Makefile $(HEADS) $(SRCS) $(MANS)
33
34 FAIL = test.0 test.1 test.2 test.3 test.4 test.5 test.6 \
35 test.15 test.20 test.22 test.24 test.26 test.27 test.30 \
36 test.36 test.37 test.40 test.50 test.61 test.64 test.65 \
37 test.66 test.69 test.70
38
39 SUCCEED = test.7 test.8 test.9 test.10 test.11 test.12 test.13 \
40 test.14 test.16 test.17 test.18 test.19 test.21 test.23 \
41 test.25 test.28 test.29 test.31 test.32 test.33 test.34 \
42 test.35 test.38 test.39 test.41 test.42 test.43 test.44 \
43 test.45 test.46 test.47 test.48 test.49 test.51 test.52 \
44 test.54 test.55 test.56 test.57 test.58 test.59 test.60 \
45 test.62 test.63 test.67 test.68 test.71 test.72 test.73
46
47 all: mdocml
48
49 lint: llib-lmdocml.ln
50
51 dist: mdocml.tgz mdocml-port.tgz
52
53 www: all $(HTML) $(XML) $(TEXT)
54
55 regress: mdocml
56 @for f in $(FAIL); do \
57 echo "./mdocml $$f" ; \
58 ./mdocml -v $$f 1>/dev/null 2>/dev/null || continue ; \
59 done
60 @for f in $(SUCCEED); do \
61 echo "./mdocml $$f" ; \
62 ./mdocml -v $$f 1>/dev/null || exit 1 ; \
63 done
64
65 mdocml: mdocml.o libmdocml.a
66 $(CC) $(CFLAGS) -o $@ mdocml.o libmdocml.a
67
68 clean:
69 rm -f $(CLEAN)
70
71 index.html: index.7 mdocml.css
72 ./mdocml -Wall -fhtml -e -o $@ index.7
73
74 index.xml: index.7 mdocml.css
75 ./mdocml -Wall -o $@ index.7
76
77 index.txt: index.7
78 cp -f index.7 index.txt
79
80 mdocml.html: mdocml.1 mdocml.css
81 ./mdocml -Wall -fhtml -e -o $@ mdocml.1
82
83 install-www: www dist
84 install -m 0644 mdocml.tgz $(PREFIX)/mdocml-$(VERSION).tgz
85 install -m 0644 mdocml.tgz $(PREFIX)/mdocml.tgz
86 install -m 0644 mdocml-port.tgz $(PREFIX)/mdocml-port-$(VERSION).tgz
87 install -m 0644 mdocml-port.tgz $(PREFIX)/mdocml-port.tgz
88 install -m 0644 $(HTML) $(XML) $(TEXT) $(PREFIX)/
89
90 mdocml.tgz: $(INSTALL)
91 mkdir -p .dist/mdocml/mdocml-$(VERSION)/
92 install -m 0644 $(INSTALL) .dist/mdocml/mdocml-$(VERSION)/
93 ( cd .dist/mdocml/ && tar zcf ../../$@ mdocml-$(VERSION)/ )
94 rm -rf .dist/
95
96 mdocml-port.tgz: $(INSTALL)
97 mkdir -p .dist/mdocml/pkg
98 sed -e "s!@VERSION@!$(VERSION)!" Makefile.port > .dist/mdocml/Makefile
99 md5 mdocml-$(VERSION).tgz > .dist/mdocml/distinfo
100 rmd160 mdocml-$(VERSION).tgz >> .dist/mdocml/distinfo
101 sha1 mdocml-$(VERSION).tgz >> .dist/mdocml/distinfo
102 install -m 0644 DESCR .dist/mdocml/pkg/DESCR
103 echo @comment $$OpenBSD$$ > .dist/mdocml/pkg/PLIST
104 echo bin/mdocml >> .dist/mdocml/pkg/PLIST
105 echo @man man/man1/mdocml.1 >> .dist/mdocml/pkg/PLIST
106 ( cd .dist/ && tar zcf ../$@ mdocml/ )
107 rm -rf .dist/
108
109 llib-lmdocml.ln: mdocml.ln libmdocml.ln html.ln xml.ln roff.ln ml.ln mlg.ln compat.ln tokens.ln literals.ln tags.ln noop.ln
110 $(LINT) $(LINTFLAGS) -Cmdocml mdocml.ln libmdocml.ln html.ln xml.ln roff.ln ml.ln mlg.ln compat.ln tokens.ln literals.ln tags.ln noop.ln
111
112 mdocml.ln: mdocml.c libmdocml.h
113
114 mdocml.o: mdocml.c libmdocml.h
115
116 libmdocml.a: libmdocml.o html.o xml.o roff.o ml.o mlg.o compat.o tokens.o literals.o tags.o noop.o
117 $(AR) rs $@ libmdocml.o html.o xml.o roff.o ml.o mlg.o compat.o tokens.o literals.o tags.o noop.o
118
119 xml.ln: xml.c ml.h
120
121 xml.o: xml.c ml.h
122
123 html.ln: html.c private.h
124
125 html.o: html.c private.h
126
127 tags.ln: tags.c html.h
128
129 tags.o: tags.c html.h
130
131 roff.ln: roff.c private.h
132
133 roff.o: roff.c private.h
134
135 libmdocml.ln: libmdocml.c private.h
136
137 libmdocml.o: libmdocml.c private.h
138
139 ml.ln: ml.c ml.h
140
141 ml.o: ml.c ml.h
142
143 mlg.ln: mlg.c ml.h
144
145 mlg.o: mlg.c ml.h
146
147 compat.ln: compat.c
148
149 compat.o: compat.c
150
151 noop.ln: noop.c private.h
152
153 noop.o: noop.c private.h
154
155 html.h: ml.h
156
157 ml.h: private.h
158
159 private.h: libmdocml.h
160