makefile 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. MANPAGEPO = $(patsubst %.po,%,$(notdir $(wildcard po/*.po)))
  12. MANPAGEPOLIST = $(patsubst %,manpages-translation-%,$(MANPAGEPO))
  13. doc: manpages
  14. # Do not use XMLTO, build the manpages directly with XSLTPROC
  15. ifdef XSLTPROC
  16. # generate a list of accepted man page translations
  17. SOURCE = $(patsubst %.xml,%,$(wildcard *.?.xml))
  18. INCLUDES = apt.ent apt-verbatim.ent
  19. STYLESHEET=manpage-style.xsl
  20. LOCAL := manpage-$(firstword $(SOURCE))
  21. $(LOCAL)-LIST := $(SOURCE)
  22. # Install generation hooks
  23. manpages: $(MANPAGEPOLIST) $($(LOCAL)-LIST)
  24. $($(LOCAL)-LIST) :: % : %.xml $(STYLESHEET) $(INCLUDES)
  25. echo Creating man page $@
  26. $(XSLTPROC) -o $@ $(STYLESHEET) $<
  27. $(MANPAGEPOLIST) :: manpages-translation-% : %/makefile po4a
  28. $(MAKE) -C $(dir $<) doc
  29. .PHONY: manpages dirs-manpage-subdirs $(MANPAGEPOLIST)
  30. dirs: dirs-manpage-subdirs
  31. dirs-manpage-subdirs:
  32. for i in $(MANPAGEPO); do \
  33. test -d $$i || mkdir $$i; \
  34. test -f $$i/makefile || sed "s#@@LANG@@#$$i#" lang.makefile > $$i/makefile; \
  35. done
  36. # Clean rule
  37. .PHONY: veryclean/$(LOCAL)
  38. veryclean: veryclean/$(LOCAL)
  39. veryclean/$(LOCAL):
  40. -rm -rf $($(@F)-LIST)
  41. endif
  42. # Chain to the manpage rule
  43. SOURCE = apt.8
  44. include $(MANPAGE_H)
  45. examples/sources.list: examples/sources.list.in apt-verbatim.ent
  46. 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
  47. # Examples
  48. SOURCE = examples/apt.conf examples/sources.list examples/configure-index examples/apt-https-method-example.conf
  49. TO = $(DOC)
  50. TARGET = binary
  51. include $(COPY_H)
  52. .PHONY: clean clean-subdirs veryclean veryclean-subdirs all binary doc
  53. clean: clean-subdirs
  54. veryclean: veryclean-subdirs
  55. clean-subdirs:
  56. for dir in $(SUBDIRS); do\
  57. $(MAKE) -C $$dir clean; \
  58. done
  59. veryclean-subdirs:
  60. for dir in $(SUBDIRS); do\
  61. rm -rf $$dir; \
  62. done
  63. .PHONY: update-po po4a stats
  64. ifdef PO4A
  65. doc: po4a
  66. update-po:
  67. po4a --previous --no-backups --force --no-translations \
  68. --package-name='$(PACKAGE)-doc' --package-version='$(PACKAGE_VERSION)' \
  69. --msgid-bugs-address='$(PACKAGE_MAIL)' po4a.conf
  70. po4a:
  71. po4a --previous --no-backups \
  72. --package-name='$(PACKAGE)-doc' --package-version='$(PACKAGE_VERSION)' \
  73. --msgid-bugs-address='$(PACKAGE_MAIL)' po4a.conf
  74. endif
  75. stats:
  76. for i in po/*.po; do echo -n "$$i: "; msgfmt --output-file=/dev/null --statistics $$i; done
  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. doc: $(BUILD)/doc/doxygen-stamp
  89. endif