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
12 SERIES=1.1.1 1.1.0 1.0.2
14 OLDSERIES=1.0.1 1.0.0 0.9.8 0.9.7 0.9.6
15 OLDSERIES2=1.0.1 1.0.0 0.9.x
16 ## Current series with newer and older manpage layout
17 ## (when the number of old man layout releases drop to none, this goes away)
19 OLDMANSERIES=1.1.0 1.0.2
21 # All simple generated files.
22 SIMPLE = newsflash.inc sitemap.txt \
23 community/committers.inc \
24 community/omc.inc community/omc-alumni.inc \
25 docs/faq.inc docs/fips.inc \
26 docs/OpenSSLStrategicArchitecture.html \
27 docs/OpenSSL300Design.html \
30 $(foreach S,$(SERIES),news/openssl-$(S)-notes.inc) \
31 $(foreach S,$(SERIES),news/openssl-$(S)-notes.html) \
33 news/vulnerabilities.inc \
34 news/vulnerabilities.html \
35 $(foreach S,$(SERIES) $(OLDSERIES),news/vulnerabilities-$(S).inc) \
36 $(foreach S,$(SERIES) $(OLDSERIES),news/vulnerabilities-$(S).html) \
40 SRCLISTS = $(foreach S,$(SERIES) $(OLDSERIES2) fips,source/old/$(S)/index.inc source/old/$(S)/index.html)
49 all: suball manmaster mancross
51 suball: $(SIMPLE) $(SRCLISTS)
53 relupd: suball manpages mancross
56 rm -f $(SIMPLE) $(SRCLISTS)
59 hack-source_htaccess: all
64 # $(1) = input directory in CHECKOUTS, $(2) = release version
68 @mkdir -p docs/man$(2) \
73 ./bin/mk-manpages $(CHECKOUTS)/$(1)/doc $(2) docs/man$(2)
74 ./bin/mk-apropos docs/man$(2)/man1 > docs/man$(2)/man1/index.inc
75 ./bin/mk-apropos docs/man$(2)/man3 > docs/man$(2)/man3/index.inc
76 ./bin/mk-apropos docs/man$(2)/man5 > docs/man$(2)/man5/index.inc
77 ./bin/mk-apropos docs/man$(2)/man7 > docs/man$(2)/man7/index.inc
78 ./bin/from-tt -d docs/man$(2)/man1 releases='$(SERIES)' release='$(2)' \
79 < docs/sub-man1-index.html.tt > docs/man$(2)/man1/index.html
80 ./bin/from-tt -d docs/man$(2)/man1 releases='$(SERIES)' release='$(2)' \
81 < docs/sub-man3-index.html.tt > docs/man$(2)/man3/index.html
82 ./bin/from-tt -d docs/man$(2)/man1 releases='$(SERIES)' release='$(2)' \
83 < docs/sub-man5-index.html.tt > docs/man$(2)/man5/index.html
84 ./bin/from-tt -d docs/man$(2)/man1 releases='$(SERIES)' release='$(2)' \
85 < docs/sub-man7-index.html.tt > docs/man$(2)/man7/index.html
86 ./bin/from-tt -d docs/man$(2) releases='$(SERIES)' release='$(2)' \
87 < docs/sub-index.html.tt > docs/man$(2)/index.html
89 # $(1) = release version
92 ./bin/mk-manmap docs/man$(1) > docs/man$(1)/.htaccess
95 $(eval $(call makemanpages,openssl,master))
96 $(foreach S,$(SERIES),$(eval $(call makemanpages,openssl-$(S)-stable,$(S))))
97 $(foreach S,$(OLDMANSERIES),$(eval $(call makeoldmanmap,$(S))))
99 manmaster: manpages-master
100 manpages: $(foreach S,$(NEWMANSERIES),manpages-$(S)) \
101 $(foreach S,$(OLDMANSERIES),manpages-$(S) manmap-$(S))
104 ./bin/mk-mancross master $(SERIES)
106 docs/manpages.html: docs/manpages.html.tt
108 ./bin/from-tt releases='master $(SERIES)' docs/manpages.html.tt
110 ## $(SIMPLE) -- SIMPLE GENERATED FILES
111 .PHONY: sitemap community/committers.inc community/omc.inc community/omc-alumni.inc
112 newsflash.inc: news/newsflash.inc
117 ./bin/mk-sitemap master $(SERIES) > sitemap.txt
119 community/committers.inc:
121 wget -q https://api.openssl.org/0/Group/commit/Members
122 ./bin/mk-committers <Members >$@
126 ./bin/mk-omc -n -e -l -p -t 'OMC Members' omc omc-inactive > $@
127 community/omc-alumni.inc:
128 ./bin/mk-omc -n -l -t 'OMC Alumni' omc-alumni omc-emeritus > $@
130 docs/faq.inc: $(wildcard docs/faq-[0-9]-*.txt) bin/mk-faq
132 ./bin/mk-faq docs/faq-[0-9]-*txt >$@
133 docs/fips.inc: $(wildcard docs/fips/*) bin/mk-filelist
135 ./bin/mk-filelist docs/fips fips/ '*' >$@
137 news/changelog.inc: news/changelog.txt bin/mk-changelog
139 ./bin/mk-changelog <news/changelog.txt >$@
140 news/changelog.html: news/changelog.html.tt news/changelog.inc
142 ./bin/from-tt 'releases=$(SERIES)' $<
143 news/changelog.html: $(foreach S,$(SERIES),news/cl$(subst .,,$(S)).txt)
145 # $(1) = output file, $(2) = source directory in CHECKOUTS
146 define mknews_changelogtxt
147 news/$(1): $(CHECKOUTS)/$(2)/CHANGES
151 $(eval $(call mknews_changelogtxt,changelog.txt,openssl))
152 $(foreach S,$(SERIES),\
153 $(eval $(call mknews_changelogtxt,cl$(subst .,,$(S)).txt,openssl-$(S)-stable)))
155 # $(1) = release version
156 define mknews_noteshtml
157 news/openssl-$(1)-notes.html: news/openssl-notes.html.in
159 sed -e 's|@VERSION@|$(1)|g' < $$< > $$@
160 news/openssl-$(1)-notes.inc: $(CHECKOUTS)/openssl-$(1)-stable/NEWS bin/mk-notes
162 ./bin/mk-notes $(1) < $(CHECKOUTS)/openssl-$(1)-stable/NEWS > $$@
164 $(foreach S,$(SERIES),$(eval $(call mknews_noteshtml,$(S))))
166 news/newsflash.inc: news/newsflash.txt
169 -e 's@^@<tr><td class="d">@' \
170 -e 's@: @</td><td class="t">@' \
171 -e 's@$$@</td></tr>@'
173 # $(1) = output file mod, $(2) = release version switch, $(3) = release version
174 define mknews_vulnerability
175 news/vulnerabilities$(1).inc: bin/mk-cvepage news/vulnerabilities.xml
177 ./bin/mk-cvepage -i news/vulnerabilities.xml $(2) > $$@
178 news/vulnerabilities$(1).html: news/vulnerabilities.html.tt bin/from-tt
180 ./bin/from-tt -d news vulnerabilitiesinc='vulnerabilities$(1).inc' < $$< > $$@
182 $(eval $(call mknews_vulnerability,,))
183 $(foreach S,$(SERIES) $(OLDSERIES),$(eval $(call mknews_vulnerability,-$(S),-b $(S))))
185 source/.htaccess: $(wildcard source/openssl-*.tar.gz) bin/mk-latest
187 ./bin/mk-latest source >$@
188 source/index.inc: $(wildcard $(RELEASEDIR)/openssl-*.tar.gz) bin/mk-filelist
190 ./bin/mk-filelist $(RELEASEDIR) '' 'openssl-*.tar.gz' >$@
192 ## $(SRCLISTS) -- LISTS OF SOURCES
193 # $(1) = release, $(2) = release title
194 define mkoldsourceindex
195 source/old/$(1)/index.inc: $(wildcard $(RELEASEDIR)/old/$(1)/*.gz) bin/mk-filelist
197 ./bin/mk-filelist $(RELEASEDIR)/old/$(1) '' '*.gz' > $$@
198 source/old/$(1)/index.html: source/old/sub-index.html.tt bin/from-tt
200 ./bin/from-tt -d source/old/$(1) \
201 release='$(1)' releasetitle='Old $(2) Releases' \
204 $(foreach S,fips $(SERIES) $(OLDSERIES2),$(eval $(call mkoldsourceindex,$(S),$(patsubst fips,FIPS,$(S)))))
205 source/old/index.html: source/old/index.html.tt bin/from-tt
207 ./bin/from-tt releases='fips $(SERIES) $(OLDSERIES2)' $<
209 # Because these the indexes of old tarballs will inevitably be newer
210 # than the tarballs that are moved into their respective directory,
211 # we must declare them phony, or they will not be regenerated when