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