makefile 4.1 KB

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