-
Notifications
You must be signed in to change notification settings - Fork 231
/
Copy pathMakefile
83 lines (67 loc) · 1.89 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# asciidoc 8.4.3 and 8.5.2 are known to work. asciidoc 8.2.5 and 8.2.6 are known not to work.
ASCIIDOC=asciidoc
GENERATED_METAFILES= \
TOC.html
GENERATED_CHAPTERS= \
00_about.html \
01_intro.html \
Ref0_meta.html \
Ref1_libsetup.html \
Ref2_eventbase.html \
Ref3_eventloop.html \
Ref4_event.html \
Ref5_evutil.html \
Ref6_bufferevent.html \
Ref6a_advanced_bufferevents.html \
Ref7_evbuffer.html \
Ref8_listener.html \
Ref9_dns.html \
Ref10_http_server.html \
license_bsd.html
GENERATED_HTML = $(GENERATED_METAFILES) $(GENERATED_CHAPTERS)
all: html examples
# Note that this won't give you good results unless you have a very
# recent asciidoc. Asciidoc 8.5.3 is recommended.
pdf: LibeventBook.pdf
LibeventBook.pdf: *.txt examples*/*.c
a2x -f pdf LibeventBook.txt --no-xmllint
html: $(GENERATED_HTML)
check: examples inline_examples
examples:
cd examples_01 && $(MAKE)
cd examples_R6 && $(MAKE)
cd examples_R6a && $(MAKE)
cd examples_R8 && $(MAKE)
cd examples_R9 && $(MAKE)
cd examples_R10 && $(MAKE)
inline_examples:
./bin/build_examples.py *_*.txt
.SUFFIXES: .txt .html
.txt.html:
cp docinfo.html $(basename $<)-docinfo.html
$(ASCIIDOC) $<
rm $(basename $<)-docinfo.html
00_about.html: license.txt
01_intro.html: examples_01/*.c license.txt
Ref1_meta.html: license.txt
Ref1_libsetup.html: license.txt
Ref2_eventbase.html: license.txt
Ref3_eventloop.html: license.txt
Ref4_event.html: license.txt
Ref5_evutil.html: license.txt
Ref6_bufferevent.html: examples_R6/*.c license.txt
Ref6a_advanced_bufferevent.html: examples_R6a/*.c license.txt
Ref7_evbuffer.html: license.txt
Ref8_listener.html: examples_R8/*.c license.txt
Ref9_dns.html: examples_R9/*.c license.txt
Ref10_http_server.html: examples_R10/*.c license.txt
clean:
rm -f *~
rm -f *.o
rm -f $(GENERATED_HTML)
cd examples_01 && $(MAKE) clean
cd examples_R8 && $(MAKE) clean
rm -rf tmpcode_*
count:
wc -w *.txt
wc -l examples_*/*.c