Makefile 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. MODULE_TOPDIR = ..
  2. include $(MODULE_TOPDIR)/include/Make/Other.make
  3. MANPAGES := $(patsubst $(HTMLDIR)/%.html,$(MANDIR)/%.$(MANSECT),$(wildcard $(HTMLDIR)/*.html))
  4. DSTFILES := \
  5. $(HTMLDIR)/grassdocs.css \
  6. $(HTMLDIR)/grass_logo.png \
  7. $(HTMLDIR)/grass_icon.png \
  8. $(HTMLDIR)/nviz/grassdocs.css \
  9. $(HTMLDIR)/nviz/grass_logo.png
  10. categories = \
  11. d:display \
  12. db:database \
  13. g:general \
  14. i:imagery \
  15. m:misc \
  16. ps:postscript \
  17. r:raster \
  18. r3:raster3D \
  19. t:temporal \
  20. v:vector
  21. IDXCATS := $(foreach cat,$(categories),$(lastword $(subst :, ,$(cat))))
  22. IDXSRC = full_index index $(IDXCATS)
  23. INDICES := $(patsubst %,$(HTMLDIR)/%.html,$(IDXSRC))
  24. ALL_HTML := $(wildcard $(HTMLDIR)/*.*.html)
  25. default: $(DSTFILES)
  26. @echo "Generating HTML manual pages index (help system)..."
  27. $(MAKE) $(INDICES)
  28. $(call build,check)
  29. $(MAKE) manpages
  30. # This must be a separate target so that evaluation of $(MANPAGES)
  31. # is delayed until the indices have been generated
  32. manpages:
  33. $(MAKE) $(MANPAGES)
  34. .PHONY: manpages
  35. define build
  36. GISBASE="$(RUN_GISBASE)" ARCH="$(ARCH)" ARCH_DISTDIR="$(ARCH_DISTDIR)" $(PYTHON) ./build_$(1).py $(2)
  37. endef
  38. $(HTMLDIR)/full_index.html: $(ALL_HTML) build_full_index.py build_html.py
  39. $(call build,full_index)
  40. touch $@
  41. $(HTMLDIR)/index.html: build_index.py build_html.py
  42. $(call build,index)
  43. touch $@
  44. define category_rule
  45. $$(HTMLDIR)/$(2).html: $$(wildcard $$(HTMLDIR)/$(1).*.html) build_class.py build_html.py
  46. $$(call build,class,$(1) $(2))
  47. touch $$@
  48. endef
  49. $(foreach cat,$(categories),$(eval $(call category_rule,$(firstword $(subst :, ,$(cat))),$(lastword $(subst :, ,$(cat))))))
  50. $(HTMLDIR)/grassdocs.css: grassdocs.css
  51. $(INSTALL_DATA) $< $@
  52. $(HTMLDIR)/nviz/grassdocs.css: grassdocs.css | $(HTMLDIR)/nviz
  53. $(INSTALL_DATA) $< $@
  54. $(HTMLDIR)/grass_logo.png: grass_logo.png
  55. $(INSTALL_DATA) $< $@
  56. $(HTMLDIR)/nviz/grass_logo.png: grass_logo.png | $(HTMLDIR)/nviz
  57. $(INSTALL_DATA) $< $@
  58. $(HTMLDIR)/grass_icon.png: grass_icon.png
  59. $(INSTALL_DATA) $< $@
  60. $(HTMLDIR)/nviz:
  61. $(MKDIR) $@