diff options
Diffstat (limited to 'gtk-doc.make')
-rw-r--r-- | gtk-doc.make | 79 |
1 files changed, 47 insertions, 32 deletions
diff --git a/gtk-doc.make b/gtk-doc.make index 57fab98..00963af 100644 --- a/gtk-doc.make +++ b/gtk-doc.make @@ -30,10 +30,9 @@ EXTRA_DIST = \ $(DOC_MODULE)-sections.txt \ $(DOC_MODULE)-overrides.txt -DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \ - pdf-build.stamp \ - $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp \ - $(srcdir)/pdf.stamp +DOC_STAMPS=setup-build.stamp scan-build.stamp tmpl-build.stamp sgml-build.stamp \ + html-build.stamp pdf-build.stamp \ + setup.stamp tmpl.stamp sgml.stamp html.stamp pdf.stamp SCANOBJ_FILES = \ $(DOC_MODULE).args \ @@ -70,20 +69,37 @@ docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP) $(REPORT_FILES): sgml-build.stamp +#### setup #### + +setup-build.stamp:: + -@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + cp -a $(abs_srcdir)/$(DOC_MAIN_SGML_FILE) $(abs_builddir)/; \ + cp -a $(abs_srcdir)/$(DOC_MODULE)* $(abs_builddir)/; \ + if test "x$(content_files)" != "x" ; then \ + for file in $(content_files) ; do \ + test -f $(abs_srcdir)/$$file || \ + cp -a $(abs_srcdir)/$$file $(abs_builddir)/; \ + done \ + fi \ + fi + + +setup.stamp: setup-build.stamp + @true + + #### scan #### scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB) @echo 'gtk-doc: Scanning header files' - @-chmod -R u+w $(srcdir) - @_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \ + @_source_dir='' ; + for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ - done ; \ - cd $(srcdir) && \ - gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES) - @if grep -l '^..*$$' $(srcdir)/$(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) --output-dir=$(srcdir) ; \ + 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) ; \ else \ - cd $(srcdir) ; \ for i in $(SCANOBJ_FILES) ; do \ test -f $$i || touch $$i ; \ done \ @@ -97,8 +113,7 @@ $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE) tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt @echo 'gtk-doc: Rebuilding template files' - @-chmod -R u+w $(srcdir) - @cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) + @gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS) @touch tmpl-build.stamp tmpl.stamp: tmpl-build.stamp @@ -112,11 +127,11 @@ $(srcdir)/tmpl/*.sgml: sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files) @echo 'gtk-doc: Building XML' @-chmod -R u+w $(srcdir) - @_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \ + @_source_dir='' ; \ + for i in $(DOC_SOURCE_DIR) ; do \ _source_dir="$${_source_dir} --source-dir=$$i" ; \ - done ; \ - cd $(srcdir) && \ - 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) + done ; \ + 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) @touch sgml-build.stamp sgml.stamp: sgml-build.stamp @@ -126,26 +141,24 @@ sgml.stamp: sgml-build.stamp html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) @echo 'gtk-doc: Building HTML' - @-chmod -R u+w $(srcdir) - @rm -rf $(srcdir)/html - @mkdir $(srcdir)/html + @rm -rf html + @mkdir html @mkhtml_options=""; \ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \ if test "$(?)" = "0"; then \ - mkhtml_options=--path="$(srcdir)"; \ + mkhtml_options=--path="$(abs_srcdir)"; \ fi; \ - cd $(srcdir)/html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) - @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html ) + cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) + @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) $(abs_builddir)/html ) @echo 'gtk-doc: Fixing cross-references' - @cd $(srcdir) && gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) + @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' - @-chmod -R u+w $(srcdir) - @rm -rf $(srcdir)/$(DOC_MODULE).pdf + @rm -rf $(DOC_MODULE).pdf @mkpdf_imgdirs=""; \ if test "x$(HTML_IMAGES)" != "x"; then \ for img in $(HTML_IMAGES); do \ @@ -156,7 +169,7 @@ pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) fi; \ done; \ fi; \ - cd $(srcdir) && gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) + gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS) @touch pdf-build.stamp ############## @@ -166,12 +179,14 @@ clean-local: rm -rf .libs distclean-local: - cd $(srcdir) && \ - rm -rf xml $(REPORT_FILES) $(DOC_MODULE).pdf \ - $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + rm -rf xml $(REPORT_FILES) $(DOC_MODULE).pdf \ + $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt + if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \ + rm -f $(DOC_MAIN_SGML_FILE) $(DOC_MODULE)*; \ + fi maintainer-clean-local: clean - cd $(srcdir) && rm -rf xml html + rm -rf xml html install-data-local: @installfiles=`echo $(srcdir)/html/*`; \ |