debiandoc.mak 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. # -*- make -*-
  2. # This processes debian-doc sgml to produce html and plain text output
  3. # Input
  4. # $(SOURCE) - The documents to use
  5. # All output is writtin to files in the build doc directory
  6. # See defaults.mak for information about LOCAL
  7. # Some local definitions
  8. LOCAL := debiandoc-$(firstword $(SOURCE))
  9. $(LOCAL)-HTML := $(addsuffix .html,$(addprefix $(DOC)/,$(basename $(SOURCE))))
  10. $(LOCAL)-TEXT := $(addsuffix .text,$(addprefix $(DOC)/,$(basename $(SOURCE))))
  11. debiandoc:
  12. #---------
  13. # Rules to build HTML documentations
  14. ifdef DEBIANDOC_HTML
  15. # Install generation hooks
  16. debiandoc: $($(LOCAL)-HTML)
  17. veryclean: veryclean/html/$(LOCAL)
  18. vpath %.sgml $(SUBDIRS)
  19. $(DOC)/%.html: %.sgml
  20. echo Creating html for $< to $@
  21. -rm -rf $@
  22. (HERE=`pwd`; cd $(@D) && $(DEBIANDOC_HTML) $(DEBIANDOC_HTML_OPTIONS) $$HERE/$<) || exit 199
  23. # Clean rule
  24. .PHONY: veryclean/html/$(LOCAL)
  25. veryclean/html/$(LOCAL):
  26. -rm -rf $($(@F)-HTML)
  27. endif
  28. #---------
  29. # Rules to build Text documentations
  30. ifdef DEBIANDOC_TEXT
  31. # Install generation hooks
  32. debiandoc: $($(LOCAL)-TEXT)
  33. veryclean: veryclean/text/$(LOCAL)
  34. vpath %.sgml $(SUBDIRS)
  35. $(DOC)/%.text: %.sgml
  36. echo Creating text for $< to $@
  37. $(DEBIANDOC_TEXT) -O $< > $@ || exit 198
  38. # Clean rule
  39. .PHONY: veryclean/text/$(LOCAL)
  40. veryclean/text/$(LOCAL):
  41. -rm -rf $($(@F)-TEXT)
  42. endif