Indent code.
[gnutls.git] / gtk-doc.make
blob66463652ef11f13ea58f81979b9d2f91db99acd0
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 TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
26 EXTRA_DIST = \
27 $(content_files) \
28 $(HTML_IMAGES) \
29 $(DOC_MAIN_SGML_FILE) \
30 $(DOC_MODULE)-sections.txt \
31 $(DOC_MODULE)-overrides.txt
33 DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
34 $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp
36 SCANOBJ_FILES = \
37 $(DOC_MODULE).args \
38 $(DOC_MODULE).hierarchy \
39 $(DOC_MODULE).interfaces \
40 $(DOC_MODULE).prerequisites \
41 $(DOC_MODULE).signals
43 REPORT_FILES = \
44 $(DOC_MODULE)-undocumented.txt \
45 $(DOC_MODULE)-undeclared.txt \
46 $(DOC_MODULE)-unused.txt
48 CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS)
50 if ENABLE_GTK_DOC
51 all-local: html-build.stamp
52 else
53 all-local:
54 endif
56 docs: html-build.stamp
58 $(REPORT_FILES): sgml-build.stamp
60 #### scan ####
62 scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
63 @echo 'gtk-doc: Scanning header files'
64 @-chmod -R u+w $(srcdir)
65 @cd $(srcdir) && \
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 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) ; \
69 else \
70 cd $(srcdir) ; \
71 for i in $(SCANOBJ_FILES) ; do \
72 test -f $$i || touch $$i ; \
73 done \
75 @touch scan-build.stamp
77 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt: scan-build.stamp
78 @true
80 #### templates ####
82 tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
83 @echo 'gtk-doc: Rebuilding template files'
84 @-chmod -R u+w $(srcdir)
85 @cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS)
86 @touch tmpl-build.stamp
88 tmpl.stamp: tmpl-build.stamp
89 @true
91 $(srcdir)/tmpl/*.sgml:
92 @true
94 #### xml ####
96 sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files)
97 @echo 'gtk-doc: Building XML'
98 @-chmod -R u+w $(srcdir)
99 @cd $(srcdir) && \
100 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)
101 @touch sgml-build.stamp
103 sgml.stamp: sgml-build.stamp
104 @true
106 #### html ####
108 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
109 @echo 'gtk-doc: Building HTML'
110 @-chmod -R u+w $(srcdir)
111 @rm -rf $(srcdir)/html
112 @mkdir $(srcdir)/html
113 @mkhtml_options=""; \
114 gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \
115 if test "$(?)" = "0"; then \
116 mkhtml_options=--path="$(srcdir)"; \
117 fi; \
118 cd $(srcdir)/html && gtkdoc-mkhtml $(mkhtml_options) $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
119 @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
120 @echo 'gtk-doc: Fixing cross-references'
121 @cd $(srcdir) && gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
122 @touch html-build.stamp
124 ##############
126 clean-local:
127 rm -f *~ *.bak
128 rm -rf .libs
130 distclean-local:
131 cd $(srcdir) && \
132 rm -rf xml $(REPORT_FILES) \
133 $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
135 maintainer-clean-local: clean
136 cd $(srcdir) && rm -rf xml html
138 install-data-local:
139 @installfiles=`echo $(srcdir)/html/*`; \
140 if test "$$installfiles" = '$(srcdir)/html/*'; \
141 then echo '-- Nothing to install' ; \
142 else \
143 if test -n "$(DOC_MODULE_VERSION)"; then \
144 installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
145 else \
146 installdir="$(DESTDIR)$(TARGET_DIR)"; \
147 fi; \
148 $(mkinstalldirs) $${installdir} ; \
149 for i in $$installfiles; do \
150 echo '-- Installing '$$i ; \
151 $(INSTALL_DATA) $$i $${installdir}; \
152 done; \
153 if test -n "$(DOC_MODULE_VERSION)"; then \
154 mv -f $${installdir}/$(DOC_MODULE).devhelp2 \
155 $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \
156 mv -f $${installdir}/$(DOC_MODULE).devhelp \
157 $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \
158 fi; \
159 $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \
162 uninstall-local:
163 @if test -n "$(DOC_MODULE_VERSION)"; then \
164 installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
165 else \
166 installdir="$(DESTDIR)$(TARGET_DIR)"; \
167 fi; \
168 rm -rf $${installdir}
171 # Require gtk-doc when making dist
173 if ENABLE_GTK_DOC
174 dist-check-gtkdoc:
175 else
176 dist-check-gtkdoc:
177 @echo "*** gtk-doc must be installed and enabled in order to make dist"
178 @false
179 endif
181 dist-hook: dist-check-gtkdoc dist-hook-local
182 mkdir $(distdir)/tmpl
183 mkdir $(distdir)/xml
184 mkdir $(distdir)/html
185 -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
186 -cp $(srcdir)/xml/*.xml $(distdir)/xml
187 cp $(srcdir)/html/* $(distdir)/html
188 -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/
189 -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/
190 cd $(distdir) && rm -f $(DISTCLEANFILES)
191 $(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html
193 .PHONY : dist-hook-local docs