1 ## Process this file with automake to produce Makefile.in
3 # This is a blank Makefile.am for using gtk-doc.
4 # Copy this to your project's API docs directory and modify the variables to
5 # suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples
6 # of using the various options.
8 # The name of the module, e.g. 'glib'.
11 # The top-level SGML file. Change it if you want.
12 DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
14 # The directory containing the source code. Relative to $(srcdir).
15 # gtk-doc will search all .c & .h files beneath here for inline comments
16 # documenting functions and macros.
17 DOC_SOURCE_DIR=../../lib
19 # Extra options to pass to gtkdoc-scanobj or gtkdoc-scangobj.
22 # Extra options to supply to gtkdoc-scan.
25 # Extra options to supply to gtkdoc-mkdb.
28 # Extra options to supply to gtkdoc-fixref.
31 # Used for dependencies.
32 HFILE_GLOB=$(top_srcdir)/lib/*.h
33 CFILE_GLOB=$(top_srcdir)/lib/*.c
35 # Header files to ignore when scanning.
36 IGNORE_HFILES=internal.h gettext.h setenv.h pkcs5.h
38 # Images to copy into HTML directory.
41 # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE).
44 # Other files to distribute.
47 # CFLAGS and LDFLAGS for compiling scan program. Only needed if your app/lib
48 # contains GtkObjects/GObjects and you want to document signals and properties.
52 GTKDOC_CC=$(LIBTOOL) --mode=compile $(CC)
53 GTKDOC_LD=$(LIBTOOL) --mode=link $(CC)
55 # If you need to override some of the declarations, place them in the
56 # $(DOC_MODULE)-overrides.txt file and uncomment the second line here.
58 #DOC_OVERRIDES = $(DOC_MODULE)-overrides.txt
62 ###########################################################################
63 # Everything below here is generic and you shouldn't need to change it.
64 ###########################################################################
66 TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
72 $(DOC_MAIN_SGML_FILE) \
74 $(DOC_MODULE)-sections.txt \
77 DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
78 $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp
82 $(DOC_MODULE).hierarchy \
86 all-local: html-build.stamp
90 scan-build.stamp: $(HFILE_GLOB)
91 @echo '*** Scanning header files ***'
92 if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null ; then \
93 CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scanobj $(SCANOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \
96 for i in $(SCANOBJ_FILES) ; do \
97 test -f $$i || touch $$i ; \
101 gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES)
102 touch scan-build.stamp
104 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp
109 tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_OVERRIDES)
110 @echo '*** Rebuilding template files ***'
111 cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE)
112 touch tmpl-build.stamp
114 tmpl.stamp: tmpl-build.stamp
119 sgml-build.stamp: tmpl.stamp $(CFILE_GLOB) $(srcdir)/tmpl/*.sgml
120 @echo '*** Building SGML ***'
122 gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS)
123 touch sgml-build.stamp
125 sgml.stamp: sgml-build.stamp
130 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
131 @echo '*** Building HTML ***'
132 test -d $(srcdir)/html || mkdir $(srcdir)/html
133 cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
134 test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
135 @echo '-- Fixing Crossreferences'
136 cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
137 touch html-build.stamp
145 rm -f *~ *.bak $(SCANOBJ_FILES) *-unused.txt $(DOC_STAMPS)
147 maintainer-clean-local: clean
148 cd $(srcdir) && rm -rf sgml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
149 cd $(srcdir) && rm -f shishi-sections.txt shishi-undocumented.txt shishi.types
150 cd $(srcdir) && rm -f tmpl/shishi*
153 $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
154 (installfiles=`echo $(srcdir)/html/*.html`; \
155 if test "$$installfiles" = '$(srcdir)/html/*.html'; \
156 then echo '-- Nothing to install' ; \
158 for i in $$installfiles; do \
159 echo '-- Installing '$$i ; \
160 $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
162 echo '-- Installing $(srcdir)/html/index.sgml' ; \
163 $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR); \
169 (uninstallfiles=`cd $(srcdir)/html/; echo *.html`; \
170 if test "$$uninstallfiles" = '*.html'; \
171 then echo '-- Nothing to uninstall' ; \
173 for i in $$uninstallfiles; do \
174 echo '-- Uninstalling '$$i ; \
175 rm -f $(DESTDIR)$(TARGET_DIR)/$$i; \
177 echo '-- Uninstalling $(srcdir)/html/index.sgml' ; \
178 rm -f $(DESTDIR)$(TARGET_DIR)/index.sgml; \
179 echo '-- Uninstalling $(DESTDIR)$(TARGET_DIR)' ; \
180 test ! -d $(DESTDIR)$(TARGET_DIR) || rmdir $(DESTDIR)$(TARGET_DIR); \
184 # Require gtk-doc when making dist
190 @echo "*** gtk-doc must be installed and enabled in order to make dist"
194 dist-hook: dist-check-gtkdoc dist-hook-local
195 mkdir $(distdir)/tmpl
196 mkdir $(distdir)/sgml
197 mkdir $(distdir)/html
198 -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
199 -cp $(srcdir)/sgml/*.sgml $(distdir)/sgml
200 -cp $(srcdir)/html/index.sgml $(distdir)/html
201 -cp $(srcdir)/html/*.html $(srcdir)/html/*.css $(distdir)/html
203 images=$(HTML_IMAGES) ; \
204 for i in $$images ; do \
205 cp $(srcdir)/$$i $(distdir)/html ; \
208 .PHONY : dist-hook-local