debiandoc.mak 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. #---------
  12. # Rules to build HTML documentations
  13. ifdef DEBIANDOC_HTML
  14. # Install generation hooks
  15. doc: $($(LOCAL)-HTML)
  16. veryclean: veryclean/html/$(LOCAL)
  17. vpath %.sgml $(SUBDIRS)
  18. $(DOC)/%.html: %.sgml
  19. echo Creating html for $< to $@
  20. -rm -rf $@
  21. (HERE=`pwd`; cd $(@D) && debiandoc2html $$HERE/$<)
  22. # Clean rule
  23. .PHONY: veryclean/html/$(LOCAL)
  24. veryclean/html/$(LOCAL):
  25. -rm -rf $($(@F)-HTML)
  26. endif
  27. #---------
  28. # Rules to build Text documentations
  29. ifdef DEBIANDOC_TEXT
  30. # Install generation hooks
  31. doc: $($(LOCAL)-TEXT)
  32. veryclean: veryclean/text/$(LOCAL)
  33. vpath %.sgml $(SUBDIRS)
  34. $(DOC)/%.text: %.sgml
  35. echo Creating text for $< to $@
  36. debiandoc2text -O $< > $@
  37. # Clean rule
  38. .PHONY: veryclean/text/$(LOCAL)
  39. veryclean/text/$(LOCAL):
  40. -rm -rf $($(@F)-TEXT)
  41. endif