release: bump versions and back to development
[gtk-doc.git] / tests / gtk-doc.make
blob491e6a2a1a907c4998e87201293d4be7e476bf7a
1 # -*- mode: makefile -*-
3 ####################################
4 # Everything below here is generic #
5 ####################################
7 if GTK_DOC_USE_LIBTOOL
8 GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
9 GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
10 GTKDOC_RUN = $(LIBTOOL) --mode=execute
11 else
12 GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
13 GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
14 GTKDOC_RUN =
15 endif
17 # We set GPATH here; this gives us semantics for GNU make
18 # which are more like other make's VPATH, when it comes to
19 # whether a source that is a target of one rule is then
20 # searched for in VPATH/GPATH.
22 GPATH = $(srcdir)
24 # we don't install anything in tests
25 #TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
27 EXTRA_DIST = \
28 $(content_files) \
29 $(HTML_IMAGES) \
30 $(DOC_MAIN_SGML_FILE) \
31 $(DOC_MODULE)-sections.txt
33 DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
34 pdf-build.stamp \
35 $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp \
36 $(srcdir)/pdf.stamp
38 SCANOBJ_FILES = \
39 $(DOC_MODULE).args \
40 $(DOC_MODULE).hierarchy \
41 $(DOC_MODULE).interfaces \
42 $(DOC_MODULE).prerequisites \
43 $(DOC_MODULE).signals
45 REPORT_FILES = \
46 $(DOC_MODULE)-undocumented.txt \
47 $(DOC_MODULE)-undeclared.txt \
48 $(DOC_MODULE)-unused.txt
50 CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS)
52 check-local: html-build.stamp pdf-build.stamp
53 @echo "gtk-doc: `date +%H:%M:%S.%N`: All done"
55 docs: html-build.stamp pdf-build.stamp
56 @echo "gtk-doc: `date +%H:%M:%S.%N`: All done"
58 $(REPORT_FILES): sgml-build.stamp
60 #### scan ####
62 scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
63 @echo "gtk-doc: `date +%H:%M:%S.%N`: Scanning header files"
64 @-chmod -R u+w $(srcdir)
65 @cd $(srcdir) && PATH=$(abs_top_builddir):$(PATH) PERL5LIB=$(abs_top_builddir):$(PERL5LIB) \
66 gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES)
67 @if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \
68 echo "gtk-doc: `date +%H:%M:%S.%N`: Introspecting gobjects"; \
69 CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" PATH=$(abs_top_builddir):$(PATH) PERL5LIB=$(abs_top_builddir):$(PERL5LIB) gtkdoc-scangobj --module=$(DOC_MODULE) --output-dir=$(srcdir) $(SCANGOBJ_OPTIONS); \
70 else \
71 cd $(srcdir) ; \
72 for i in $(SCANOBJ_FILES) ; do \
73 test -f $$i || touch $$i ; \
74 done \
76 @touch scan-build.stamp
78 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp
79 @true
81 #### templates ####
83 tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
84 @echo "gtk-doc: `date +%H:%M:%S.%N`: Rebuilding template files"
85 @-chmod -R u+w $(srcdir)
86 @cd $(srcdir) && PATH=$(abs_top_builddir):$(PATH) PERL5LIB=$(abs_top_builddir):$(PERL5LIB) \
87 gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS)
88 @touch tmpl-build.stamp
90 tmpl.stamp: tmpl-build.stamp
91 @true
93 $(srcdir)/tmpl/*.sgml:
94 @true
96 #### xml ####
98 sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files)
99 @echo "gtk-doc: `date +%H:%M:%S.%N`: Building XML"
100 @-chmod -R u+w $(srcdir)
101 @cd $(srcdir) && PATH=$(abs_top_builddir):$(PATH) PERL5LIB=$(abs_top_builddir):$(PERL5LIB) \
102 gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS)
103 @touch sgml-build.stamp
105 sgml.stamp: sgml-build.stamp
106 @true
108 #### html ####
110 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
111 @echo "gtk-doc: `date +%H:%M:%S.%N`: Building HTML"
112 @-chmod -R u+w $(srcdir)
113 @rm -rf $(srcdir)/html
114 @mkdir $(srcdir)/html
115 @cd $(srcdir)/html && PATH=$(abs_top_builddir):$(PATH) PERL5LIB=$(abs_top_builddir):$(PERL5LIB) ABS_TOP_SRCDIR=$(abs_top_srcdir) \
116 gtkdoc-mkhtml --uninstalled --path="$(abs_srcdir)" $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE) $(MKHTML_OPTIONS)
117 @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html/ )
118 @echo "gtk-doc: `date +%H:%M:%S.%N`: Fixing cross-references"
119 @cd $(srcdir) && PATH=$(abs_top_builddir):$(PATH) PERL5LIB=$(abs_top_builddir):$(PERL5LIB) \
120 gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
121 @touch html-build.stamp
123 #### pdf ####
125 pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
126 @echo "gtk-doc: `date +%H:%M:%S.%N`: Building PDF"
127 @-chmod -R u+w $(srcdir)
128 @rm -rf $(srcdir)/$(DOC_MODULE).pdf
129 @mkpdf_imgdirs=""; \
130 if test "x$(HTML_IMAGES)" != "x"; then \
131 for img in $(HTML_IMAGES); do \
132 part=`dirname $$img`; \
133 echo $$mkpdf_imgdirs | grep >/dev/null "\-\-imgdir=$$part "; \
134 if test $$? != 0; then \
135 mkpdf_imgdirs="$$mkpdf_imgdirs --imgdir=$$part"; \
136 fi; \
137 done; \
138 fi; \
139 cd $(srcdir) && PATH=$(abs_top_builddir):$(PATH) PERL5LIB=$(abs_top_builddir):$(PERL5LIB) ABS_TOP_SRCDIR=$(abs_top_srcdir) \
140 gtkdoc-mkpdf --uninstalled --path="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
141 @touch pdf-build.stamp
143 ##############
145 # we need to enforce a rebuild for the tests
146 clean-local:
147 @rm -f *~ *.bak
148 @rm -rf .libs
149 @chmod -R u+w $(srcdir)
150 $(MAKE) distclean-local
152 distclean-local:
153 @cd $(srcdir) && \
154 rm -rf xml $(REPORT_FILES) $(DOC_MODULE).pdf \
155 $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
157 maintainer-clean-local: clean
158 @cd $(srcdir) && rm -rf xml html
160 .PHONY : dist-hook-local docs