Makefile-web 2.6 KB

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