makefile 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  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. 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 po4a.conf
  66. po4a:
  67. po4a --previous --no-backups po4a.conf
  68. endif
  69. stats:
  70. for i in po/*.po; do echo -n "$$i: "; msgfmt --statistics $$i; done
  71. ifdef DOXYGEN
  72. DOXYGEN_SOURCES = $(shell find $(BASE)/apt-pkg -not -name .\\\#* -and \( -name \*.cc -or -name \*.h \) )
  73. clean: doxygen-clean
  74. doxygen-clean:
  75. rm -fr $(BUILD)/doc/doxygen
  76. rm -f $(BUILD)/doc/doxygen-stamp
  77. $(BUILD)/doc/doxygen-stamp: $(DOXYGEN_SOURCES) $(BUILD)/doc/Doxyfile
  78. rm -fr $(BUILD)/doc/doxygen
  79. mkdir $(BUILD)/doc/doxygen # some versions seem to not create this directory #628799
  80. $(DOXYGEN) $(BUILD)/doc/Doxyfile
  81. touch $(BUILD)/doc/doxygen-stamp
  82. doc: $(BUILD)/doc/doxygen-stamp
  83. endif