makefile 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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
  46. SOURCE = examples/apt.conf examples/sources.list examples/configure-index examples/apt-https-method-example.conf
  47. TO = $(DOC)
  48. TARGET = binary
  49. include $(COPY_H)
  50. .PHONY: clean clean-subdirs veryclean veryclean-subdirs all binary doc
  51. clean: clean-subdirs
  52. veryclean: veryclean-subdirs
  53. clean-subdirs:
  54. for dir in $(SUBDIRS); do\
  55. $(MAKE) -C $$dir clean; \
  56. done
  57. veryclean-subdirs:
  58. for dir in $(SUBDIRS); do\
  59. rm -rf $$dir; \
  60. done
  61. .PHONY: update-po po4a stats
  62. ifdef PO4A
  63. doc: po4a
  64. update-po:
  65. po4a --previous --no-backups --force --no-translations \
  66. --package-name='$(PACKAGE)-doc' --package-version='$(PACKAGE_VERSION)' \
  67. --msgid-bugs-address='$(PACKAGE_MAIL)' po4a.conf
  68. po4a:
  69. po4a --previous --no-backups \
  70. --package-name='$(PACKAGE)-doc' --package-version='$(PACKAGE_VERSION)' \
  71. --msgid-bugs-address='$(PACKAGE_MAIL)' po4a.conf
  72. endif
  73. stats:
  74. for i in po/*.po; do echo -n "$$i: "; msgfmt --output-file=/dev/null --statistics $$i; done
  75. ifdef DOXYGEN
  76. DOXYGEN_SOURCES = $(shell find $(BASE)/apt-pkg -not -name .\\\#* -and \( -name \*.cc -or -name \*.h \) )
  77. clean: doxygen-clean
  78. doxygen-clean:
  79. rm -fr $(BUILD)/doc/doxygen
  80. rm -f $(BUILD)/doc/doxygen-stamp
  81. $(BUILD)/doc/doxygen-stamp: $(DOXYGEN_SOURCES) $(BUILD)/doc/Doxyfile
  82. rm -fr $(BUILD)/doc/doxygen
  83. mkdir $(BUILD)/doc/doxygen # some versions seem to not create this directory #628799
  84. $(DOXYGEN) $(BUILD)/doc/Doxyfile
  85. touch $(BUILD)/doc/doxygen-stamp
  86. doc: $(BUILD)/doc/doxygen-stamp
  87. endif