makefile 2.5 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. # Do not use XMLTO, build the manpages directly with XSLTPROC
  12. ifdef XSLTPROC
  13. # generate a list of accepted man page translations
  14. SOURCE = $(patsubst %.xml,%,$(wildcard *.?.xml))
  15. INCLUDES = apt.ent
  16. STYLESHEET=manpage-style.xsl
  17. LOCAL := manpage-$(firstword $(SOURCE))
  18. $(LOCAL)-LIST := $(SOURCE)
  19. # Install generation hooks
  20. doc: $($(LOCAL)-LIST)
  21. veryclean: veryclean/$(LOCAL)
  22. $($(LOCAL)-LIST) :: % : %.xml $(INCLUDES)
  23. echo Creating man page $@
  24. $(XSLTPROC) -o $@ $(STYLESHEET) $<
  25. # Clean rule
  26. .PHONY: veryclean/$(LOCAL)
  27. veryclean/$(LOCAL):
  28. -rm -rf $($(@F)-LIST)
  29. endif
  30. # Chain to the manpage rule
  31. SOURCE = apt.8
  32. include $(MANPAGE_H)
  33. # Examples
  34. SOURCE = examples/apt.conf examples/sources.list examples/configure-index examples/apt-https-method-example.conf
  35. TO = $(DOC)
  36. TARGET = binary
  37. include $(COPY_H)
  38. .PHONY: clean clean-subdirs veryclean veryclean-subdirs all binary doc
  39. doc:
  40. for i in $(shell ls po/*.po | sed -r 's#po/([a-z]+[A-Z_]*).po#\1#'); do \
  41. test -d $$i || mkdir $$i; \
  42. test -f $$i/makefile || sed "s#@@LANG@@#$$i#" lang.makefile > $$i/makefile; \
  43. done
  44. # it is likely that we have changed the list, so SUBDIRS is incorrect
  45. for dir in $(dir $(wildcard */makefile)); do\
  46. $(MAKE) -C $$dir $@; \
  47. done
  48. clean: clean-subdirs
  49. veryclean: veryclean-subdirs
  50. clean-subdirs:
  51. for dir in $(SUBDIRS); do\
  52. $(MAKE) -C $$dir clean; \
  53. done
  54. veryclean-subdirs:
  55. for dir in $(SUBDIRS); do\
  56. $(MAKE) -C $$dir veryclean; \
  57. done
  58. ifdef PO4A
  59. doc: po4a
  60. clean: po4a-clean
  61. .PHONY: update-po po4a stats
  62. update-po:
  63. po4a --previous --no-backups --force --no-translations po4a.conf
  64. po4a-clean:
  65. po4a --previous --rm-backups --rm-translations po4a.conf
  66. po4a:
  67. po4a --previous --no-backups po4a.conf
  68. stats:
  69. for i in po/*.po; do echo -n "$$i: "; msgfmt --statistics $$i; done
  70. endif
  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/Doxyfile: Doxyfile.in
  78. (cd $(BUILD) && ./config.status doc/Doxyfile)
  79. $(BUILD)/doc/doxygen-stamp: $(DOXYGEN_SOURCES) $(BUILD)/doc/Doxyfile
  80. rm -fr $(BUILD)/doc/doxygen
  81. $(DOXYGEN) $(BUILD)/doc/Doxyfile
  82. touch $(BUILD)/doc/doxygen-stamp
  83. doc: $(BUILD)/doc/doxygen-stamp
  84. endif