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