Reduce relupd to what it's actually needed for
[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/cl098.txt news/cl100.txt news/cl101.txt news/cl102.txt \
17          news/openssl-0.9.8-notes.inc news/openssl-1.0.0-notes.inc \
18          news/openssl-1.0.1-notes.inc 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/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.0.2-stable,1.0.2)
44         $(call makemanpages,$(CHECKOUTS)/openssl-1.0.1-stable,1.0.1)
45         $(call makemanpages,$(CHECKOUTS)/openssl-1.0.0-stable,1.0.0)
46         $(call makemanpages,$(CHECKOUTS)/openssl-0.9.8-stable,0.9.8)
47
48 manmaster:
49         $(call makemanpages,$(CHECKOUTS)/openssl,master)
50
51 # Legacy targets
52 hack-source_htaccess: all
53 simple: all
54 generated: all
55 rebuild: all
56
57 clean:
58         rm -f $(SIMPLE) $(SRCLISTS)
59
60 newsflash.inc: news/newsflash.inc
61         @rm -f $@
62         head -6 $? >$@
63 sitemap.txt:
64         @rm -f $@
65         ./bin/mk-sitemap >$@
66
67 news/changelog.inc: news/changelog.txt bin/mk-changelog
68         @rm -f $@
69         ./bin/mk-changelog <news/changelog.txt >$@
70 news/changelog.txt: $(SNAP)/CHANGES
71         @rm -f $@
72         cp $? $@
73 news/cl098.txt: $(CHECKOUTS)/openssl-0.9.8-stable/CHANGES
74         @rm -f $@
75         cp $? $@
76 news/cl100.txt: $(CHECKOUTS)/openssl-1.0.0-stable/CHANGES
77         @rm -f $@
78         cp $? $@
79 news/cl101.txt: $(CHECKOUTS)/openssl-1.0.1-stable/CHANGES
80         @rm -f $@
81         cp $? $@
82 news/cl102.txt: $(CHECKOUTS)/openssl-1.0.2-stable/CHANGES
83         @rm -f $@
84         cp $? $@
85
86 news/openssl-0.9.8-notes.html: news/openssl-notes.html.in
87         @rm -f $@
88         sed -e 's|@VERSION@|0.9.8|g' < $< > $@
89 news/openssl-1.0.0-notes.html: news/openssl-notes.html.in
90         @rm -f $@
91         sed -e 's|@VERSION@|1.0.0|g' < $< > $@
92 news/openssl-1.0.1-notes.html: news/openssl-notes.html.in
93         @rm -f $@
94         sed -e 's|@VERSION@|1.0.1|g' < $< > $@
95 news/openssl-1.0.2-notes.html: news/openssl-notes.html.in
96         @rm -f $@
97         sed -e 's|@VERSION@|1.0.2|g' < $< > $@
98 news/openssl-1.1.0-notes.html: news/openssl-notes.html.in
99         @rm -f $@
100         sed -e 's|@VERSION@|1.1.0|g' < $< > $@
101 news/openssl-0.9.8-notes.inc: $(CHECKOUTS)/openssl-0.9.8-stable/NEWS news/openssl-0.9.8-notes.html
102         @rm -f $@
103         ./bin/mk-notes 0.9.8 < $(CHECKOUTS)/openssl-0.9.8-stable/NEWS > $@
104 news/openssl-1.0.0-notes.inc: $(CHECKOUTS)/openssl-1.0.0-stable/NEWS news/openssl-1.0.0-notes.html
105         @rm -f $@
106         ./bin/mk-notes 1.0.0 < $(CHECKOUTS)/openssl-1.0.0-stable/NEWS > $@
107 news/openssl-1.0.1-notes.inc: $(CHECKOUTS)/openssl-1.0.1-stable/NEWS news/openssl-1.0.1-notes.html
108         @rm -f $@
109         ./bin/mk-notes 1.0.1 < $(CHECKOUTS)/openssl-1.0.1-stable/NEWS > $@
110 news/openssl-1.0.2-notes.inc: $(CHECKOUTS)/openssl-1.0.2-stable/NEWS news/openssl-1.0.2-notes.html
111         @rm -f $@
112         ./bin/mk-notes 1.0.2 < $(CHECKOUTS)/openssl-1.0.2-stable/NEWS > $@
113 news/openssl-1.1.0-notes.inc: $(CHECKOUTS)/openssl/NEWS news/openssl-1.1.0-notes.html
114         @rm -f $@
115         ./bin/mk-notes 1.1.0 < $(CHECKOUTS)/openssl/NEWS > $@
116
117 news/newsflash.inc: news/newsflash.txt
118         sed <$? >$@ \
119             -e '/^#/d' \
120             -e 's@^@<tr><td class="d">@' \
121             -e 's@: @</td><td class="t">@' \
122             -e 's@$$@</td></tr>@'
123 news/vulnerabilities.inc: bin/vulnerabilities.xsl news/vulnerabilities.xml
124         @rm -f $@
125         xsltproc bin/vulnerabilities.xsl news/vulnerabilities.xml >$@
126
127 docs/faq.inc: docs/faq.txt
128         @rm -f $@
129         ./bin/mk-faq <$? >$@
130 docs/fips.inc: $(wildcard docs/fips/*)
131         @rm -f $@
132         ./bin/mk-filelist docs/fips fips/ '*' >$@
133
134 source/.htaccess: $(wildcard source/openssl-*.tar.gz)
135         @rm -f @?
136         ./bin/mk-latest source >$@
137 source/license.txt: $(SNAP)/LICENSE
138         @rm -f $@
139         cp $? $@
140 source/index.inc: $(wildcard $(RELEASEDIR)/openssl-*.tar.gz)
141         @rm -f $@
142         ./bin/mk-filelist -a $(RELEASEDIR) '' 'openssl-*.tar.gz' >$@
143
144 source/old/0.9.x/index.inc: $(wildcard source/old/0.9.x/*.gz)
145         @rm -f $@
146         ./bin/mk-filelist source/old/0.9.x '' '*.gz' >$@
147 source/old/1.0.0/index.inc: $(wildcard source/old/1.0.0/*.gz)
148         @rm -f $@
149         ./bin/mk-filelist source/old/1.0.0 '' '*.gz' >$@
150 source/old/1.0.1/index.inc: $(wildcard source/old/1.0.1/*.gz)
151         @rm -f $@
152         ./bin/mk-filelist source/old/1.0.1 '' '*.gz' >$@
153 source/old/1.0.2/index.inc: $(wildcard source/old/1.0.2/*.gz)
154         @rm -f $@
155         ./bin/mk-filelist source/old/1.0.2 '' '*.gz' >$@
156 source/old/fips/index.inc: $(wildcard source/old/fips/*.gz)
157         @rm -f $@
158         ./bin/mk-filelist source/old/fips '' '*.gz' >$@
159
160 # Because these the indexes of old tarballs will inevitably be newer
161 # than the tarballs that are moved into their respective directory,
162 # we must declare them phony, or they will not be regenerated when
163 # they should.
164 .PHONY : source/old/0.9.x/index.inc source/old/1.0.0/index.inc \
165          source/old/1.0.1/index.inc source/old/1.0.2/index.inc \
166          source/old/fips/index.inc