Makefile-web 2.7 KB

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