makefile 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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: examples/sources.list.in apt-verbatim.ent
  12. sed -e 's#&stable-codename;#$(shell grep --max-count=1 '^<!ENTITY stable-codename "' apt-verbatim.ent | cut -d'"' -f 2)#g' examples/sources.list.in > examples/sources.list
  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
  20. veryclean: veryclean/subdirs
  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. stats:
  34. for i in po/*.po; do echo -n "$$i: "; msgfmt --output-file=/dev/null --statistics $$i; done
  35. ifdef PO4A
  36. MANPAGEPOLIST = $(addprefix manpages-translation-,$(DOCUMENTATIONPO))
  37. DEBIANDOCPOLIST = $(addprefix debiandoc-translation-,$(DOCUMENTATIONPO))
  38. .PHONY: update-po po4a $(MANPAGEPOLIST) $(DEBIANDOCPOLIST) $(DOCDIRLIST)
  39. po4a: manpages/subdirs debiandoc/subdirs
  40. update-po:
  41. po4a --previous --no-backups --force --no-translations \
  42. --package-name='$(PACKAGE)-doc' --package-version='$(PACKAGE_VERSION)' \
  43. --msgid-bugs-address='$(PACKAGE_MAIL)' po4a.conf
  44. manpages/subdirs: $(MANPAGEPOLIST)
  45. $(MANPAGEPOLIST) :: manpages-translation-% : %/makefile po4a.conf
  46. # first line is for apt.8 (see Bug#696923)
  47. po4a --previous --no-backups --translate-only $(dir $<)apt.ent \
  48. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.8,%.$(subst /,,$(dir $<)).8,$(wildcard *.8))) \
  49. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.1.xml,%.$(subst /,,$(dir $<)).1.xml,$(wildcard *.1.xml))) \
  50. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.2.xml,%.$(subst /,,$(dir $<)).2.xml,$(wildcard *.2.xml))) \
  51. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.3.xml,%.$(subst /,,$(dir $<)).3.xml,$(wildcard *.3.xml))) \
  52. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.4.xml,%.$(subst /,,$(dir $<)).4.xml,$(wildcard *.4.xml))) \
  53. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.5.xml,%.$(subst /,,$(dir $<)).5.xml,$(wildcard *.5.xml))) \
  54. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.6.xml,%.$(subst /,,$(dir $<)).6.xml,$(wildcard *.6.xml))) \
  55. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.7.xml,%.$(subst /,,$(dir $<)).7.xml,$(wildcard *.7.xml))) \
  56. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.8.xml,%.$(subst /,,$(dir $<)).8.xml,$(wildcard *.8.xml))) \
  57. --package-name='$(PACKAGE)-doc' --package-version='$(PACKAGE_VERSION)' \
  58. --msgid-bugs-address='$(PACKAGE_MAIL)' po4a.conf
  59. debiandoc/subdirs: $(DEBIANDOCPOLIST)
  60. $(DEBIANDOCPOLIST) :: debiandoc-translation-% : %/makefile po4a.conf
  61. po4a --previous --no-backups --translate-only $(dir $<)apt.ent \
  62. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.sgml,%.$(subst /,,$(dir $<)).sgml,$(wildcard *.sgml))) \
  63. --package-name='$(PACKAGE)-doc' --package-version='$(PACKAGE_VERSION)' \
  64. --msgid-bugs-address='$(PACKAGE_MAIL)' po4a.conf
  65. endif
  66. ifdef DOXYGEN
  67. DOXYGEN_SOURCES = $(shell find $(BASE)/apt-pkg -not -name .\\\#* -and \( -name \*.cc -or -name \*.h \) )
  68. clean: doxygen-clean
  69. doxygen-clean:
  70. rm -fr $(BUILD)/doc/doxygen
  71. rm -f $(BUILD)/doc/doxygen-stamp
  72. $(BUILD)/doc/doxygen-stamp: $(DOXYGEN_SOURCES) $(BUILD)/doc/Doxyfile
  73. rm -fr $(BUILD)/doc/doxygen
  74. mkdir $(BUILD)/doc/doxygen # some versions seem to not create this directory #628799
  75. $(DOXYGEN) $(BUILD)/doc/Doxyfile
  76. touch $(BUILD)/doc/doxygen-stamp
  77. debiandoc: $(BUILD)/doc/doxygen-stamp
  78. endif