Makefile-web 2.8 KB

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