1 # This can be overridden on cmdline to generate pages elsewhere.
2 WEBDIR=~/www/html/ccan/
4 ALL_PAGES=$(patsubst ccan/%, $(WEBDIR)/info/%.html, $(ALL_DIRS))
5 DIRECT_TARBALLS=$(patsubst ccan/%, $(WEBDIR)/tarballs/%.tar.bz2, $(ALL_DIRS))
6 DEPEND_TARBALLS=$(patsubst ccan/%, $(WEBDIR)/tarballs/with-deps/%.tar.bz2, $(ALL_DIRS))
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)
12 webpages: $(WEB_SUBDIRS) $(WEBDIR)/junkcode $(ALL_PAGES) $(WEBDIR)/list.html $(WEBDIR)/index.html $(WEBDIR)/upload.html $(WEBDIR)/uploader.php $(WEBDIR)/example-config.h $(WEBDIR)/ccan.jpg $(DIRECT_TARBALLS) $(DEPEND_TARBALLS) $(WEBDIR)/ccan.tar.bz2 $(WEBDIR)/Makefile-ccan $(JUNKPAGES) $(JUNKBALLS)
17 $(WEBDIR)/junkcode/%.tar.bz2: junkcode/% $(WEBDIR)/junkcode
18 tar cvfj $@ `bzr ls --versioned --kind=file $<`
20 $(WEBDIR)/junkcode/%.html: $(WEBDIR)/junkcode/%.tar.bz2
21 cd $(WEBDIR) && tar xfj junkcode/$*.tar.bz2
22 php5 web/staticjunkcode.php junkcode/$* $* > $@
24 $(WEBDIR)/ccan.tar.bz2: config.h Makefile Makefile-ccan $(shell bzr ls --versioned --kind=file ccan) $(shell bzr ls --versioned --kind=file tools)
27 $(ALL_PAGES): tools/doc_extract web/staticmoduleinfo.php
29 $(WEBDIR)/list.html: web/staticall.php tools/doc_extract $(DIRECT_TARBALLS) $(DEPEND_TARBALLS) $(WEBDIR)/ccan.tar.bz2 $(JUNKBALLS)
30 php5 web/staticall.php ccan/ junkcode/ $(WEBDIR) > $@
32 $(WEBDIR)/upload.html: web/staticupload.php
33 php5 web/staticupload.php > $@
35 # cpp inserts gratuitous linebreaks at start of file, makes for php problems.
36 $(WEBDIR)/uploader.php: web/uploader.php.cpp
37 cpp -w -C -P $< | grep . > $@
39 $(WEBDIR)/index.html: web/staticindex.php
40 php5 web/staticindex.php > $@
42 $(WEBDIR)/example-config.h: config.h
45 $(WEBDIR)/Makefile-ccan: Makefile-ccan
48 $(WEBDIR)/ccan.jpg: web/ccan.jpg
51 $(WEBDIR)/info/%.html: ccan/% ccan/%/test $(WEBDIR)/tarballs/%.tar.bz2 $(WEBDIR)/tarballs/with-deps/%.tar.bz2
52 URLPREFIX=../ php5 web/staticmoduleinfo.php ccan/$* > $@
54 $(WEBDIR)/tarballs/%.tar.bz2: ccan/% ccan/%/test
55 tar -c -v -j -f $@ `bzr ls --versioned --kind=file ccan/$*`
57 $(WEBDIR)/tarballs/with-deps/%.tar.bz2: ccan/% ccan/%/test tools/ccan_depends
58 tar cvfj $@ $$(echo ccan/$* $$(tools/ccan_depends ccan/$*) | xargs -n 1 bzr ls --versioned --kind=file)
60 distclean: distclean-web