]> Pileus Git - ~andy/gtk/blob - docs/reference/gtk/Makefile.am
b001bf2c7069c6e223d77cee68dbf1e6e220da80
[~andy/gtk] / docs / reference / gtk / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2
3 # The name of the module.
4 DOC_MODULE=gtk
5
6 # The top-level SGML file.
7 DOC_MAIN_SGML_FILE=gtk-docs.sgml
8
9 # The directory containing the source code. Relative to $(srcdir)
10 DOC_SOURCE_DIR=../../../gtk
11
12 # Extra options to supply to gtkdoc-scan
13 SCAN_OPTIONS=--deprecated-guards="GTK_ENABLE_BROKEN|GTK_DISABLE_DEPRECATED" 
14
15 # Extra options to supply to gtkdoc-mkdb
16 MKDB_OPTIONS=
17
18 # Extra options to supply to gtkdoc-fixref
19 FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html
20
21 # Used for dependencies
22 HFILE_GLOB=$(top_srcdir)/gtk/*.h
23 CFILE_GLOB=$(top_srcdir)/gtk/*.c
24
25 # Header files to ignore when scanning
26 IGNORE_HFILES=                  \
27         fnmatch.h               \
28         gdk-pixbuf-loader.h     \
29         gtkdebug.h              \
30         gtkhsv.h                \
31         gtkimmodule.h           \
32         gtkimcontextsimple.h    \
33         gtkintl.h               \
34         gtkmarshal.h            \
35         gtkprivate.h            \
36         gtktreeprivate.h        \
37         gtkrbtree.h             \
38         gtktreedatalist.h       \
39         gtktextbtree.h          \
40         gtktextchild.h          \
41         gtktextdisplay.h        \
42         gtktextiterprivate.h    \
43         gtktextlayout.h         \
44         gtktextmarkprivate.h    \
45         gtktextsegment.h        \
46         gtktexttagprivate.h     \
47         gtktexttypes.h          \
48         gtktypebuiltins.h
49
50 # Images to copy into HTML directory
51 HTML_IMAGES =
52
53 # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE)
54 content_files =                 \
55         compiling.sgml          \
56         framebuffer.sgml        \
57         objects_grouped.sgml    \
58         text_widget.sgml        \
59         tree_widget.sgml
60
61 # Other files to distribute
62 extra_files =
63
64 # CFLAGS and LDFLAGS for compiling scan program. Only needed
65 # if $(DOC_MODULE).types is non-empty.
66 GTKDOC_CFLAGS = @STRIP_BEGIN@                           \
67         @CFLAGS@                                        \
68         -I$(top_srcdir)                                 \
69         -I$(top_builddir)/gdk                           \
70         -DGTK_DISABLE_COMPAT_H                          \
71         @GTK_DEBUG_FLAGS@                               \
72         @GTK_XIM_FLAGS@                                 \
73         @GTK_LOCALE_FLAGS@                              \
74         @PANGO_CFLAGS@                                  \
75         @GLIB_CFLAGS@                                   \
76         @more_cflags@                                   \
77 @STRIP_END@
78
79 GTKDOC_LIBS = @STRIP_BEGIN@                             \
80         $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-1.3.la \
81         $(top_builddir)/gdk/@gdktargetlib@              \
82         $(top_builddir)/gtk/@gtktargetlib@              \
83         @more_ldflags@                                  \
84         @more_libs@                                     \
85         @GDK_WLIBS@                                     \
86         @PANGO_LIBS@                                    \
87         @GLIB_LIBS@                                     \
88         @GTK_LIBS_EXTRA@                                \
89         -lm                                             \
90 @STRIP_END@
91
92 GTKDOC_CC=$(LIBTOOL) --mode=compile $(CC)
93 GTKDOC_LD=$(LIBTOOL) --mode=link $(CC)
94
95
96 ####################################
97 # Everything below here is generic #
98 ####################################
99
100 TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
101
102 EXTRA_DIST =                            \
103         $(content_files)                \
104         $(extra_files)                  \
105         $(HTML_IMAGES)                  \
106         $(DOC_MAIN_SGML_FILE)           \
107         $(DOC_MODULE).types             \
108         $(DOC_MODULE)-sections.txt      \
109         $(DOC_MODULE)-overrides.txt
110
111 DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
112            $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp
113
114 SCANOBJ_FILES =                 \
115         $(DOC_MODULE).args      \
116         $(DOC_MODULE).hierarchy \
117         $(DOC_MODULE).signals
118
119 if ENABLE_GTK_DOC
120 all-local: html-build.stamp
121
122 #### scan ####
123
124 scan-build.stamp: $(HFILE_GLOB)
125         @echo '*** Scanning header files ***'
126         cd $(srcdir) && ( \
127         if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null ; then \
128             CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj --module=$(DOC_MODULE) ; \
129         else \
130             for i in $(SCANOBJ_FILES) ; do \
131                test -f $$i || touch $$i ; \
132             done \
133         fi )
134         cd $(srcdir) && \
135           gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES)
136         touch scan-build.stamp
137
138 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp
139         @true
140
141 #### templates ####
142
143 tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
144         @echo '*** Rebuilding template files ***'
145         cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE)
146         touch tmpl-build.stamp
147
148 tmpl.stamp: tmpl-build.stamp
149         @true
150
151 #### sgml ####
152
153 sgml-build.stamp: tmpl.stamp $(CFILE_GLOB) tmpl/*.sgml
154         @echo '*** Building SGML ***'
155         cd $(srcdir) && \
156         gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) $(MKDB_OPTIONS)
157         touch sgml-build.stamp
158
159 sgml.stamp: sgml-build.stamp
160         @true
161
162 #### html ####
163
164 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
165         @echo '*** Building HTML ***'
166         test -d $(srcdir)/html || mkdir $(srcdir)/html
167         cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
168         test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
169         @echo '-- Fixing Crossreferences' 
170         cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
171         touch html-build.stamp
172 endif
173
174 ##############
175
176 clean-local:
177         rm -f *~ *.bak $(SCANOBJ_FILES) *-unused.txt $(DOC_STAMPS)
178
179 maintainer-clean-local: clean
180         cd $(srcdir) && rm -rf sgml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
181
182 install-data-local:
183         $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
184         (installfiles=`echo $(srcdir)/html/*.html`; \
185         if test "$$installfiles" = '$(srcdir)/html/*.html'; \
186         then echo '-- Nothing to install' ; \
187         else \
188           for i in $$installfiles; do \
189             echo '-- Installing '$$i ; \
190             $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
191           done; \
192           echo '-- Installing $(srcdir)/html/index.sgml' ; \
193           $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR); \
194         fi)
195
196 #
197 # Require gtk-doc when making dist
198 #
199 if ENABLE_GTK_DOC
200 dist-check-gtkdoc:
201 else
202 dist-check-gtkdoc:
203         @echo "*** gtk-doc must be installed and enabled in order to make dist"
204         @false
205 endif
206
207 dist-hook: dist-check-gtkdoc dist-hook-local
208         mkdir $(distdir)/tmpl
209         mkdir $(distdir)/sgml
210         mkdir $(distdir)/html
211         -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
212         -cp $(srcdir)/sgml/*.sgml $(distdir)/sgml
213         -cp $(srcdir)/sgml/*.bottom $(srcdir)/sgml/*.top $(distdir)/sgml
214         -cp $(srcdir)/html/index.sgml $(distdir)/html
215         -cp $(srcdir)/html/*.html $(srcdir)/html/*.css $(distdir)/html
216
217 #       for i in $(HTML_IMAGES) ; do          \
218 #         cp $(srcdir)/$$i $(distdir)/html ;  \
219 #       done
220
221 .PHONY : dist-hook-local