Handle new manpage structure for master
[openssl-web.git] / Makefile
1 ##
2 ## Build procedure for www.openssl.org
3
4 ##  Checkouts.
5 CHECKOUTS = /var/cache/openssl/checkouts
6 ##  Snapshot directory
7 SNAP = $(CHECKOUTS)/openssl
8 ## Where releases are found.
9 RELEASEDIR = /var/www/openssl/source
10
11
12 # All simple generated files.
13 SIMPLE = newsflash.inc sitemap.txt \
14          docs/faq.inc docs/fips.inc \
15          news/changelog.inc news/changelog.txt \
16          news/cl101.txt news/cl102.txt news/cl110.txt \
17          news/openssl-1.0.1-notes.inc news/openssl-1.0.2-notes.inc \
18          news/openssl-1.1.0-notes.inc \
19          news/newsflash.inc \
20          news/vulnerabilities.inc \
21          source/.htaccess \
22          source/license.txt \
23          source/index.inc
24 SRCLISTS = \
25            source/old/0.9.x/index.inc \
26            source/old/1.0.0/index.inc \
27            source/old/1.0.1/index.inc \
28            source/old/1.0.2/index.inc \
29            source/old/1.1.0/index.inc \
30            source/old/fips/index.inc \
31
32 all: $(SIMPLE) $(SRCLISTS) manmaster
33
34 relupd: all manpages
35
36 define makemanpages
37         ./bin/mk-manpages $(1) $(2) docs
38         ./bin/mk-filelist -a docs/man$(2)/apps '' '*.html' >docs/man$(2)/apps/index.inc
39         ./bin/mk-filelist -a docs/man$(2)/crypto '' '*.html' >docs/man$(2)/crypto/index.inc
40         ./bin/mk-filelist -a docs/man$(2)/ssl '' '*.html' >docs/man$(2)/ssl/index.inc
41 endef
42 manpages: manmaster
43         $(call makemanpages,$(CHECKOUTS)/openssl-1.1.0-stable,1.1.0)
44         $(call makemanpages,$(CHECKOUTS)/openssl-1.0.2-stable,1.0.2)
45         $(call makemanpages,$(CHECKOUTS)/openssl-1.0.1-stable,1.0.1)
46
47 manmaster:
48         ./bin/mk-manpages $(CHECKOUTS)/openssl master docs
49         ./bin/mk-filelist -a docs/manmaster/man1 '' '*.html' >docs/manmaster/man1/index.inc
50         ./bin/mk-filelist -a docs/manmaster/man3 '' '*.html' >docs/manmaster/man3/index.inc
51         ./bin/mk-filelist -a docs/manmaster/man5 '' '*.html' >docs/manmaster/man5/index.inc
52         ./bin/mk-filelist -a docs/manmaster/man7 '' '*.html' >docs/manmaster/man7/index.inc
53
54 # Legacy targets
55 hack-source_htaccess: all
56 simple: all
57 generated: all
58 rebuild: all
59
60 clean:
61         rm -f $(SIMPLE) $(SRCLISTS)
62
63 newsflash.inc: news/newsflash.inc
64         @rm -f $@
65         head -7 $? >$@
66 sitemap.txt: bin/mk-sitemap
67         @rm -f $@
68         ./bin/mk-sitemap >$@
69
70 news/changelog.inc: news/changelog.txt bin/mk-changelog
71         @rm -f $@
72         ./bin/mk-changelog <news/changelog.txt >$@
73 news/changelog.txt: $(SNAP)/CHANGES
74         @rm -f $@
75         cp $? $@
76 news/cl101.txt: $(CHECKOUTS)/openssl-1.0.1-stable/CHANGES
77         @rm -f $@
78         cp $? $@
79 news/cl102.txt: $(CHECKOUTS)/openssl-1.0.2-stable/CHANGES
80         @rm -f $@
81         cp $? $@
82 news/cl110.txt: $(CHECKOUTS)/openssl-1.1.0-stable/CHANGES
83         @rm -f $@
84         cp $? $@
85
86 news/openssl-1.0.1-notes.html: news/openssl-notes.html.in
87         @rm -f $@
88         sed -e 's|@VERSION@|1.0.1|g' < $< > $@
89 news/openssl-1.0.2-notes.html: news/openssl-notes.html.in
90         @rm -f $@
91         sed -e 's|@VERSION@|1.0.2|g' < $< > $@
92 news/openssl-1.1.0-notes.html: news/openssl-notes.html.in
93         @rm -f $@
94         sed -e 's|@VERSION@|1.1.0|g' < $< > $@
95 news/openssl-1.0.1-notes.inc: $(CHECKOUTS)/openssl-1.0.1-stable/NEWS news/openssl-1.0.1-notes.html bin/mk-notes
96         @rm -f $@
97         ./bin/mk-notes 1.0.1 < $(CHECKOUTS)/openssl-1.0.1-stable/NEWS > $@
98 news/openssl-1.0.2-notes.inc: $(CHECKOUTS)/openssl-1.0.2-stable/NEWS news/openssl-1.0.2-notes.html bin/mk-notes
99         @rm -f $@
100         ./bin/mk-notes 1.0.2 < $(CHECKOUTS)/openssl-1.0.2-stable/NEWS > $@
101 news/openssl-1.1.0-notes.inc: $(CHECKOUTS)/openssl-1.1.0-stable/NEWS news/openssl-1.1.0-notes.html bin/mk-notes
102         @rm -f $@
103         ./bin/mk-notes 1.1.0 < $(CHECKOUTS)/openssl-1.1.0-stable/NEWS > $@
104
105 news/newsflash.inc: news/newsflash.txt
106         sed <$? >$@ \
107             -e '/^#/d' \
108             -e 's@^@<tr><td class="d">@' \
109             -e 's@: @</td><td class="t">@' \
110             -e 's@$$@</td></tr>@'
111 news/vulnerabilities.inc: bin/vulnerabilities.xsl news/vulnerabilities.xml
112         @rm -f $@
113         xsltproc bin/vulnerabilities.xsl news/vulnerabilities.xml >$@
114
115 docs/faq.inc: docs/faq.txt bin/mk-faq
116         @rm -f $@
117         ./bin/mk-faq <$? >$@
118 docs/fips.inc: $(wildcard docs/fips/*) bin/mk-filelist
119         @rm -f $@
120         ./bin/mk-filelist docs/fips fips/ '*' >$@
121
122 source/.htaccess: $(wildcard source/openssl-*.tar.gz) bin/mk-latest
123         @rm -f @?
124         ./bin/mk-latest source >$@
125 source/license.txt: $(SNAP)/LICENSE
126         @rm -f $@
127         cp $? $@
128 source/index.inc: $(wildcard $(RELEASEDIR)/openssl-*.tar.gz) bin/mk-filelist
129         @rm -f $@
130         ./bin/mk-filelist $(RELEASEDIR) '' 'openssl-*.tar.gz' >$@
131
132 source/old/0.9.x/index.inc: $(wildcard source/old/0.9.x/*.gz) bin/mk-filelist
133         @rm -f $@
134         ./bin/mk-filelist source/old/0.9.x '' '*.gz' >$@
135 source/old/1.0.0/index.inc: $(wildcard source/old/1.0.0/*.gz) bin/mk-filelist
136         @rm -f $@
137         ./bin/mk-filelist source/old/1.0.0 '' '*.gz' >$@
138 source/old/1.0.1/index.inc: $(wildcard source/old/1.0.1/*.gz) bin/mk-filelist
139         @rm -f $@
140         ./bin/mk-filelist source/old/1.0.1 '' '*.gz' >$@
141 source/old/1.0.2/index.inc: $(wildcard source/old/1.0.2/*.gz) bin/mk-filelist
142         @rm -f $@
143         ./bin/mk-filelist source/old/1.0.2 '' '*.gz' >$@
144 source/old/1.1.0/index.inc: $(wildcard source/old/1.1.0/*.gz) bin/mk-filelist
145         @rm -f $@
146         ./bin/mk-filelist source/old/1.1.0 '' '*.gz' >$@
147 source/old/fips/index.inc: $(wildcard source/old/fips/*.gz) bin/mk-filelist
148         @rm -f $@
149         ./bin/mk-filelist source/old/fips '' '*.gz' >$@
150
151 # Because these the indexes of old tarballs will inevitably be newer
152 # than the tarballs that are moved into their respective directory,
153 # we must declare them phony, or they will not be regenerated when
154 # they should.
155 .PHONY : \
156          source/old/1.0.1/index.inc source/old/1.0.2/index.inc \
157          source/old/1.1.0/index.inc source/old/fips/index.inc