makefile 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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 $(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. test -f $$i/manpage-style.xsl || sed "/<!-- LANGUAGE -->/ i\
  36. <xsl:param name=\"l10n.gentext.default.language\" select=\"'$$i'\" />" manpage-style.xsl > $$i/manpage-style.xsl; \
  37. done
  38. # Clean rule
  39. .PHONY: veryclean/$(LOCAL)
  40. veryclean: veryclean/$(LOCAL)
  41. veryclean/$(LOCAL):
  42. -rm -rf $($(@F)-LIST)
  43. endif
  44. # Chain to the manpage rule
  45. SOURCE = apt.8
  46. include $(MANPAGE_H)
  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 po4a.conf
  68. po4a:
  69. po4a --previous --no-backups po4a.conf
  70. endif
  71. stats:
  72. for i in po/*.po; do echo -n "$$i: "; msgfmt --statistics $$i; done
  73. ifdef DOXYGEN
  74. DOXYGEN_SOURCES = $(shell find $(BASE)/apt-pkg -not -name .\\\#* -and \( -name \*.cc -or -name \*.h \) )
  75. clean: doxygen-clean
  76. doxygen-clean:
  77. rm -fr $(BUILD)/doc/doxygen
  78. rm -f $(BUILD)/doc/doxygen-stamp
  79. $(BUILD)/doc/doxygen-stamp: $(DOXYGEN_SOURCES) $(BUILD)/doc/Doxyfile
  80. rm -fr $(BUILD)/doc/doxygen
  81. mkdir $(BUILD)/doc/doxygen # some versions seem to not create this directory #628799
  82. $(DOXYGEN) $(BUILD)/doc/Doxyfile
  83. touch $(BUILD)/doc/doxygen-stamp
  84. doc: $(BUILD)/doc/doxygen-stamp
  85. endif