makefile 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. # -*- make -*-
  2. BASE=..
  3. SUBDIR=doc
  4. SUBDIRS= $(dir $(wildcard */makefile))
  5. # Bring in the default rules
  6. include ../buildlib/defaults.mak
  7. # Debian Doc SGML Documents
  8. SOURCE = $(wildcard *.sgml)
  9. DEBIANDOC_HTML_OPTIONS=-l en.UTF-8
  10. include $(DEBIANDOC_H)
  11. doc: manpages debiandoc
  12. # Do not use XMLTO, build the manpages directly with XSLTPROC
  13. ifdef XSLTPROC
  14. # generate a list of accepted man page translations
  15. SOURCE = $(patsubst %.xml,%,$(wildcard *.?.xml))
  16. INCLUDES = apt.ent apt-verbatim.ent
  17. STYLESHEET=manpage-style.xsl
  18. LOCAL := manpage-$(firstword $(SOURCE))
  19. $(LOCAL)-LIST := $(SOURCE)
  20. # Install generation hooks
  21. manpages: $($(LOCAL)-LIST)
  22. $($(LOCAL)-LIST) :: % : %.xml $(STYLESHEET) $(INCLUDES)
  23. echo Creating man page $@
  24. $(XSLTPROC) -o $@ $(STYLESHEET) $<
  25. # Clean rule
  26. .PHONY: veryclean/$(LOCAL)
  27. veryclean: veryclean/$(LOCAL)
  28. veryclean/$(LOCAL):
  29. -rm -rf $($(@F)-LIST)
  30. endif
  31. # Chain to the manpage rule
  32. SOURCE = apt.8
  33. include $(MANPAGE_H)
  34. examples/sources.list: examples/sources.list.in apt-verbatim.ent
  35. 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
  36. # Examples
  37. SOURCE = examples/apt.conf examples/sources.list examples/configure-index examples/apt-https-method-example.conf
  38. TO = $(DOC)
  39. TARGET = binary
  40. include $(COPY_H)
  41. .PHONY: clean clean-subdirs veryclean veryclean-subdirs all binary doc stats
  42. clean: clean-subdirs
  43. veryclean: veryclean-subdirs
  44. clean-subdirs:
  45. for dir in $(SUBDIRS); do\
  46. $(MAKE) -C $$dir clean; \
  47. done
  48. veryclean-subdirs:
  49. for dir in $(SUBDIRS); do\
  50. rm -rf $$dir; \
  51. done
  52. stats:
  53. for i in po/*.po; do echo -n "$$i: "; msgfmt --output-file=/dev/null --statistics $$i; done
  54. ifdef PO4A
  55. DOCUMENTATIONPO = $(patsubst %.po,%,$(notdir $(wildcard po/*.po)))
  56. MANPAGEPOLIST = $(addprefix manpages-translation-,$(DOCUMENTATIONPO))
  57. DEBIANDOCPOLIST = $(addprefix debiandoc-translation-,$(DOCUMENTATIONPO))
  58. MANPAGEDIRLIST = $(addsuffix /makefile,$(DOCUMENTATIONPO))
  59. .PHONY: update-po po4a $(MANPAGEPOLIST) $(MANPAGEDIRLIST)
  60. manpages: $(MANPAGEPOLIST)
  61. debiandoc: $(DEBIANDOCPOLIST)
  62. po4a: $(MANPAGEPOLIST) $(DEBIANDOCPOLIST)
  63. update-po:
  64. po4a --previous --no-backups --force --no-translations \
  65. --package-name='$(PACKAGE)-doc' --package-version='$(PACKAGE_VERSION)' \
  66. --msgid-bugs-address='$(PACKAGE_MAIL)' po4a.conf
  67. $(MANPAGEPOLIST) :: manpages-translation-% : %/makefile po4a.conf
  68. po4a --previous --no-backups --translate-only $(dir $<)apt.ent \
  69. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.1.xml,%.$(subst /,,$(dir $<)).1.xml,$(wildcard *.1.xml))) \
  70. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.2.xml,%.$(subst /,,$(dir $<)).2.xml,$(wildcard *.2.xml))) \
  71. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.3.xml,%.$(subst /,,$(dir $<)).3.xml,$(wildcard *.3.xml))) \
  72. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.4.xml,%.$(subst /,,$(dir $<)).4.xml,$(wildcard *.4.xml))) \
  73. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.5.xml,%.$(subst /,,$(dir $<)).5.xml,$(wildcard *.5.xml))) \
  74. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.6.xml,%.$(subst /,,$(dir $<)).6.xml,$(wildcard *.6.xml))) \
  75. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.7.xml,%.$(subst /,,$(dir $<)).7.xml,$(wildcard *.7.xml))) \
  76. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.8.xml,%.$(subst /,,$(dir $<)).8.xml,$(wildcard *.8.xml))) \
  77. --package-name='$(PACKAGE)-doc' --package-version='$(PACKAGE_VERSION)' \
  78. --msgid-bugs-address='$(PACKAGE_MAIL)' po4a.conf
  79. $(MAKE) -C $(dir $<) manpages
  80. $(DEBIANDOCPOLIST) :: debiandoc-translation-% : %/makefile po4a.conf
  81. po4a --previous --no-backups --translate-only $(dir $<)apt.ent \
  82. $(patsubst %,--translate-only $(dir $<)%,$(patsubst %.sgml,%.$(subst /,,$(dir $<)).sgml,$(wildcard *.sgml))) \
  83. --package-name='$(PACKAGE)-doc' --package-version='$(PACKAGE_VERSION)' \
  84. --msgid-bugs-address='$(PACKAGE_MAIL)' po4a.conf
  85. $(MAKE) -C $(dir $<) debiandoc
  86. dirs: $(MANPAGEDIRLIST)
  87. $(MANPAGEDIRLIST) :: %/makefile : lang.makefile
  88. test -d $(dir $@) || mkdir $(dir $@)
  89. sed "s#@@LANG@@#$(subst /,,$(dir $@))#" $< > $@
  90. endif
  91. ifdef DOXYGEN
  92. DOXYGEN_SOURCES = $(shell find $(BASE)/apt-pkg -not -name .\\\#* -and \( -name \*.cc -or -name \*.h \) )
  93. clean: doxygen-clean
  94. doxygen-clean:
  95. rm -fr $(BUILD)/doc/doxygen
  96. rm -f $(BUILD)/doc/doxygen-stamp
  97. $(BUILD)/doc/doxygen-stamp: $(DOXYGEN_SOURCES) $(BUILD)/doc/Doxyfile
  98. rm -fr $(BUILD)/doc/doxygen
  99. mkdir $(BUILD)/doc/doxygen # some versions seem to not create this directory #628799
  100. $(DOXYGEN) $(BUILD)/doc/Doxyfile
  101. touch $(BUILD)/doc/doxygen-stamp
  102. debiandoc: $(BUILD)/doc/doxygen-stamp
  103. endif