2 ## Build procedure for www.openssl.org
5 CHECKOUTS = /var/cache/openssl/checkouts
7 SNAP = $(CHECKOUTS)/openssl
8 ## Where releases are found.
9 RELEASEDIR = /var/www/openssl/source
11 ######################################################################
13 ## Release series. These represent our release branches, and are
14 ## our foundation for what should be built and how (often generated)
16 ## The numbers given here RULE
21 ## Older series. The second type is for source listings
22 OLDSERIES=1.1.0 1.0.2 1.0.1 1.0.0 0.9.8 0.9.7 0.9.6
23 OLDSERIES2=1.1.0 1.0.2 1.0.1 1.0.0 0.9.x
24 ## Series for manual layouts
28 # All simple generated files.
29 SIMPLE = newsflash.inc sitemap.txt \
30 docs/faq.inc docs/fips.inc \
31 docs/OpenSSLStrategicArchitecture.html \
32 docs/OpenSSL300Design.html \
35 $(foreach S,$(SERIES),news/openssl-$(S)-notes.inc) \
36 $(foreach S,$(SERIES),news/openssl-$(S)-notes.html) \
38 news/vulnerabilities.inc \
39 news/vulnerabilities.html \
40 $(foreach S,$(SERIES) $(OLDSERIES),news/vulnerabilities-$(S).inc) \
41 $(foreach S,$(SERIES) $(OLDSERIES),news/vulnerabilities-$(S).html) \
45 SRCLISTS = $(foreach S,$(SERIES) $(OLDSERIES2) fips,source/old/$(S)/index.inc source/old/$(S)/index.html)
54 all: suball manmaster mancross
56 suball: $(SIMPLE) $(SRCLISTS)
58 relupd: suball manpages mancross
61 rm -f $(SIMPLE) $(SRCLISTS)
64 hack-source_htaccess: all
69 ######################################################################
71 ## Man-page building section
73 ## This is quite a complex set of rules, because there are many
74 ## things that need to be built:
76 ## - The man-pages themselves
77 ## - Apropos-like listings
78 ## - Cross-references between man-pages in different OpenSSL
81 ## A lot of the work is made with generated rules.
83 # makemanpages1 and makemanpages3 creates rules for targets like man-pages-1.1.1,
84 # to build the set of man-pages. makemanpages1 is used for pre-3.0 OpenSSL,
85 # while makemanpages3 is used for OpenSSL 3.0 and on.
86 # makemanapropos creates rules for targets like man-apropos-1.1.1, to build
87 # 'apropos' like indexes for all the manpages.
88 # makemanindexes creates rules for targets like man-index-1.1.1, to build the
89 # main HTML index for a set of man-pages.
91 # $(1) = input directory in CHECKOUTS, $(2) = release version
93 # This variant is for pre-3.0 documentation
97 @mkdir -p docs/man$(2) \
102 ./bin/mk-manpages $(CHECKOUTS)/$(1)/doc $(2) docs/man$(2)
104 # This variant is for 3.0 documentation
108 @mkdir -p docs/man$(2) \
113 ./bin/mk-manpages3 $(CHECKOUTS)/$(1) $(2) docs/man$(2)
115 define makemanapropos
116 man-apropos-$(2): man-pages-$(2)
117 ./bin/mk-apropos docs/man$(2)/man1 > docs/man$(2)/man1/index.inc
118 ./bin/mk-apropos docs/man$(2)/man3 > docs/man$(2)/man3/index.inc
119 ./bin/mk-apropos docs/man$(2)/man5 > docs/man$(2)/man5/index.inc
120 ./bin/mk-apropos docs/man$(2)/man7 > docs/man$(2)/man7/index.inc
122 define makemanindexes
124 ./bin/from-tt -d docs/man$(2)/man1 releases='$(SERIES)' release='$(2)' \
125 < docs/sub-man1-index.html.tt > docs/man$(2)/man1/index.html
126 ./bin/from-tt -d docs/man$(2)/man3 releases='$(SERIES)' release='$(2)' \
127 < docs/sub-man3-index.html.tt > docs/man$(2)/man3/index.html
128 ./bin/from-tt -d docs/man$(2)/man5 releases='$(SERIES)' release='$(2)' \
129 < docs/sub-man5-index.html.tt > docs/man$(2)/man5/index.html
130 ./bin/from-tt -d docs/man$(2)/man7 releases='$(SERIES)' release='$(2)' \
131 < docs/sub-man7-index.html.tt > docs/man$(2)/man7/index.html
132 ./bin/from-tt -d docs/man$(2) releases='$(SERIES)' release='$(2)' \
133 < docs/sub-index.html.tt > docs/man$(2)/index.html
136 $(eval $(call makemanpages1,$(1),$(2)))
137 $(eval $(call makemanapropos,$(1),$(2)))
138 $(eval $(call makemanindexes,$(1),$(2)))
141 $(eval $(call makemanpages3,$(1),$(2)))
142 $(eval $(call makemanapropos,$(1),$(2)))
143 $(eval $(call makemanindexes,$(1),$(2)))
146 # Now that we have the generating macros in place, let's use them!
148 # Start off with creating the 'manpages-master' target, taking the
149 # source from $(CHECKOUTS)/openssl/doc
150 $(eval $(call makemanuals3,openssl,master))
151 #$(foreach S,$(MANSERIES3),$(eval $(call makemanuals3,openssl-$(S),$(S))))
153 # Next, create 'manpages-x.y.z' for all current releases, taking the
154 # source from $(CHECKOUTS)/openssl-x.y.z-stable/doc
155 $(foreach S,$(MANSERIES1),$(eval $(call makemanuals1,openssl-$(S)-stable,$(S))))
157 manmaster: man-apropos-master man-index-master
158 manpages: $(foreach S,$(MANSERIES1),man-apropos-$(S) man-index-$(S))
161 ./bin/mk-mancross master $(SERIES)
163 docs/manpages.html: docs/manpages.html.tt
165 ./bin/from-tt releases='master $(SERIES)' docs/manpages.html.tt
167 ######################################################################
169 ## $(SIMPLE) -- SIMPLE GENERATED FILES
171 .PHONY: sitemap community/committers.inc community/otc.inc community/omc.inc community/omc-alumni.inc
172 newsflash.inc: news/newsflash.inc
177 ./bin/mk-sitemap master $(SERIES) > sitemap.txt
179 community/committers.inc:
181 wget -q https://api.openssl.org/0/Group/commit/Members
182 ./bin/mk-committers <Members >$@
186 ./bin/mk-omc -n -t 'OTC Members' otc otc-inactive > $@
188 ./bin/mk-omc -n -e -l -p -t 'OMC Members' omc omc-inactive > $@
189 community/omc-alumni.inc:
190 ./bin/mk-omc -n -l -t 'OMC Alumni' omc-alumni omc-emeritus > $@
192 docs/faq.inc: $(wildcard docs/faq-[0-9]-*.txt) bin/mk-faq
194 ./bin/mk-faq docs/faq-[0-9]-*txt >$@
195 docs/fips.inc: $(wildcard docs/fips/*) bin/mk-filelist
197 ./bin/mk-filelist docs/fips fips/ '*' >$@
199 news/changelog.inc: news/changelog.md bin/mk-changelog
201 (echo 'Table of contents'; sed -e '1,/^OpenSSL Releases$$/d' < $<) \
202 | pandoc -t html5 -f commonmark | ./bin/post-process-html5 >$@
203 news/changelog.html: news/changelog.html.tt news/changelog.inc
205 ./bin/from-tt 'releases=$(SERIES)' $<
206 # Additionally, make news/changelog.html depend on clxyz.txt, where xyz
207 # comes from the release number x.y.z. This permits it to be automatically
208 # recreated whenever there's a new major release.
209 news/changelog.html: $(foreach S,$(SERIES),news/cl$(subst .,,$(S)).txt)
211 # mknews_changelogtxt creates a target and ruleset for any changelog text
212 # file depending on the CHANGES file from the target release.
214 # $(1) = output file, $(2) = CHANGES files, relative to CHECKOUTS
215 define mknews_changelogtxt
216 news/$(1): $(CHECKOUTS)/$(2)
221 # Create the target 'news/changelog.txt', taking the source from
222 # $(CHECKOUTS)/openssl/CHANGES.md
223 $(eval $(call mknews_changelogtxt,changelog.md,openssl/CHANGES.md))
225 # Create the targets 'news/clxyz.txt' for all current releases, taking the
226 # source from $(CHECKOUTS)/openssl-x.y.z-stable/CHANGES
227 $(foreach S,$(SERIES),\
228 $(eval $(call mknews_changelogtxt,cl$(subst .,,$(S)).txt,openssl-$(S)-stable/CHANGES)))
230 # mknews_noteshtml creates two targets and rulesets for creating notes from
231 # the NEWS file for each release. One target is to create a wrapping HTML
232 # file from a template, the other is to create the inclusion file with the
235 # $(1) = release version, $(2) = NEWS file, relative to CHECKOUTS
236 define mknews_noteshtml
237 news/openssl-$(1)-notes.html: news/openssl-notes.html.tt
239 ./bin/from-tt -d news -i $$< -o $$@ release='$(1)'
240 news/openssl-$(1)-notes.inc: $(CHECKOUTS)/$(2) bin/mk-notes
242 ./bin/mk-notes $(1) < $(CHECKOUTS)/$(2) > $$@
245 # Create the targets 'news/openssl-x.y.z-notes.html' and
246 # 'news/openssl-x.y.z-notes.inc' for each release number x.y.z, taking
247 # the source from the news file given as second argument.
248 $(foreach S,$(SERIES),\
249 $(eval $(call mknews_noteshtml,$(S),openssl-$(S)-stable/NEWS)))
251 news/newsflash.inc: news/newsflash.txt
254 -e 's@^@<tr><td class="d">@' \
255 -e 's@: @</td><td class="t">@' \
256 -e 's@$$@</td></tr>@'
258 # mknews_vulnerability creates two targets and rulesets for creating
259 # vulnerability lists for each release. One target is to create a wrapping
260 # HTML file from a template, the other is to create the inclusion file with
263 # $(1) = output file mod, $(2) = release version switch, $(3) = release version
264 define mknews_vulnerability
265 news/vulnerabilities$(1).inc: bin/mk-cvepage news/vulnerabilities.xml
267 ./bin/mk-cvepage -i news/vulnerabilities.xml $(2) > $$@
268 news/vulnerabilities$(1).html: news/vulnerabilities.html.tt bin/from-tt
270 ./bin/from-tt -d news vulnerabilitiesinc='vulnerabilities$(1).inc' < $$< > $$@
273 # Create the main vulnerability index 'news/vulnerabilities.html' and
274 # 'news/vulnerabilities.inc'
275 $(eval $(call mknews_vulnerability,,))
277 # Create the vulnerability index 'news/vulnerabilities-x.y.z.html' and
278 # 'news/vulnerabilities-x.y.z.inc' for each release x.y.z
279 $(foreach S,$(SERIES) $(OLDSERIES),$(eval $(call mknews_vulnerability,-$(S),-b $(S))))
281 source/.htaccess: $(wildcard source/openssl-*.tar.gz) bin/mk-latest
283 ./bin/mk-latest source >$@
284 source/index.inc: $(wildcard $(RELEASEDIR)/openssl-*.tar.gz) bin/mk-filelist
286 ./bin/mk-filelist $(RELEASEDIR) '' 'openssl-*.tar.gz' >$@
288 ######################################################################
290 ## $(SRCLISTS) -- LISTS OF SOURCES
293 # mkoldsourceindex creates two targets and rulesets for creating the
294 # list of update tarballs for each release. One target is to create a
295 # wrapping HTML file from a template, the other is to create the
296 # inclusion file with the actual text.
298 # $(1) = release, $(2) = release title
299 define mkoldsourceindex
300 source/old/$(1)/index.inc: $(wildcard $(RELEASEDIR)/old/$(1)/*.gz) bin/mk-filelist
302 ./bin/mk-filelist $(RELEASEDIR)/old/$(1) '' '*.gz' > $$@
303 source/old/$(1)/index.html: source/old/sub-index.html.tt bin/from-tt
305 ./bin/from-tt -d source/old/$(1) \
306 release='$(1)' releasetitle='Old $(2) Releases' \
310 # Create the update tarball index 'source/old/x.y.z/index.html' and
311 # 'source/old/x.y.z/index.inc' for each release x.y.z.
312 # We also create a list specifically for the old FIPS module, carefully
313 # crafting an HTML title with an uppercase 'FIPS' while the subdirectory
314 # remains named 'fips'
315 $(foreach S,fips $(SERIES) $(OLDSERIES2),$(eval $(call mkoldsourceindex,$(S),$(patsubst fips,FIPS,$(S)))))
317 source/old/index.html: source/old/index.html.tt bin/from-tt
319 ./bin/from-tt releases='fips $(SERIES) $(OLDSERIES2)' $<
321 # Because these the indexes of old tarballs will inevitably be newer
322 # than the tarballs that are moved into their respective directory,
323 # we must declare them phony, or they will not be regenerated when