Makefile-web 3.3 KB

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