makefile 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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 $(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 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. --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. po4a --previous --no-backups --translate-only $(dir $<)apt.ent \
  52. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.1.xml,%.$(subst /,,$(dir $<)).1.xml,$(wildcard *.1.xml))) \
  53. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.2.xml,%.$(subst /,,$(dir $<)).2.xml,$(wildcard *.2.xml))) \
  54. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.3.xml,%.$(subst /,,$(dir $<)).3.xml,$(wildcard *.3.xml))) \
  55. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.4.xml,%.$(subst /,,$(dir $<)).4.xml,$(wildcard *.4.xml))) \
  56. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.5.xml,%.$(subst /,,$(dir $<)).5.xml,$(wildcard *.5.xml))) \
  57. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.6.xml,%.$(subst /,,$(dir $<)).6.xml,$(wildcard *.6.xml))) \
  58. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.7.xml,%.$(subst /,,$(dir $<)).7.xml,$(wildcard *.7.xml))) \
  59. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.8.xml,%.$(subst /,,$(dir $<)).8.xml,$(wildcard *.8.xml))) \
  60. --package-name='$(PACKAGE)-doc' --package-version='$(PACKAGE_VERSION)' \
  61. --msgid-bugs-address='$(PACKAGE_MAIL)' po4a.conf
  62. docbook/subdirs: $(DOCBOOKPOLIST)
  63. $(DOCBOOKPOLIST) :: docbook-translation-% : %/makefile po4a.conf
  64. po4a --previous --no-backups --translate-only $(dir $<)apt.ent \
  65. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.dbk,%.$(subst /,,$(dir $<)).dbk,$(wildcard *.dbk))) \
  66. --package-name='$(PACKAGE)-doc' --package-version='$(PACKAGE_VERSION)' \
  67. --msgid-bugs-address='$(PACKAGE_MAIL)' po4a.conf
  68. endif
  69. ifdef DOXYGEN
  70. DOXYGEN_SOURCES = $(shell find $(BASE)/apt-pkg -not -name .\\\#* -and \( -name \*.cc -or -name \*.h \) )
  71. clean: doxygen-clean
  72. doxygen-clean:
  73. rm -fr $(BUILD)/doc/doxygen
  74. rm -f $(BUILD)/doc/doxygen-stamp
  75. $(BUILD)/doc/doxygen-stamp: $(DOXYGEN_SOURCES) $(BUILD)/doc/Doxyfile
  76. rm -fr $(BUILD)/doc/doxygen
  77. mkdir $(BUILD)/doc/doxygen # some versions seem to not create this directory #628799
  78. $(DOXYGEN) $(BUILD)/doc/Doxyfile
  79. touch $(BUILD)/doc/doxygen-stamp
  80. docbook: $(BUILD)/doc/doxygen-stamp
  81. endif