]> git.ozlabs.org Git - ccan/blob - Makefile-web
opt: fix example to compile.
[ccan] / Makefile-web
1 # This can be overridden on cmdline to generate pages elsewhere.
2 WEBDIR=/home/rusty/www/html/ccan
3
4 # Ignore EXCLUDE when making webpages.
5 REALLY_ALL=$(patsubst ccan/%/_info, %, $(shell bzr ls -R ccan | grep '/_info$$'))
6 ALL_PAGES=$(patsubst %, $(WEBDIR)/info/%.html, $(REALLY_ALL))
7 DIRECT_TARBALLS=$(patsubst %, $(WEBDIR)/tarballs/%.tar.bz2, $(REALLY_ALL))
8 DEPEND_TARBALLS=$(patsubst %, $(WEBDIR)/tarballs/with-deps/%.tar.bz2, $(REALLY_ALL))
9 WEB_SUBDIRS=$(WEBDIR)/tarballs $(WEBDIR)/junkcode $(WEBDIR)/tarballs/with-deps $(WEBDIR)/info
10 JUNKDIRS=$(wildcard junkcode/*)
11 JUNKPAGES=$(JUNKDIRS:%=$(WEBDIR)/%.html)
12 JUNKBALLS=$(JUNKDIRS:%=$(WEBDIR)/%.tar.bz2)
13 BZRBROWSE=$(WEBDIR)/bzrbrowse.cgi $(WEBDIR)/file.png $(WEBDIR)/folder.png $(WEBDIR)/symlink.png
14
15 upload: fastcheck webpages
16         bzr push
17         send-web # Rusty's upload script.
18
19 webpages: $(WEB_SUBDIRS) $(WEBDIR)/index.html $(WEBDIR)/upload.html $(WEBDIR)/uploader.php $(WEBDIR)/example-config.h $(WEBDIR)/ccan.jpg $(BZRBROWSE) $(DIRECT_TARBALLS) $(DEPEND_TARBALLS) $(WEBDIR)/ccan.tar.bz2 $(WEBDIR)/Makefile-ccan $(ALL_PAGES) junkpages
20
21 junkpages:  $(WEBDIR)/list.html $(WEBDIR)/junkcode $(JUNKPAGES) $(JUNKBALLS)
22 $(WEB_SUBDIRS):
23         mkdir -p $@
24
25 $(WEBDIR)/junkcode/%.tar.bz2: junkcode/% $(WEBDIR)/junkcode
26         (bzr ls --recursive --versioned --kind=file --null $<; bzr ls --recursive --versioned --kind=symlink --null $<) | xargs -0 -x tar cvfj $@ 
27
28 $(WEBDIR)/junkcode/%.html: $(WEBDIR)/junkcode/%.tar.bz2
29         cd $(WEBDIR) && tar xfj junkcode/$*.tar.bz2
30         php5 web/staticjunkcode.php junkcode/$* $* > $@
31
32 # We want tarball to contain ccan/
33 $(WEBDIR)/ccan.tar.bz2: config.h Makefile Makefile-ccan $(shell bzr ls --versioned --kind=file --recursive ccan) $(shell bzr ls --versioned --recursive --kind=file tools) $(shell bzr ls --versioned --kind=symlink --recursive ccan) $(shell bzr ls --versioned --recursive --kind=symlink tools)
34         DIR=`pwd` && cd /tmp && ln -sf "$$DIR" ccan && tar cvfj $@ `for f in $^; do echo ccan/$$f; done` && rm ccan
35
36 $(ALL_PAGES): tools/doc_extract web/staticmoduleinfo.php
37
38 $(WEBDIR)/list.html: web/staticall.php tools/doc_extract $(DIRECT_TARBALLS) $(DEPEND_TARBALLS) $(WEBDIR)/ccan.tar.bz2 $(JUNKBALLS)
39         php5 web/staticall.php ccan/ junkcode/ $(WEBDIR) > $@
40
41 $(WEBDIR)/upload.html: web/staticupload.php
42         php5 web/staticupload.php > $@
43
44 # cpp inserts gratuitous linebreaks at start of file, makes for php problems.
45 $(WEBDIR)/uploader.php: web/uploader.php.cpp
46         cpp -w -C -P $< | grep . > $@
47
48 $(WEBDIR)/index.html: web/staticindex.php
49         php5 web/staticindex.php > $@
50
51 $(WEBDIR)/example-config.h: config.h
52         cp $< $@
53
54 $(WEBDIR)/Makefile-ccan: Makefile-ccan
55         cp $< $@
56
57 $(WEBDIR)/ccan.jpg: web/ccan.jpg
58         cp $< $@
59
60 $(BZRBROWSE): $(WEBDIR)/%: web/bzrbrowse/%
61         cp $< $@
62
63 $(WEBDIR)/info/%.html: $(WEBDIR)/tarballs/%.tar.bz2 $(WEBDIR)/tarballs/with-deps/%.tar.bz2
64         URLPREFIX=../ php5 web/staticmoduleinfo.php `pwd`/ccan/$* > $@
65
66 $(WEBDIR)/tarballs/%.tar.bz2: ccan/%/_info
67         tar -c -j -f $@ `bzr ls --recursive --versioned --kind=file ccan/$*` `bzr ls --recursive --versioned --kind=symlink ccan/$*`
68
69 $(WEBDIR)/tarballs/with-deps/%.tar.bz2: ccan/%/_info tools/ccan_depends
70         tar cfj $@ $$(echo ccan/$* $$(tools/ccan_depends ccan/$*) | xargs -n 1 bzr ls --recursive --versioned --kind=file) $$(echo ccan/$* $$(tools/ccan_depends ccan/$*) | xargs -n 1 bzr ls --recursive --versioned --kind=symlink)
71
72 distclean: distclean-web
73
74 distclean-web:
75         rm -rf $(WEBDIR)