yodl_manpage.mak 951 B

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