Makefile-web 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. ALL_PAGES=$(patsubst %, $(WEBDIR)/info/%.html, $(REALLY_ALL))
  5. DIRECT_TARBALLS=$(patsubst %, $(WEBDIR)/tarballs/%.tar.bz2, $(REALLY_ALL))
  6. DEPEND_TARBALLS=$(patsubst %, $(WEBDIR)/tarballs/with-deps/%.tar.bz2, $(REALLY_ALL))
  7. WEB_SUBDIRS=$(WEBDIR)/tarballs $(WEBDIR)/junkcode $(WEBDIR)/tarballs/with-deps $(WEBDIR)/info
  8. JUNKDIRS=$(wildcard junkcode/*)
  9. JUNKPAGES=$(JUNKDIRS:%=$(WEBDIR)/%.html)
  10. JUNKBALLS=$(JUNKDIRS:%=$(WEBDIR)/%.tar.bz2)
  11. upload: fastcheck
  12. git push origin HEAD:master
  13. clean-tree:
  14. ! git status --porcelain | grep .
  15. 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
  16. junkpages: $(WEBDIR)/list.html $(WEBDIR)/junkcode $(JUNKPAGES) $(JUNKBALLS)
  17. $(WEB_SUBDIRS): $(WEBDIR)
  18. mkdir -p $@
  19. $(WEBDIR)/junkcode/%.tar.bz2: junkcode/% $(WEBDIR)/junkcode
  20. git ls-files -z $< | 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/; we put junkcode in, but don't depend on it.
  25. $(WEBDIR)/ccan.tar.bz2: config.h Makefile Makefile-ccan $(shell git ls-files ccan tools licenses)
  26. DIR=`pwd` && cd /tmp && ln -sf "$$DIR" ccan && tar cvfj $@ `for f in $^; do echo ccan/$$f; done` ccan/junkcode && 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. $(WEBDIR)/info/%.html: $(WEBDIR)/tarballs/%.tar.bz2 $(WEBDIR)/tarballs/with-deps/%.tar.bz2
  44. URLPREFIX=../ php5 web/staticmoduleinfo.php `pwd`/ccan/$* > $@
  45. $(WEBDIR)/tarballs/%.tar.bz2: ccan/%/_info clean-tree
  46. tar -c -j -f $@ $$(git ls-files ccan/$*) $$(git ls-files ccan/$* | xargs -n1 -r readlink | sed -n 's,^../../,,p' | sort -u)
  47. $(WEBDIR)/tarballs/with-deps/%.tar.bz2: ccan/%/_info tools/ccan_depends clean-tree
  48. 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)
  49. distclean: distclean-web
  50. distclean-web:
  51. rm -rf $(WEBDIR)