makefile 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. # -*- make -*-
  2. BASE=..
  3. SUBDIR=doc
  4. # Bring in the default rules
  5. include ../buildlib/defaults.mak
  6. # DocBook XML Documents
  7. SOURCE = $(wildcard *.dbk)
  8. LC = en
  9. include $(DOCBOOK_H)
  10. doc: manpages docbook
  11. examples/sources.list: ../vendor/current/sources.list
  12. ln -sf '$(abspath $^)' $@
  13. apt-vendor.ent: ../vendor/current/apt-vendor.ent
  14. ln -sf '$(abspath $^)' $@
  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 docbook/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. docbook: apt-vendor.ent docbook/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. docbook/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. DOCBOOKPOLIST = $(addprefix docbook-translation-,$(DOCUMENTATIONPO))
  43. .PHONY: update-po po4a $(MANPAGEPOLIST) $(DOCBOOKPOLIST) $(DOCDIRLIST)
  44. po4a: manpages/subdirs docbook/subdirs
  45. update-po:
  46. po4a --previous --no-backups --force --no-translations \
  47. --msgmerge-opt --add-location=file \
  48. --porefs noline,wrap \
  49. --package-name='$(PACKAGE)-doc' --package-version='$(PACKAGE_VERSION)' \
  50. --msgid-bugs-address='$(PACKAGE_MAIL)' po4a.conf
  51. sed -n '/^#$$/,$$p' po/apt-doc.pot > po/apt-doc.pot.headerfree
  52. #cat po/apt-doc.pot > po/apt-doc.pot.headerfree
  53. cat po/header.pot.txt po/apt-doc.pot.headerfree > po/apt-doc.pot
  54. rm -f po/apt-doc.pot.headerfree
  55. manpages/subdirs: $(MANPAGEPOLIST)
  56. $(MANPAGEPOLIST) :: manpages-translation-% : %/makefile po4a.conf
  57. po4a --previous --no-backups --translate-only $(dir $<)apt.ent \
  58. --msgmerge-opt --add-location=file \
  59. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.1.xml,%.$(subst /,,$(dir $<)).1.xml,$(wildcard *.1.xml))) \
  60. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.2.xml,%.$(subst /,,$(dir $<)).2.xml,$(wildcard *.2.xml))) \
  61. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.3.xml,%.$(subst /,,$(dir $<)).3.xml,$(wildcard *.3.xml))) \
  62. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.4.xml,%.$(subst /,,$(dir $<)).4.xml,$(wildcard *.4.xml))) \
  63. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.5.xml,%.$(subst /,,$(dir $<)).5.xml,$(wildcard *.5.xml))) \
  64. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.6.xml,%.$(subst /,,$(dir $<)).6.xml,$(wildcard *.6.xml))) \
  65. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.7.xml,%.$(subst /,,$(dir $<)).7.xml,$(wildcard *.7.xml))) \
  66. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.8.xml,%.$(subst /,,$(dir $<)).8.xml,$(wildcard *.8.xml))) \
  67. --package-name='$(PACKAGE)-doc' --package-version='$(PACKAGE_VERSION)' \
  68. --msgid-bugs-address='$(PACKAGE_MAIL)' po4a.conf
  69. docbook/subdirs: $(DOCBOOKPOLIST)
  70. $(DOCBOOKPOLIST) :: docbook-translation-% : %/makefile po4a.conf
  71. po4a --previous --no-backups --translate-only $(dir $<)apt.ent \
  72. --msgmerge-opt --add-location=file \
  73. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.dbk,%.$(subst /,,$(dir $<)).dbk,$(wildcard *.dbk))) \
  74. --package-name='$(PACKAGE)-doc' --package-version='$(PACKAGE_VERSION)' \
  75. --msgid-bugs-address='$(PACKAGE_MAIL)' po4a.conf
  76. endif
  77. ifdef DOXYGEN
  78. DOXYGEN_SOURCES = $(shell find $(BASE)/apt-pkg -not -name .\\\#* -and \( -name \*.cc -or -name \*.h \) )
  79. clean: doxygen-clean
  80. doxygen-clean:
  81. rm -fr $(BUILD)/doc/doxygen
  82. rm -f $(BUILD)/doc/doxygen-stamp
  83. $(BUILD)/doc/doxygen-stamp: $(DOXYGEN_SOURCES) $(BUILD)/doc/Doxyfile
  84. rm -fr $(BUILD)/doc/doxygen
  85. mkdir $(BUILD)/doc/doxygen # some versions seem to not create this directory #628799
  86. $(DOXYGEN) $(BUILD)/doc/Doxyfile
  87. touch $(BUILD)/doc/doxygen-stamp
  88. docbook: $(BUILD)/doc/doxygen-stamp
  89. endif