summaryrefslogtreecommitdiff
path: root/gtk-doc.make
diff options
context:
space:
mode:
Diffstat (limited to 'gtk-doc.make')
-rw-r--r--gtk-doc.make112
1 files changed, 64 insertions, 48 deletions
diff --git a/gtk-doc.make b/gtk-doc.make
index 4450835f..9841de47 100644
--- a/gtk-doc.make
+++ b/gtk-doc.make
@@ -5,12 +5,12 @@
####################################
if GTK_DOC_USE_LIBTOOL
-GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
+GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
GTKDOC_RUN = $(LIBTOOL) --mode=execute
else
-GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
+GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
GTKDOC_RUN =
endif
@@ -30,11 +30,12 @@ SETUP_FILES = \
$(DOC_MODULE)-overrides.txt
EXTRA_DIST = \
+ $(HTML_IMAGES) \
$(SETUP_FILES)
DOC_STAMPS=setup-build.stamp scan-build.stamp sgml-build.stamp \
html-build.stamp pdf-build.stamp \
- setup.stamp sgml.stamp html.stamp pdf.stamp
+ sgml.stamp html.stamp pdf.stamp
SCANOBJ_FILES = \
$(DOC_MODULE).args \
@@ -75,36 +76,41 @@ $(REPORT_FILES): sgml-build.stamp
setup-build.stamp:
-@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
- echo 'gtk-doc: Preparing build'; \
- files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \
- if test "x$$files" != "x" ; then \
- for file in $$files ; do \
- test -f $(abs_srcdir)/$$file && \
- cp -p $(abs_srcdir)/$$file $(abs_builddir)/; \
- done \
- fi \
+ echo ' DOC Preparing build'; \
+ files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \
+ if test "x$$files" != "x" ; then \
+ for file in $$files ; do \
+ test -f $(abs_srcdir)/$$file && \
+ cp -pu $(abs_srcdir)/$$file $(abs_builddir)/ || true; \
+ done; \
+ fi; \
fi
@touch setup-build.stamp
-setup.stamp: setup-build.stamp
- @true
-
-
#### scan ####
scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
- @echo 'gtk-doc: Scanning header files'
+ @echo ' DOC Scanning header files'
@_source_dir='' ; \
for i in $(DOC_SOURCE_DIR) ; do \
_source_dir="$${_source_dir} --source-dir=$$i" ; \
done ; \
gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES)
@if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \
- CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) ; \
+ echo " DOC Introspecting gobjects"; \
+ scanobj_options=""; \
+ gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \
+ if test "$(?)" = "0"; then \
+ if test "x$(V)" = "x1"; then \
+ scanobj_options="--verbose"; \
+ fi; \
+ fi; \
+ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \
+ gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \
else \
for i in $(SCANOBJ_FILES) ; do \
- test -f $$i || touch $$i ; \
+ test -f $$i || touch $$i ; \
done \
fi
@touch scan-build.stamp
@@ -114,8 +120,8 @@ $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)
#### xml ####
-sgml-build.stamp: setup.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files)
- @echo 'gtk-doc: Building XML'
+sgml-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt $(expand_content_files)
+ @echo ' DOC Building XML'
@_source_dir='' ; \
for i in $(DOC_SOURCE_DIR) ; do \
_source_dir="$${_source_dir} --source-dir=$$i" ; \
@@ -129,13 +135,19 @@ sgml.stamp: sgml-build.stamp
#### html ####
html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
- @echo 'gtk-doc: Building HTML'
+ @echo ' DOC Building HTML'
@rm -rf html
@mkdir html
@mkhtml_options=""; \
+ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \
+ if test "$(?)" = "0"; then \
+ if test "x$(V)" = "x1"; then \
+ mkhtml_options="$$mkhtml_options --verbose"; \
+ fi; \
+ fi; \
gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \
if test "$(?)" = "0"; then \
- mkhtml_options=--path="$(abs_srcdir)"; \
+ mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \
fi; \
cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
-@test "x$(HTML_IMAGES)" = "x" || \
@@ -147,48 +159,54 @@ html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
cp $(abs_builddir)/$$file $(abs_builddir)/html; \
fi; \
done;
- @echo 'gtk-doc: Fixing cross-references'
+ @echo ' DOC Fixing cross-references'
@gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
@touch html-build.stamp
#### pdf ####
pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
- @echo 'gtk-doc: Building PDF'
- @rm -rf $(DOC_MODULE).pdf
- @mkpdf_imgdirs=""; \
+ @echo ' DOC Building PDF'
+ @rm -f $(DOC_MODULE).pdf
+ @mkpdf_options=""; \
+ gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \
+ if test "$(?)" = "0"; then \
+ if test "x$(V)" = "x1"; then \
+ mkpdf_options="$$mkpdf_options --verbose"; \
+ fi; \
+ fi; \
if test "x$(HTML_IMAGES)" != "x"; then \
for img in $(HTML_IMAGES); do \
part=`dirname $$img`; \
- echo $$mkpdf_imgdirs | grep >/dev/null "\-\-imgdir=$$part "; \
+ echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \
if test $$? != 0; then \
- mkpdf_imgdirs="$$mkpdf_imgdirs --imgdir=$$part"; \
+ mkpdf_options="$$mkpdf_options --imgdir=$$part"; \
fi; \
done; \
fi; \
- gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
+ gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
@touch pdf-build.stamp
##############
clean-local:
- rm -f *~ *.bak
- rm -rf .libs
+ @rm -f *~ *.bak
+ @rm -rf .libs
distclean-local:
- rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \
+ @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \
$(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
- if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
+ @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
rm -f $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types; \
fi
maintainer-clean-local: clean
- rm -rf xml html
+ @rm -rf xml html
install-data-local:
@installfiles=`echo $(builddir)/html/*`; \
- if test "$$installfiles" = '$(srcdir)/html/*'; \
- then echo '-- Nothing to install' ; \
+ if test "$$installfiles" = '$(builddir)/html/*'; \
+ then echo 1>&2 'Nothing to install' ; \
else \
if test -n "$(DOC_MODULE_VERSION)"; then \
installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
@@ -197,14 +215,12 @@ install-data-local:
fi; \
$(mkinstalldirs) $${installdir} ; \
for i in $$installfiles; do \
- echo '-- Installing '$$i ; \
+ echo ' $(INSTALL_DATA) '$$i ; \
$(INSTALL_DATA) $$i $${installdir}; \
done; \
if test -n "$(DOC_MODULE_VERSION)"; then \
mv -f $${installdir}/$(DOC_MODULE).devhelp2 \
$${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \
- mv -f $${installdir}/$(DOC_MODULE).devhelp \
- $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \
fi; \
$(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \
fi
@@ -229,12 +245,12 @@ dist-check-gtkdoc:
endif
dist-hook: dist-check-gtkdoc dist-hook-local
- mkdir $(distdir)/html
- cp $(builddir)/html/* $(distdir)/html
- -cp $(builddir)/$(DOC_MODULE).pdf $(distdir)/
- -cp $(builddir)/$(DOC_MODULE).types $(distdir)/
- -cp $(builddir)/$(DOC_MODULE)-sections.txt $(distdir)/
- cd $(distdir) && rm -f $(DISTCLEANFILES)
- $(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html
+ @mkdir $(distdir)/html
+ @cp ./html/* $(distdir)/html
+ @-cp ./$(DOC_MODULE).pdf $(distdir)/
+ @-cp ./$(DOC_MODULE).types $(distdir)/
+ @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/
+ @cd $(distdir) && rm -f $(DISTCLEANFILES)
+ @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html
.PHONY : dist-hook-local docs