makefile 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. # -*- make -*-
  2. BASE=..
  3. SUBDIR=doc
  4. # Bring in the default rules
  5. include ../buildlib/defaults.mak
  6. # Debian Doc SGML Documents
  7. SOURCE = $(wildcard *.sgml)
  8. DEBIANDOC_HTML_OPTIONS=-l en.UTF-8
  9. include $(DEBIANDOC_H)
  10. doc: manpages debiandoc
  11. examples/sources.list: ../vendor/current/sources.list
  12. ln -sf $(shell readlink -f $^) $@
  13. # Examples
  14. SOURCE = examples/apt.conf examples/sources.list examples/configure-index examples/apt-https-method-example.conf
  15. TO = $(DOC)
  16. TARGET = binary
  17. include $(COPY_H)
  18. .PHONY: clean clean/subdirs veryclean veryclean/subdirs manpages/subdirs debiandoc/subdirs all binary doc stats
  19. clean: clean/subdirs clean/examples
  20. veryclean: veryclean/subdirs clean/examples
  21. manpages: manpages/subdirs
  22. debiandoc: debiandoc/subdirs
  23. DOCUMENTATIONPO = $(patsubst %.po,%,$(notdir $(wildcard po/*.po)))
  24. DOCDIRLIST = $(addsuffix /makefile,$(DOCUMENTATIONPO))
  25. dirs: $(DOCDIRLIST)
  26. $(DOCDIRLIST) :: %/makefile : lang.makefile
  27. test -d $(dir $@) || mkdir $(dir $@)
  28. sed "s#@@LANG@@#$(subst /,,$(dir $@))#" $< > $@
  29. debiandoc/subdirs manpages/subdirs clean/subdirs veryclean/subdirs:
  30. for dir in en $(dir $(DOCDIRLIST)); do \
  31. $(MAKE) -C $$dir $(patsubst %/subdirs,%,$@); \
  32. done
  33. clean/examples:
  34. rm -f examples/sources.list
  35. stats:
  36. for i in po/*.po; do echo -n "$$i: "; msgfmt --output-file=/dev/null --statistics $$i; done
  37. ifdef PO4A
  38. MANPAGEPOLIST = $(addprefix manpages-translation-,$(DOCUMENTATIONPO))
  39. DEBIANDOCPOLIST = $(addprefix debiandoc-translation-,$(DOCUMENTATIONPO))
  40. .PHONY: update-po po4a $(MANPAGEPOLIST) $(DEBIANDOCPOLIST) $(DOCDIRLIST)
  41. po4a: manpages/subdirs debiandoc/subdirs
  42. update-po:
  43. po4a --previous --no-backups --force --no-translations \
  44. --package-name='$(PACKAGE)-doc' --package-version='$(PACKAGE_VERSION)' \
  45. --msgid-bugs-address='$(PACKAGE_MAIL)' po4a.conf
  46. manpages/subdirs: $(MANPAGEPOLIST)
  47. $(MANPAGEPOLIST) :: manpages-translation-% : %/makefile po4a.conf
  48. # first line is for apt.8 (see Bug#696923)
  49. po4a --previous --no-backups --translate-only $(dir $<)apt.ent \
  50. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.8,%.$(subst /,,$(dir $<)).8,$(wildcard *.8))) \
  51. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.1.xml,%.$(subst /,,$(dir $<)).1.xml,$(wildcard *.1.xml))) \
  52. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.2.xml,%.$(subst /,,$(dir $<)).2.xml,$(wildcard *.2.xml))) \
  53. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.3.xml,%.$(subst /,,$(dir $<)).3.xml,$(wildcard *.3.xml))) \
  54. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.4.xml,%.$(subst /,,$(dir $<)).4.xml,$(wildcard *.4.xml))) \
  55. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.5.xml,%.$(subst /,,$(dir $<)).5.xml,$(wildcard *.5.xml))) \
  56. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.6.xml,%.$(subst /,,$(dir $<)).6.xml,$(wildcard *.6.xml))) \
  57. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.7.xml,%.$(subst /,,$(dir $<)).7.xml,$(wildcard *.7.xml))) \
  58. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.8.xml,%.$(subst /,,$(dir $<)).8.xml,$(wildcard *.8.xml))) \
  59. --package-name='$(PACKAGE)-doc' --package-version='$(PACKAGE_VERSION)' \
  60. --msgid-bugs-address='$(PACKAGE_MAIL)' po4a.conf
  61. debiandoc/subdirs: $(DEBIANDOCPOLIST)
  62. $(DEBIANDOCPOLIST) :: debiandoc-translation-% : %/makefile po4a.conf
  63. po4a --previous --no-backups --translate-only $(dir $<)apt.ent \
  64. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.sgml,%.$(subst /,,$(dir $<)).sgml,$(wildcard *.sgml))) \
  65. --package-name='$(PACKAGE)-doc' --package-version='$(PACKAGE_VERSION)' \
  66. --msgid-bugs-address='$(PACKAGE_MAIL)' po4a.conf
  67. endif
  68. ifdef DOXYGEN
  69. DOXYGEN_SOURCES = $(shell find $(BASE)/apt-pkg -not -name .\\\#* -and \( -name \*.cc -or -name \*.h \) )
  70. clean: doxygen-clean
  71. doxygen-clean:
  72. rm -fr $(BUILD)/doc/doxygen
  73. rm -f $(BUILD)/doc/doxygen-stamp
  74. $(BUILD)/doc/doxygen-stamp: $(DOXYGEN_SOURCES) $(BUILD)/doc/Doxyfile
  75. rm -fr $(BUILD)/doc/doxygen
  76. mkdir $(BUILD)/doc/doxygen # some versions seem to not create this directory #628799
  77. $(DOXYGEN) $(BUILD)/doc/Doxyfile
  78. touch $(BUILD)/doc/doxygen-stamp
  79. debiandoc: $(BUILD)/doc/doxygen-stamp
  80. endif