1 # This can be overridden on cmdline to generate pages elsewhere.
2 WEBDIR=/home/rusty/www/html/ccan
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
15 upload: fastcheck webpages
17 send-web # Rusty's upload script.
19 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)
24 $(WEBDIR)/junkcode/%.tar.bz2: junkcode/% $(WEBDIR)/junkcode
25 bzr ls --recursive --versioned --kind=file --null $< | xargs -0 -x tar cvfj $@
27 $(WEBDIR)/junkcode/%.html: $(WEBDIR)/junkcode/%.tar.bz2
28 cd $(WEBDIR) && tar xfj junkcode/$*.tar.bz2
29 php5 web/staticjunkcode.php junkcode/$* $* > $@
31 # We want tarball to contain ccan/
32 $(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)
33 DIR=`pwd` && cd /tmp && ln -sf "$$DIR" ccan && tar cvfj $@ `for f in $^; do echo ccan/$$f; done` && rm ccan
35 $(ALL_PAGES): tools/doc_extract web/staticmoduleinfo.php
37 $(WEBDIR)/list.html: web/staticall.php tools/doc_extract $(DIRECT_TARBALLS) $(DEPEND_TARBALLS) $(WEBDIR)/ccan.tar.bz2 $(JUNKBALLS)
38 php5 web/staticall.php ccan/ junkcode/ $(WEBDIR) > $@
40 $(WEBDIR)/upload.html: web/staticupload.php
41 php5 web/staticupload.php > $@
43 # cpp inserts gratuitous linebreaks at start of file, makes for php problems.
44 $(WEBDIR)/uploader.php: web/uploader.php.cpp
45 @cpp -w -C -P $< | grep . > $@
47 $(WEBDIR)/index.html: web/staticindex.php
48 @php5 web/staticindex.php > $@
50 $(WEBDIR)/example-config.h: config.h
53 $(WEBDIR)/Makefile-ccan: Makefile-ccan
56 $(WEBDIR)/ccan.jpg: web/ccan.jpg
59 $(BZRBROWSE): $(WEBDIR)/%: web/bzrbrowse/%
62 $(WEBDIR)/info/%.html: $(WEBDIR)/tarballs/%.tar.bz2 $(WEBDIR)/tarballs/with-deps/%.tar.bz2
63 @URLPREFIX=../ php5 web/staticmoduleinfo.php `pwd`/ccan/$* > $@
65 $(WEBDIR)/tarballs/%.tar.bz2: ccan/%/_info
66 tar -c -j -f $@ `bzr ls --recursive --versioned --kind=file ccan/$*`
68 $(WEBDIR)/tarballs/with-deps/%.tar.bz2: ccan/%/_info tools/ccan_depends
69 tar cfj $@ $$(echo ccan/$* $$(tools/ccan_depends ccan/$*) | xargs -n 1 bzr ls --recursive --versioned --kind=file)
71 distclean: distclean-web