xml_manpage.mak 1013 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. # -*- make -*-
  2. # This handles man pages in DocBook XML format. We convert to the respective
  3. # output in the source directory then copy over to the final dest. This
  4. # means xmlto is only needed if compiling from Arch
  5. # Input
  6. # $(SOURCE) - The documents to use, in the form foo.sect, ie apt-cache.8
  7. # the XML files are called apt-cache.8.xml
  8. # See defaults.mak for information about LOCAL
  9. # Some local definitions
  10. ifdef XMLTO
  11. LOCAL := xml-manpage-$(firstword $(SOURCE))
  12. $(LOCAL)-LIST := $(SOURCE)
  13. # Install generation hooks
  14. doc: $($(LOCAL)-LIST)
  15. veryclean: veryclean/$(LOCAL)
  16. $($(LOCAL)-LIST) :: % : %.xml $(INCLUDES)
  17. echo Creating man page $@
  18. $(XMLTO) man $<
  19. # Clean rule
  20. .PHONY: veryclean/$(LOCAL)
  21. veryclean/$(LOCAL):
  22. -rm -rf $($(@F)-LIST)
  23. HAVE_XMLTO=yes
  24. endif
  25. INCLUDES :=
  26. ifndef HAVE_XMLTO
  27. # Strip from the source list any man pages we dont have compiled already
  28. SOURCE := $(wildcard $(SOURCE))
  29. endif
  30. # Chain to the manpage rule
  31. ifneq ($(words $(SOURCE)),0)
  32. include $(MANPAGE_H)
  33. endif