Makefile 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #!/usr/bin/make
  2. MAN1S = \
  3. gbp \
  4. gbp-buildpackage \
  5. gbp-clone \
  6. gbp-config \
  7. gbp-create-remote-repo \
  8. gbp-dch \
  9. gbp-import-dsc \
  10. gbp-import-dscs \
  11. gbp-import-orig \
  12. gbp-pq \
  13. gbp-pull \
  14. gbp-buildpackage-rpm \
  15. gbp-import-srpm \
  16. gbp-pq-rpm \
  17. $(NULL)
  18. MAN5S = gbp.conf
  19. MANUAL=manual-html
  20. SGML_MANPAGES=$(patsubst %,%.1,$(MAN1S)) $(patsubst %,%.5,$(MAN5S))
  21. POD_MANPAGES=git-pbuilder.1
  22. MANPAGES=$(SGML_MANPAGES) $(POD_MANPAGES)
  23. VERSION_ENT=version.ent
  24. GBP_VERSION=../gbp/version.py
  25. DEB_VERSION=$(shell sed -ne 's/^gbp_version="\([.a-z0-9~-]\+\)"/\1/p' $(GBP_VERSION))
  26. CHANGELOG=../debian/changelog
  27. # Stuff to build docs outside Debian
  28. HAVE_SGML2X ?= 1
  29. GTK_DOC_CATALOG_FILE ?= /usr/share/sgml/gtk-doc/gtk-doc.cat
  30. all: $(MANUAL) $(MANPAGES)
  31. $(MANUAL): manual.sgml chapters/*.sgml manpages/*.sgml
  32. ifeq ($(HAVE_SGML2X),1)
  33. docbook-2-html -s local $<
  34. else
  35. docbook2html -d local-nosgml2x.dsl -c $(GTK_DOC_CATALOG_FILE) -o $(MANUAL) $<
  36. endif
  37. sed -i 's/^CLASS="[A-Z0-9]\+"/\L&/' manual-html/*.html
  38. cp /usr/share/gtk-doc/data/*.png $(MANUAL)
  39. # We build manpages under 'buildxref/' just to get an updated cross-reference
  40. # file (manpage.refs), before building the final manpages
  41. BUILD_MAN_XREF_PAGES=$(patsubst %,buildxref/%,$(SGML_MANPAGES))
  42. buildxref/%.1 buildxref/%.5: man.%.sgml manpages/%.sgml
  43. docbook2man -o buildxref $<
  44. manpage.refs: $(BUILD_MAN_XREF_PAGES)
  45. cp buildxref/$@ $@
  46. %.1 %.5: manpage.refs
  47. docbook2man -o . man.$*.sgml
  48. git-pbuilder.1: ../bin/git-pbuilder
  49. pod2man $< $@
  50. manual.sgml: $(VERSION_ENT)
  51. $(VERSION_ENT): $(GBP_VERSION)
  52. echo '<!ENTITY gbp-version "$(DEB_VERSION)">' > $(VERSION_ENT)
  53. clean:
  54. -rm -r manual-html/
  55. -rm *.1 *.5 manpage.* $(VERSION_ENT)
  56. -rm -r buildxref