]> git.ozlabs.org Git - ccan/blob - Makefile-web
bytestring: new module.
[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 ALL_PAGES=$(patsubst %, $(WEBDIR)/info/%.html, $(REALLY_ALL))
6 DIRECT_TARBALLS=$(patsubst %, $(WEBDIR)/tarballs/%.tar.bz2, $(REALLY_ALL))
7 DEPEND_TARBALLS=$(patsubst %, $(WEBDIR)/tarballs/with-deps/%.tar.bz2, $(REALLY_ALL))
8 WEB_SUBDIRS=$(WEBDIR)/tarballs $(WEBDIR)/junkcode $(WEBDIR)/tarballs/with-deps $(WEBDIR)/info
9 JUNKDIRS=$(wildcard junkcode/*)
10 JUNKPAGES=$(JUNKDIRS:%=$(WEBDIR)/%.html)
11 JUNKBALLS=$(JUNKDIRS:%=$(WEBDIR)/%.tar.bz2)
12
13 upload: fastcheck
14         git push origin HEAD:master
15         git push github HEAD:master
16
17 clean-tree:
18         ! git status --porcelain | grep .
19
20 webpages: clean-tree $(WEB_SUBDIRS) $(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 $(ALL_PAGES) junkpages
21
22 junkpages: $(WEBDIR)/list.html $(WEBDIR)/junkcode $(JUNKPAGES) $(JUNKBALLS)
23 $(WEB_SUBDIRS): $(WEBDIR)
24         mkdir -p $@
25
26 $(WEBDIR)/junkcode/%.tar.bz2: junkcode/% $(WEBDIR)/junkcode
27         git ls-files -z $< | xargs -0 -x tar cvfj $@ 
28
29 $(WEBDIR)/junkcode/%.html: $(WEBDIR)/junkcode/%.tar.bz2
30         cd $(WEBDIR) && tar xfj junkcode/$*.tar.bz2
31         php5 web/staticjunkcode.php junkcode/$* $* > $@
32
33 # We want tarball to contain ccan/; we put junkcode in, but don't depend on it.
34 $(WEBDIR)/ccan.tar.bz2: config.h Makefile Makefile-ccan $(shell git ls-files ccan tools licenses)
35         DIR=`pwd` && cd /tmp && ln -sf "$$DIR" ccan && tar cvfj $@ `for f in $^; do echo ccan/$$f; done` ccan/junkcode && rm ccan
36
37 $(ALL_PAGES): tools/doc_extract web/staticmoduleinfo.php
38
39 $(WEBDIR)/list.html: web/staticall.php tools/doc_extract $(DIRECT_TARBALLS) $(DEPEND_TARBALLS) $(WEBDIR)/ccan.tar.bz2 $(JUNKBALLS)
40         php5 web/staticall.php ccan/ junkcode/ $(WEBDIR) > $@
41
42 $(WEBDIR)/upload.html: web/staticupload.php
43         php5 web/staticupload.php > $@
44
45 # cpp inserts gratuitous linebreaks at start of file, makes for php problems.
46 $(WEBDIR)/uploader.php: web/uploader.php.cpp
47         cpp -w -C -P $< | grep . > $@
48
49 $(WEBDIR)/index.html: web/staticindex.php
50         php5 web/staticindex.php > $@
51
52 $(WEBDIR)/example-config.h: config.h
53         cp $< $@
54
55 $(WEBDIR)/Makefile-ccan: Makefile-ccan
56         cp $< $@
57
58 $(WEBDIR)/ccan.jpg: web/ccan.jpg
59         cp $< $@
60
61 $(WEBDIR)/info/%.html: $(WEBDIR)/tarballs/%.tar.bz2 $(WEBDIR)/tarballs/with-deps/%.tar.bz2
62         URLPREFIX=../ php5 web/staticmoduleinfo.php `pwd`/ccan/$* > $@
63
64 $(WEBDIR)/tarballs/%.tar.bz2: ccan/%/_info clean-tree
65         tar -c -j -f $@ $$(git ls-files ccan/$*) $$(git ls-files ccan/$* | xargs -n1 -r readlink | sed -n 's,^../../,,p' | sort -u)
66
67 $(WEBDIR)/tarballs/with-deps/%.tar.bz2: ccan/%/_info tools/ccan_depends clean-tree
68         tar -c -j -f $@ $$(git ls-files $$(echo ccan/$* $$(tools/ccan_depends ccan/$*) ) ) $$(git ls-files $$(echo ccan/$* $$(tools/ccan_depends ccan/$*) ) | xargs -n1 -r readlink | sed -n 's,^../../,,p' | sort -u)
69
70 distclean: distclean-web
71
72 distclean-web:
73         rm -rf $(WEBDIR)