]> git.cameronkatri.com Git - mandoc.git/blob - Makefile
*** empty log message ***
[mandoc.git] / Makefile
1 .SUFFIXES: .html .7
2
3 VERSION = 1.0.1
4
5 # FIXME
6 CFLAGS += -W -Wall -Wno-unused-parameter -g -DDEBUG
7
8 LINTFLAGS += -c -e -f -u
9
10 LNS = mdocml.ln html.ln xml.ln libmdocml.ln roff.ln ml.ln mlg.ln \
11 compat.ln tokens.ln literals.ln
12
13 LLNS = llib-lmdocml.ln
14
15 LIBS = libmdocml.a
16
17 OBJS = mdocml.o html.o xml.o libmdocml.o roff.o ml.o mlg.o \
18 compat.o tokens.o literals.o
19
20 SRCS = mdocml.c html.c xml.c libmdocml.c roff.c ml.c mlg.c \
21 compat.c tokens.c literals.c
22
23 HEADS = libmdocml.h private.h ml.h roff.h
24
25 MANS = mdocml.1 index.7
26
27 HTML = index.html mdocml.html
28
29 XML = index.xml
30
31 CLEAN = mdocml mdocml.tgz $(LLNS) $(LNS) $(OBJS) $(LIBS) $(HTML) \
32 $(XML)
33
34 INSTALL = Makefile $(HEADS) $(SRCS) $(MANS)
35
36 FAIL = test.0 test.1 test.2 test.3 test.4 test.5 test.6 \
37 test.15 test.20 test.22 test.24 test.26 test.27 test.30 \
38 test.36 test.37 test.40 test.50 test.61 test.64 test.65 \
39 test.66
40
41 SUCCEED = test.7 test.8 test.9 test.10 test.11 test.12 test.13 \
42 test.14 test.16 test.17 test.18 test.19 test.21 test.23 \
43 test.25 test.28 test.29 test.31 test.32 test.33 test.34 \
44 test.35 test.38 test.39 test.41 test.42 test.43 test.44 \
45 test.45 test.46 test.47 test.48 test.49 test.51 test.52 \
46 test.54 test.55 test.56 test.57 test.58 test.59 test.60 \
47 test.62 test.63 test.67
48
49 all: mdocml
50
51 lint: llib-lmdocml.ln
52
53 dist: mdocml.tgz
54
55 www: $(HTML) $(XML)
56
57 regress: mdocml
58 @for f in $(FAIL); do \
59 echo "./mdocml $$f" ; \
60 ./mdocml $$f 1>/dev/null 2>/dev/null || continue ; \
61 done
62 @for f in $(SUCCEED); do \
63 echo "./mdocml $$f" ; \
64 ./mdocml $$f 1>/dev/null || exit 1 ; \
65 done
66
67 mdocml: mdocml.o libmdocml.a
68 $(CC) $(CFLAGS) -o $@ mdocml.o libmdocml.a
69
70 clean:
71 rm -f $(CLEAN)
72
73 index.html: index.7 mdocml.css
74 ./mdocml -W -fhtml -e -o $@ index.7
75
76 index.xml: index.7 mdocml.css
77 ./mdocml -W -o $@ index.7
78
79 mdocml.html: mdocml.1 mdocml.css
80 ./mdocml -W -fhtml -e -o $@ mdocml.1
81
82 install-www: www dist
83 install -m 0644 mdocml.tgz $(PREFIX)/mdocml-$(VERSION).tgz
84 install -m 0644 mdocml.tgz $(PREFIX)/mdocml.tgz
85 install -m 0644 $(HTML) $(XML) $(PREFIX)/
86
87 mdocml.tgz: $(INSTALL)
88 mkdir -p .dist/mdocml/mdocml-$(VERSION)/
89 install -m 0644 $(INSTALL) .dist/mdocml/mdocml-$(VERSION)/
90 ( cd .dist/mdocml/ && tar zcf ../../mdocml.tgz mdocml-$(VERSION)/ )
91 rm -rf .dist/
92
93 llib-lmdocml.ln: mdocml.ln libmdocml.ln html.ln xml.ln roff.ln ml.ln mlg.ln compat.ln tokens.ln literals.ln
94 $(LINT) $(LINTFLAGS) -Cmdocml mdocml.ln libmdocml.ln html.ln xml.ln roff.ln ml.ln mlg.ln compat.ln tokens.ln literals.ln
95
96 mdocml.ln: mdocml.c libmdocml.h
97
98 mdocml.o: mdocml.c libmdocml.h
99
100 libmdocml.a: libmdocml.o html.o xml.o roff.o ml.o mlg.o compat.o tokens.o literals.o
101 $(AR) rs $@ libmdocml.o html.o xml.o roff.o ml.o mlg.o compat.o tokens.o literals.o
102
103 xml.ln: xml.c private.h libmdocml.h ml.h
104
105 xml.o: xml.c private.h libmdocml.h ml.h
106
107 html.ln: html.c private.h libmdocml.h
108
109 html.o: html.c private.h libmdocml.h
110
111 roff.ln: roff.c private.h roff.h libmdocml.h
112
113 roff.o: roff.c private.h roff.h libmdocml.h
114
115 libmdocml.ln: libmdocml.c private.h libmdocml.h
116
117 libmdocml.o: libmdocml.c private.h libmdocml.h
118
119 ml.ln: ml.c private.h libmdocml.h ml.h
120
121 ml.o: ml.c private.h libmdocml.h ml.h
122
123 mlg.ln: mlg.c private.h libmdocml.h ml.h
124
125 mlg.o: mlg.c private.h libmdocml.h ml.h
126
127 compat.ln: compat.c
128
129 compat.o: compat.c