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