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