03f1292cd02affbad629564b329554aabcbef4da
[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/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/fips/index.inc \
30
31 all: $(SIMPLE) $(SRCLISTS) manmaster
32
33 relupd: all
34         if [ "`id -un`" != openssl ]; then \
35             echo "You must run this as 'openssl'" ; \
36             echo "     sudo -u openssl -H make"; \
37             exit 1; \
38         fi
39         cd $(CHECKOUTS) ; for dir in openssl* ; do \
40             echo Updating $$dir ; ( cd $$dir ; git pull $(QUIET) ) ; \
41         done
42         git pull $(QUIET)
43         $(MAKE) all manpages
44
45 define makemanpages
46         ./bin/mk-manpages $(1) $(2) docs
47         ./bin/mk-filelist -a docs/man$(2)/apps '' '*.html' >docs/man$(2)/apps/index.inc
48         ./bin/mk-filelist -a docs/man$(2)/crypto '' '*.html' >docs/man$(2)/crypto/index.inc
49         ./bin/mk-filelist -a docs/man$(2)/ssl '' '*.html' >docs/man$(2)/ssl/index.inc
50 endef
51 manpages: manmaster
52         $(call makemanpages,$(CHECKOUTS)/openssl-1.0.2-stable,1.0.2)
53         $(call makemanpages,$(CHECKOUTS)/openssl-1.0.1-stable,1.0.1)
54         $(call makemanpages,$(CHECKOUTS)/openssl-1.0.0-stable,1.0.0)
55         $(call makemanpages,$(CHECKOUTS)/openssl-0.9.8-stable,0.9.8)
56
57 manmaster:
58         $(call makemanpages,$(CHECKOUTS)/openssl,master)
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 -6 $? >$@
72 sitemap.txt:
73         @rm -f $@
74         ./bin/mk-sitemap >$@
75
76 news/changelog.inc: news/changelog.txt bin/mk-changelog
77         @rm -f $@
78         ./bin/mk-changelog <news/changelog.txt >$@
79 news/changelog.txt: $(SNAP)/CHANGES
80         @rm -f $@
81         cp $? $@
82 news/cl098.txt: $(CHECKOUTS)/openssl-0.9.8-stable/CHANGES
83         @rm -f $@
84         cp $? $@
85 news/cl100.txt: $(CHECKOUTS)/openssl-1.0.0-stable/CHANGES
86         @rm -f $@
87         cp $? $@
88 news/cl101.txt: $(CHECKOUTS)/openssl-1.0.1-stable/CHANGES
89         @rm -f $@
90         cp $? $@
91 news/cl102.txt: $(CHECKOUTS)/openssl-1.0.2-stable/CHANGES
92         @rm -f $@
93         cp $? $@
94
95 news/openssl-0.9.8-notes.html: news/openssl-notes.html.in
96         @rm -f $@
97         sed -e 's|@VERSION@|0.9.8|g' < $< > $@
98 news/openssl-1.0.0-notes.html: news/openssl-notes.html.in
99         @rm -f $@
100         sed -e 's|@VERSION@|1.0.0|g' < $< > $@
101 news/openssl-1.0.1-notes.html: news/openssl-notes.html.in
102         @rm -f $@
103         sed -e 's|@VERSION@|1.0.1|g' < $< > $@
104 news/openssl-1.0.2-notes.html: news/openssl-notes.html.in
105         @rm -f $@
106         sed -e 's|@VERSION@|1.0.2|g' < $< > $@
107 news/openssl-0.9.8-notes.inc: $(CHECKOUTS)/openssl-0.9.8-stable/NEWS news/openssl-0.9.8-notes.html
108         @rm -f $@
109         ./bin/mk-notes 0.9.8 < $(CHECKOUTS)/openssl-0.9.8-stable/NEWS > $@
110 news/openssl-1.0.0-notes.inc: $(CHECKOUTS)/openssl-1.0.0-stable/NEWS news/openssl-1.0.0-notes.html
111         @rm -f $@
112         ./bin/mk-notes 1.0.0 < $(CHECKOUTS)/openssl-1.0.0-stable/NEWS > $@
113 news/openssl-1.0.1-notes.inc: $(CHECKOUTS)/openssl-1.0.1-stable/NEWS news/openssl-1.0.1-notes.html
114         @rm -f $@
115         ./bin/mk-notes 1.0.1 < $(CHECKOUTS)/openssl-1.0.1-stable/NEWS > $@
116 news/openssl-1.0.2-notes.inc: $(CHECKOUTS)/openssl-1.0.2-stable/NEWS news/openssl-1.0.2-notes.html
117         @rm -f $@
118         ./bin/mk-notes 1.0.2 < $(CHECKOUTS)/openssl-1.0.2-stable/NEWS > $@
119
120 news/newsflash.inc: news/newsflash.txt
121         sed <$? >$@ \
122             -e '/^#/d' \
123             -e 's@^@<tr><td class="d">@' \
124             -e 's@: @</td><td class="t">@' \
125             -e 's@$$@</td></tr>@'
126 news/vulnerabilities.inc: bin/vulnerabilities.xsl news/vulnerabilities.xml
127         @rm -f $@
128         xsltproc bin/vulnerabilities.xsl news/vulnerabilities.xml >$@
129
130 docs/faq.inc: docs/faq.txt
131         @rm -f $@
132         ./bin/mk-faq <$? >$@
133 docs/fips.inc: $(wildcard docs/fips/*)
134         @rm -f $@
135         ./bin/mk-filelist docs/fips fips/ '*' >$@
136
137 source/.htaccess: $(wildcard source/openssl-*.tar.gz)
138         @rm -f @?
139         ./bin/mk-latest source >$@
140 source/license.txt: $(SNAP)/LICENSE
141         @rm -f $@
142         cp $? $@
143 source/index.inc: $(wildcard $(RELEASEDIR)/openssl-*.tar.gz)
144         @rm -f $@
145         ./bin/mk-filelist -a $(RELEASEDIR) '' 'openssl-*.tar.gz' >$@
146
147 source/old/0.9.x/index.inc: $(wildcard source/old/0.9.x/*.gz)
148         @rm -f $@
149         ./bin/mk-filelist source/old/0.9.x '' '*.gz' >$@
150 source/old/1.0.0/index.inc: $(wildcard source/old/1.0.0/*.gz)
151         @rm -f $@
152         ./bin/mk-filelist source/old/1.0.0 '' '*.gz' >$@
153 source/old/1.0.1/index.inc: $(wildcard source/old/1.0.1/*.gz)
154         @rm -f $@
155         ./bin/mk-filelist source/old/1.0.1 '' '*.gz' >$@
156 source/old/1.0.2/index.inc: $(wildcard source/old/1.0.2/*.gz)
157         @rm -f $@
158         ./bin/mk-filelist source/old/1.0.2 '' '*.gz' >$@
159 source/old/fips/index.inc: $(wildcard source/old/fips/*.gz)
160         @rm -f $@
161         ./bin/mk-filelist source/old/fips '' '*.gz' >$@