Fix most of relupd target
[openssl-web.git] / Makefile
1 ##
2 ## Build procedure for www.openssl.org
3
4 ##  Snapshot directory
5 SNAP = /var/cache/openssl/checkouts/openssl
6 ## Where releases are found.
7 RELEASEDIR = /var/www/openssl/source
8
9
10 # All simple generated files.
11 SIMPLE = newsflash.inc sitemap.txt \
12          docs/faq.txt docs/faq.inc docs/fips.inc \
13          news/changelog.inc news/changelog.txt \
14          news/newsflash.inc \
15          news/vulnerabilities.inc \
16          source/license.txt \
17          source/index.inc
18 SRCLISTS = \
19            source/old/0.9.x/index.inc \
20            source/old/1.0.0/index.inc \
21            source/old/1.0.1/index.inc \
22            source/old/1.0.2/index.inc \
23            source/old/fips/index.inc \
24
25 all: $(SIMPLE) $(SRCLISTS)
26
27 relupd: all
28         if [ "`id -un`" != openssl ]; then \
29             echo "You must run this as 'openssl'" ; \
30             echo "     sudo -u openssl -H make"; \
31             exit 1; \
32         fi
33         cd $(SNAP)/.. ; for dir in openssl* ; do \
34             echo Updating $$dir ; ( cd $$dir ; git pull $(QUIET) ) ; \
35         done
36         git pull $(QUIET)
37         $(MAKE)
38
39 # To be fixed.
40 hack-source_htaccess:
41         exit 1;
42
43 # Legacy targets
44 simple: all
45 generated: all
46 manpages: all
47 rebuild: all
48
49 clean:
50         rm -f $(SIMPLE)
51
52 newsflash.inc: news/newsflash.inc
53         @rm -f $@
54         head -6 $? >$@
55 sitemap.txt:
56         @rm -f $@
57         ./bin/mk-sitemap >$@
58
59 news/changelog.inc: news/changelog.txt bin/mk-changelog
60         @rm -f $@
61         ./bin/mk-changelog <news/changelog.txt >$@
62 news/changelog.txt: $(SNAP)/CHANGES
63         @rm -f $@
64         cp $? $@
65 news/newsflash.inc: news/newsflash.txt
66         sed <$? >$@ \
67             -e 's@^@<tr><td class="d">@' \
68             -e 's@: @</td><td class="t">@' \
69             -e 's@$$@</td></tr>@'
70 news/vulnerabilities.inc: bin/vulnerabilities.xsl news/vulnerabilities.xml
71         @rm -f $@
72         xsltproc bin/vulnerabilities.xsl news/vulnerabilities.xml >$@
73
74 docs/faq.txt: $(SNAP)/FAQ
75         @rm -f $@
76         cp $? $@
77 docs/faq.inc: docs/faq.txt
78         @rm -f $@
79         ./bin/mk-faq <$? >$@
80 docs/fips.inc:
81         @rm -f $@
82         ./bin/mk-filelist docs/fips fips/ '*' >$@
83
84 source/license.txt: $(SNAP)/LICENSE
85         @rm -f $@
86         cp $? $@
87 source/index.inc:
88         @rm -f $@
89         ./bin/mk-filelist $(RELEASEDIR) '' 'openssl-*.tar.gz' >$@
90
91 source/old/0.9.x/index.inc:
92         @rm -f $@
93         ./bin/mk-filelist source/old/0.9.8 '' '*.gz' >$@
94 source/old/1.0.0/index.inc:
95         @rm -f $@
96         ./bin/mk-filelist source/old/1.0.0 '' '*.gz' >$@
97 source/old/1.0.1/index.inc:
98         @rm -f $@
99         ./bin/mk-filelist source/old/1.0.1 '' '*.gz' >$@
100 source/old/1.0.2/index.inc:
101         @rm -f $@
102         ./bin/mk-filelist source/old/1.0.2 '' '*.gz' >$@
103 source/old/fips/index.inc:
104         @rm -f $@
105         ./bin/mk-filelist source/old/fips '' '*.gz' >$@