Makefile-web 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. $(WEBDIR)/ccan.tar.bz2: config.h Makefile Makefile-ccan $(shell bzr ls --versioned --kind=file ccan) $(shell bzr ls --versioned --kind=file tools)
  19. tar cvfj $@ $^
  20. $(ALL_PAGES): tools/doc_extract web/staticmoduleinfo.php
  21. $(WEBDIR)/list.html: web/staticall.php tools/doc_extract $(DIRECT_TARBALLS) $(DEPEND_TARBALLS) $(WEBDIR)/ccan.tar.bz2 $(JUNKBALLS)
  22. php5 web/staticall.php ccan/ junkcode/ $(WEBDIR) > $@
  23. $(WEBDIR)/upload.html: web/staticupload.php
  24. php5 web/staticupload.php > $@
  25. # cpp inserts gratuitous linebreaks at start of file, makes for php problems.
  26. $(WEBDIR)/uploader.php: web/uploader.php.cpp
  27. cpp -w -C -P $< | grep . > $@
  28. $(WEBDIR)/index.html: web/staticindex.php
  29. php5 web/staticindex.php > $@
  30. $(WEBDIR)/example-config.h: config.h
  31. cp $< $@
  32. $(WEBDIR)/Makefile-ccan: Makefile-ccan
  33. cp $< $@
  34. $(WEBDIR)/ccan.jpg: web/ccan.jpg
  35. cp $< $@
  36. $(WEBDIR)/info/%.html: ccan/% ccan/%/test $(WEBDIR)/tarballs/%.tar.bz2 $(WEBDIR)/tarballs/with-deps/%.tar.bz2
  37. URLPREFIX=../ php5 web/staticmoduleinfo.php ccan/$* > $@
  38. $(WEBDIR)/tarballs/%.tar.bz2: ccan/% ccan/%/test
  39. tar -c -v -j -f $@ `bzr ls --versioned --kind=file ccan/$*`
  40. $(WEBDIR)/tarballs/with-deps/%.tar.bz2: ccan/% ccan/%/test tools/ccan_depends
  41. tar cvfj $@ $$(echo ccan/$* $$(tools/ccan_depends ccan/$*) | xargs -n 1 bzr ls --versioned --kind=file)
  42. distclean: distclean-web
  43. distclean-web:
  44. rm -rf $(WEBDIR)