po4a.mk 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #
  2. # You must set the $(lang) variable when you include this makefile.
  3. #
  4. # You can use the $(po4a_translate_options) variable to specify additional
  5. # options to po4a.
  6. # For example: po4a_translate_options=-L KOI8-R -A KOI8-R
  7. #
  8. #
  9. # This makefile deals with the manpages generated from POs with po4a, and
  10. # should be included in an automake Makefile.am.
  11. #
  12. # The man pages are generated when make enters the po4a directory.
  13. # If a man page cannot be generated (it is not sufficiently translated; the
  14. # threshold is 80%), it won't be distributed, and the build won't fail.
  15. #
  16. mandir = @mandir@/$(lang)
  17. # List of aliases for dpkg_source.1
  18. # If dpkg_source.1 can be generated, this aliases are also generated
  19. dpkg_source_aliases = \
  20. dpkg-buildpackage.1 \
  21. dpkg-distaddfile.1 \
  22. dpkg-genchanges.1 \
  23. dpkg-gencontrol.1 \
  24. dpkg-parsechangelog.1 \
  25. dpkg-shlibdeps.1
  26. # Inform automake that we want to install some man pages in section 1, 5
  27. # and 8.
  28. # We can't simply use:
  29. # dist_man_MANS = $(wildcard *.[1-9])
  30. # Because when Makefile.in is generated, dist_man_MANS is empty, and
  31. # automake do not generate the install-man targets.
  32. dist_man_MANS = fake-page.1 fake-page.5 fake-page.8
  33. # Do not fail if these man pages do not exist
  34. .PHONY: fake-page.1 fake-page.5 fake-page.8
  35. # Override the automake's install-man target.
  36. # And set dist_man_MANS according to the pages that could be generated
  37. # when this target is called.
  38. install-man: dist_man_MANS = $(wildcard *.[1-9])
  39. install-man: install-man1 install-man5 install-man8
  40. all-local:
  41. # If dpkg-source.1 was generated, create the symlink
  42. if [ -f dpkg-source.1 ]; then \
  43. for man in $(dpkg_source_aliases); do \
  44. echo ".so man1/dpkg-source.1" > $$man; \
  45. chmod 644 $$man; \
  46. done; \
  47. fi
  48. # Remove the generated aliases
  49. clean-local:
  50. rm -f $(dpkg_source_aliases)