2 # automake include file for gtk-doc, define your '#%' lines
3 # from gtk-doc-0.9-5/usr/share/doc/gtk-doc-0.9/examples/Makefile.am
4 # Copyright (C) 2002 Jan Kratochvil <project-macros@jankratochvil.net>
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; exactly version 2 of June 1991 is required
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 # s/EXTRA_DIST =/EXTRA_DIST +=/
22 # s/tmpl-build.stamp:/tmpl-build.stamp $(srcdir)/tmpl/*.sgml:/
23 # Prevent: No rule to make target `tmpl/*.sgml', needed by `sgml-build.stamp'. Stop.
24 # Fixes gtk-doc-0.9/setting-up.txt/:
25 # (Note that due to make being awkward the build
26 # may fail the first time, but if you run make again it should work.)
27 # s/gtkdoc-scanobj/gtkdoc-scangobj/
28 # Note that if your project is targeted at GTK+ 2.0 rather
29 # than GTK+ 1.2.x, then you will have to change it so it
30 # runs gtkdoc-scangobj rather than gtkdoc-scanobj.
31 # s/: scan-build.stamp/ $(DOC_MODULE)-sections.txt &/
32 # Prevent: No rule to make target `$(DOC_MODULE)-sections.txt', needed by `distdir'. Stop.
33 # s/gtkdoc-scan --module=/rm -f $(SCANOBJ_FILES) \&\& &/
34 # Do not forget to rebuild some files.
37 # Create sgml/sgml/ to satisfy sgml/-based includes from sgml/MODULE-doc.top
38 # Prevent: sgml.stamp defined both conditionally and unconditionally
46 #% ## Process this file with automake to produce Makefile.in
48 #% # This is a blank Makefile.am for using gtk-doc.
49 #% # Copy this to your project's API docs directory and modify the variables to
50 #% # suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples
51 #% # of using the various options.
53 #% # The name of the module, e.g. 'glib'.
56 #% # The top-level SGML file. Change it if you want.
57 #% DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
59 #% # The directory containing the source code. Relative to $(srcdir).
60 #% # gtk-doc will search all .c & .h files beneath here for inline comments
61 #% # documenting functions and macros.
64 #% # Extra options to pass to gtkdoc-scangobj or gtkdoc-scangobj.
67 #% # Extra options to supply to gtkdoc-scan.
70 #% # Extra options to supply to gtkdoc-mkdb.
73 #% # Extra options to supply to gtkdoc-fixref.
76 #% # Used for dependencies.
80 #% # Header files to ignore when scanning.
83 #% # Images to copy into HTML directory.
86 #% # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE).
89 #% # Other files to distribute.
92 #% # CFLAGS and LDFLAGS for compiling scan program. Only needed if your app/lib
93 #% # contains GtkObjects/GObjects and you want to document signals and properties.
97 #% GTKDOC_CC=$(LIBTOOL) --mode=compile $(CC)
98 #% GTKDOC_LD=$(LIBTOOL) --mode=link $(CC)
100 #% # If you need to override some of the declarations, place them in the
101 #% # $(DOC_MODULE)-overrides.txt file and uncomment the second line here.
103 #% #DOC_OVERRIDES = $(DOC_MODULE)-overrides.txt
107 ###########################################################################
108 # Everything below here is generic and you shouldn't need to change it.
109 ###########################################################################
111 TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
117 $(DOC_MAIN_SGML_FILE) \
118 $(DOC_MODULE).types \
119 $(DOC_MODULE)-sections.txt \
122 DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
123 $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp
127 $(DOC_MODULE).hierarchy \
128 $(DOC_MODULE).signals
131 all-local: html-build.stamp
135 scan-build.stamp: $(HFILE_GLOB)
136 @echo '*** Scanning header files ***'
137 if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null ; then \
138 CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj $(SCANOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \
141 for i in $(SCANOBJ_FILES) ; do \
142 test -f $$i || touch $$i ; \
146 rm -f $(SCANOBJ_FILES) && gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES)
147 touch scan-build.stamp
149 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt : scan-build.stamp
154 tmpl-build.stamp $(srcdir)/tmpl/*.sgml: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_OVERRIDES)
155 @echo '*** Rebuilding template files ***'
156 cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE)
157 touch tmpl-build.stamp
159 tmpl.stamp: tmpl-build.stamp
164 sgml-build.stamp: tmpl.stamp $(CFILE_GLOB) $(srcdir)/tmpl/*.sgml
165 @echo '*** Building SGML ***'
167 gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS)
168 touch sgml-build.stamp
170 sgml.stamp: sgml-build.stamp
175 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
176 @echo '*** Building HTML ***'
177 test -d $(srcdir)/html || mkdir $(srcdir)/html
178 cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
179 test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
180 @echo '-- Fixing Crossreferences'
181 cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
182 touch html-build.stamp
188 rm -f *~ *.bak $(SCANOBJ_FILES) *-unused.txt $(DOC_STAMPS)
190 maintainer-clean-local: clean
191 cd $(srcdir) && rm -rf sgml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
194 $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
195 (installfiles=`echo $(srcdir)/html/*.html`; \
196 if test "$$installfiles" = '$(srcdir)/html/*.html'; \
197 then echo '-- Nothing to install' ; \
199 for i in $$installfiles; do \
200 echo '-- Installing '$$i ; \
201 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
203 echo '-- Installing $(srcdir)/html/index.sgml' ; \
204 $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR); \
208 # Require gtk-doc when making dist
214 @echo "*** gtk-doc must be installed and enabled in order to make dist"
218 dist-hook: dist-check-gtkdoc dist-hook-local
219 mkdir $(distdir)/tmpl
220 mkdir $(distdir)/sgml
221 mkdir $(distdir)/html
222 -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
223 -cp $(srcdir)/sgml/*.sgml $(distdir)/sgml
224 -cp $(srcdir)/html/index.sgml $(distdir)/html
225 -cp $(srcdir)/html/*.html $(srcdir)/html/*.css $(distdir)/html
227 images=$(HTML_IMAGES) ; \
228 for i in $$images ; do \
229 cp $(srcdir)/$$i $(distdir)/html ; \
232 .PHONY : dist-hook-local