Makefile-web 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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)/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
  17. junkpages: $(WEBDIR)/list.html $(WEBDIR)/junkcode $(JUNKPAGES) $(JUNKBALLS)
  18. $(WEB_SUBDIRS):
  19. mkdir -p $@
  20. $(WEBDIR)/junkcode/%.tar.bz2: junkcode/% $(WEBDIR)/junkcode
  21. (bzr ls --recursive --versioned --kind=file --null $<; bzr ls --recursive --versioned --kind=symlink --null $<) | xargs -0 -x tar cvfj $@
  22. $(WEBDIR)/junkcode/%.html: $(WEBDIR)/junkcode/%.tar.bz2
  23. cd $(WEBDIR) && tar xfj junkcode/$*.tar.bz2
  24. php5 web/staticjunkcode.php junkcode/$* $* > $@
  25. # We want tarball to contain ccan/
  26. $(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)
  27. DIR=`pwd` && cd /tmp && ln -sf "$$DIR" ccan && tar cvfj $@ `for f in $^; do echo ccan/$$f; done` && rm ccan
  28. $(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) > $@
  31. $(WEBDIR)/upload.html: web/staticupload.php
  32. php5 web/staticupload.php > $@
  33. # cpp inserts gratuitous linebreaks at start of file, makes for php problems.
  34. $(WEBDIR)/uploader.php: web/uploader.php.cpp
  35. cpp -w -C -P $< | grep . > $@
  36. $(WEBDIR)/index.html: web/staticindex.php
  37. php5 web/staticindex.php > $@
  38. $(WEBDIR)/example-config.h: config.h
  39. cp $< $@
  40. $(WEBDIR)/Makefile-ccan: Makefile-ccan
  41. cp $< $@
  42. $(WEBDIR)/ccan.jpg: web/ccan.jpg
  43. cp $< $@
  44. $(BZRBROWSE): $(WEBDIR)/%: web/bzrbrowse/%
  45. cp $< $@
  46. $(WEBDIR)/info/%.html: $(WEBDIR)/tarballs/%.tar.bz2 $(WEBDIR)/tarballs/with-deps/%.tar.bz2
  47. URLPREFIX=../ php5 web/staticmoduleinfo.php `pwd`/ccan/$* > $@
  48. $(WEBDIR)/tarballs/%.tar.bz2: ccan/%/_info
  49. tar -c -j -f $@ `bzr ls --recursive --versioned --kind=file ccan/$*` `bzr ls --recursive --versioned --kind=symlink ccan/$*` $$(for l in $$(bzr ls --recursive --versioned --kind=symlink ccan/$* | xargs -r ls -l | sed 's,.*/,,'); do echo licences/$$l; done | sort -u)
  50. $(WEBDIR)/tarballs/with-deps/%.tar.bz2: ccan/%/_info tools/ccan_depends
  51. 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) $$(for l in $$(echo ccan/$* $$(tools/ccan_depends ccan/$*) | xargs -r -n 1 bzr ls --recursive --versioned --kind=symlink | xargs -r ls -l | sed 's,.*/,,'); do echo licences/$$l; done | sort -u)
  52. distclean: distclean-web
  53. distclean-web:
  54. rm -rf $(WEBDIR)