makefile 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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 apt-verbatim.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. .PHONY: update-po po4a stats
  56. ifdef PO4A
  57. doc: po4a
  58. update-po:
  59. po4a --previous --no-backups --force --no-translations po4a.conf
  60. po4a:
  61. po4a --previous --no-backups po4a.conf
  62. endif
  63. stats:
  64. for i in po/*.po; do echo -n "$$i: "; msgfmt --statistics $$i; done
  65. ifdef DOXYGEN
  66. DOXYGEN_SOURCES = $(shell find $(BASE)/apt-pkg -not -name .\\\#* -and \( -name \*.cc -or -name \*.h \) )
  67. clean: doxygen-clean
  68. doxygen-clean:
  69. rm -fr $(BUILD)/doc/doxygen
  70. rm -f $(BUILD)/doc/doxygen-stamp
  71. $(BUILD)/doc/doxygen-stamp: $(DOXYGEN_SOURCES) $(BUILD)/doc/Doxyfile
  72. rm -fr $(BUILD)/doc/doxygen
  73. mkdir $(BUILD)/doc/doxygen # some versions seem to not create this directory #628799
  74. $(DOXYGEN) $(BUILD)/doc/Doxyfile
  75. touch $(BUILD)/doc/doxygen-stamp
  76. doc: $(BUILD)/doc/doxygen-stamp
  77. endif