makefile 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. $(MAKE) -C $$i $@; \
  44. done
  45. clean: clean-subdirs
  46. veryclean: veryclean-subdirs
  47. clean-subdirs:
  48. for dir in $(SUBDIRS); do\
  49. $(MAKE) -C $$dir clean; \
  50. done
  51. veryclean-subdirs:
  52. for dir in $(SUBDIRS); do\
  53. rm -rf $$dir; \
  54. done
  55. ifdef PO4A
  56. doc: po4a
  57. clean: po4a-clean
  58. .PHONY: update-po po4a stats
  59. update-po:
  60. po4a --previous --no-backups --force --no-translations po4a.conf
  61. po4a-clean:
  62. po4a --previous --rm-backups --rm-translations po4a.conf
  63. po4a:
  64. po4a --previous --no-backups po4a.conf
  65. stats:
  66. for i in po/*.po; do echo -n "$$i: "; msgfmt --statistics $$i; done
  67. endif
  68. ifdef DOXYGEN
  69. DOXYGEN_SOURCES = $(shell find $(BASE)/apt-pkg -not -name .\\\#* -and \( -name \*.cc -or -name \*.h \) )
  70. clean: doxygen-clean
  71. doxygen-clean:
  72. rm -fr $(BUILD)/doc/doxygen
  73. rm -f $(BUILD)/doc/doxygen-stamp
  74. $(BUILD)/doc/Doxyfile: Doxyfile.in
  75. (cd $(BUILD) && ./config.status doc/Doxyfile)
  76. $(BUILD)/doc/doxygen-stamp: $(DOXYGEN_SOURCES) $(BUILD)/doc/Doxyfile
  77. rm -fr $(BUILD)/doc/doxygen
  78. $(DOXYGEN) $(BUILD)/doc/Doxyfile
  79. touch $(BUILD)/doc/doxygen-stamp
  80. doc: $(BUILD)/doc/doxygen-stamp
  81. endif