You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

277 lines
8.6 KiB

  1. # -*- mode: makefile -*-
  2. ####################################
  3. # Everything below here is generic #
  4. ####################################
  5. if GTK_DOC_USE_LIBTOOL
  6. GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
  7. GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
  8. GTKDOC_RUN = $(LIBTOOL) --mode=execute
  9. else
  10. GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
  11. GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
  12. GTKDOC_RUN =
  13. endif
  14. # We set GPATH here; this gives us semantics for GNU make
  15. # which are more like other make's VPATH, when it comes to
  16. # whether a source that is a target of one rule is then
  17. # searched for in VPATH/GPATH.
  18. #
  19. GPATH = $(srcdir)
  20. TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
  21. SETUP_FILES = \
  22. $(content_files) \
  23. $(DOC_MAIN_SGML_FILE) \
  24. $(DOC_MODULE)-sections.txt \
  25. $(DOC_MODULE)-overrides.txt
  26. EXTRA_DIST = \
  27. $(HTML_IMAGES) \
  28. $(SETUP_FILES)
  29. DOC_STAMPS=setup-build.stamp scan-build.stamp sgml-build.stamp \
  30. html-build.stamp pdf-build.stamp \
  31. sgml.stamp html.stamp pdf.stamp
  32. SCANOBJ_FILES = \
  33. $(DOC_MODULE).args \
  34. $(DOC_MODULE).hierarchy \
  35. $(DOC_MODULE).interfaces \
  36. $(DOC_MODULE).prerequisites \
  37. $(DOC_MODULE).signals
  38. REPORT_FILES = \
  39. $(DOC_MODULE)-undocumented.txt \
  40. $(DOC_MODULE)-undeclared.txt \
  41. $(DOC_MODULE)-unused.txt
  42. CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS)
  43. if ENABLE_GTK_DOC
  44. if GTK_DOC_BUILD_HTML
  45. HTML_BUILD_STAMP=html-build.stamp
  46. else
  47. HTML_BUILD_STAMP=
  48. endif
  49. if GTK_DOC_BUILD_PDF
  50. PDF_BUILD_STAMP=pdf-build.stamp
  51. else
  52. PDF_BUILD_STAMP=
  53. endif
  54. all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
  55. else
  56. all-local:
  57. endif
  58. docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
  59. $(REPORT_FILES): sgml-build.stamp
  60. #### setup ####
  61. GTK_DOC_V_SETUP=$(GTK_DOC_V_SETUP_$(V))
  62. GTK_DOC_V_SETUP_=$(GTK_DOC_V_SETUP_$(AM_DEFAULT_VERBOSITY))
  63. GTK_DOC_V_SETUP_0=@echo " DOC Preparing build";
  64. setup-build.stamp:
  65. -$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
  66. files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \
  67. if test "x$$files" != "x" ; then \
  68. for file in $$files ; do \
  69. test -f $(abs_srcdir)/$$file && \
  70. cp -pu $(abs_srcdir)/$$file $(abs_builddir)/$$file || true; \
  71. done; \
  72. fi; \
  73. fi
  74. $(AM_V_at)touch setup-build.stamp
  75. #### scan ####
  76. GTK_DOC_V_SCAN=$(GTK_DOC_V_SCAN_$(V))
  77. GTK_DOC_V_SCAN_=$(GTK_DOC_V_SCAN_$(AM_DEFAULT_VERBOSITY))
  78. GTK_DOC_V_SCAN_0=@echo " DOC Scanning header files";
  79. GTK_DOC_V_INTROSPECT=$(GTK_DOC_V_INTROSPECT_$(V))
  80. GTK_DOC_V_INTROSPECT_=$(GTK_DOC_V_INTROSPECT_$(AM_DEFAULT_VERBOSITY))
  81. GTK_DOC_V_INTROSPECT_0=@echo " DOC Introspecting gobjects";
  82. scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
  83. $(GTK_DOC_V_SCAN)_source_dir='' ; \
  84. for i in $(DOC_SOURCE_DIR) ; do \
  85. _source_dir="$${_source_dir} --source-dir=$$i" ; \
  86. done ; \
  87. gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES)
  88. $(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \
  89. scanobj_options=""; \
  90. gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \
  91. if test "$(?)" = "0"; then \
  92. if test "x$(V)" = "x1"; then \
  93. scanobj_options="--verbose"; \
  94. fi; \
  95. fi; \
  96. CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \
  97. gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \
  98. else \
  99. for i in $(SCANOBJ_FILES) ; do \
  100. test -f $$i || touch $$i ; \
  101. done \
  102. fi
  103. $(AM_V_at)touch scan-build.stamp
  104. $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp
  105. @true
  106. #### xml ####
  107. GTK_DOC_V_XML=$(GTK_DOC_V_XML_$(V))
  108. GTK_DOC_V_XML_=$(GTK_DOC_V_XML_$(AM_DEFAULT_VERBOSITY))
  109. GTK_DOC_V_XML_0=@echo " DOC Building XML";
  110. sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files)
  111. $(GTK_DOC_V_XML)_source_dir='' ; \
  112. for i in $(DOC_SOURCE_DIR) ; do \
  113. _source_dir="$${_source_dir} --source-dir=$$i" ; \
  114. done ; \
  115. gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS)
  116. $(AM_V_at)touch sgml-build.stamp
  117. sgml.stamp: sgml-build.stamp
  118. @true
  119. #### html ####
  120. GTK_DOC_V_HTML=$(GTK_DOC_V_HTML_$(V))
  121. GTK_DOC_V_HTML_=$(GTK_DOC_V_HTML_$(AM_DEFAULT_VERBOSITY))
  122. GTK_DOC_V_HTML_0=@echo " DOC Building HTML";
  123. GTK_DOC_V_XREF=$(GTK_DOC_V_XREF_$(V))
  124. GTK_DOC_V_XREF_=$(GTK_DOC_V_XREF_$(AM_DEFAULT_VERBOSITY))
  125. GTK_DOC_V_XREF_0=@echo " DOC Fixing cross-references";
  126. html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
  127. $(GTK_DOC_V_HTML)rm -rf html && mkdir html && \
  128. mkhtml_options=""; \
  129. gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \
  130. if test "$(?)" = "0"; then \
  131. if test "x$(V)" = "x1"; then \
  132. mkhtml_options="$$mkhtml_options --verbose"; \
  133. fi; \
  134. fi; \
  135. gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \
  136. if test "$(?)" = "0"; then \
  137. mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \
  138. fi; \
  139. cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
  140. -@test "x$(HTML_IMAGES)" = "x" || \
  141. for file in $(HTML_IMAGES) ; do \
  142. if test -f $(abs_srcdir)/$$file ; then \
  143. cp $(abs_srcdir)/$$file $(abs_builddir)/html; \
  144. fi; \
  145. if test -f $(abs_builddir)/$$file ; then \
  146. cp $(abs_builddir)/$$file $(abs_builddir)/html; \
  147. fi; \
  148. done;
  149. $(GTK_DOC_V_XREF)gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
  150. $(AM_V_at)touch html-build.stamp
  151. #### pdf ####
  152. GTK_DOC_V_PDF=$(GTK_DOC_V_PDF_$(V))
  153. GTK_DOC_V_PDF_=$(GTK_DOC_V_PDF_$(AM_DEFAULT_VERBOSITY))
  154. GTK_DOC_V_PDF_0=@echo " DOC Building PDF";
  155. pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
  156. $(GTK_DOC_V_PDF)rm -f $(DOC_MODULE).pdf && \
  157. mkpdf_options=""; \
  158. gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \
  159. if test "$(?)" = "0"; then \
  160. if test "x$(V)" = "x1"; then \
  161. mkpdf_options="$$mkpdf_options --verbose"; \
  162. fi; \
  163. fi; \
  164. if test "x$(HTML_IMAGES)" != "x"; then \
  165. for img in $(HTML_IMAGES); do \
  166. part=`dirname $$img`; \
  167. echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \
  168. if test $$? != 0; then \
  169. mkpdf_options="$$mkpdf_options --imgdir=$$part"; \
  170. fi; \
  171. done; \
  172. fi; \
  173. gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
  174. $(AM_V_at)touch pdf-build.stamp
  175. ##############
  176. clean-local:
  177. @rm -f *~ *.bak
  178. @rm -rf .libs
  179. distclean-local:
  180. @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \
  181. $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
  182. @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
  183. rm -f $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types; \
  184. fi
  185. maintainer-clean-local:
  186. @rm -rf xml html
  187. install-data-local:
  188. @installfiles=`echo $(builddir)/html/*`; \
  189. if test "$$installfiles" = '$(builddir)/html/*'; \
  190. then echo 1>&2 'Nothing to install' ; \
  191. else \
  192. if test -n "$(DOC_MODULE_VERSION)"; then \
  193. installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
  194. else \
  195. installdir="$(DESTDIR)$(TARGET_DIR)"; \
  196. fi; \
  197. $(mkinstalldirs) $${installdir} ; \
  198. for i in $$installfiles; do \
  199. echo ' $(INSTALL_DATA) '$$i ; \
  200. $(INSTALL_DATA) $$i $${installdir}; \
  201. done; \
  202. if test -n "$(DOC_MODULE_VERSION)"; then \
  203. mv -f $${installdir}/$(DOC_MODULE).devhelp2 \
  204. $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \
  205. fi; \
  206. $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \
  207. fi
  208. uninstall-local:
  209. @if test -n "$(DOC_MODULE_VERSION)"; then \
  210. installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
  211. else \
  212. installdir="$(DESTDIR)$(TARGET_DIR)"; \
  213. fi; \
  214. rm -rf $${installdir}
  215. #
  216. # Require gtk-doc when making dist
  217. #
  218. if ENABLE_GTK_DOC
  219. dist-check-gtkdoc: docs
  220. else
  221. dist-check-gtkdoc:
  222. @echo "*** gtk-doc must be installed and enabled in order to make dist"
  223. @false
  224. endif
  225. dist-hook: dist-check-gtkdoc dist-hook-local
  226. @mkdir $(distdir)/html
  227. @cp ./html/* $(distdir)/html
  228. @-cp ./$(DOC_MODULE).pdf $(distdir)/
  229. @-cp ./$(DOC_MODULE).types $(distdir)/
  230. @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/
  231. @cd $(distdir) && rm -f $(DISTCLEANFILES)
  232. @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html
  233. .PHONY : dist-hook-local docs