]> Pileus Git - ~andy/gtk/blob - docs/reference/gdk-pixbuf/Makefile.am
9738e3e9a6f78bb9ca5525e50293f23a6a3990d8
[~andy/gtk] / docs / reference / gdk-pixbuf / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2
3 # The name of the module.
4 DOC_MODULE=gdk-pixbuf
5
6 # The top-level SGML file.
7 DOC_MAIN_SGML_FILE=gdk-pixbuf.sgml
8
9 # The directory containing the source code. Relative to $(srcdir)
10 DOC_SOURCE_DIR=../../../gdk-pixbuf
11
12 # Extra options to supply to gtkdoc-scan
13 SCAN_OPTIONS=--source-dir=../../../contrib/gdk-pixbuf-xlib --deprecated-guards="GDK_PIXBUF_ENABLE_BROKEN|GDK_PIXBUF_DISABLE_DEPRECATED"
14
15 # Extra options to supply to gtkdoc-mkdb
16 MKDB_OPTIONS=--main-sgml-file=$(DOC_MAIN_SGML_FILE) --sgml-mode --source-dir=../../../contrib/gdk-pixbuf-xlib --output-format=xml
17
18 # Extra options to supply to gtkdoc-fixref
19 FIXXREF_OPTIONS=
20
21 # Used for dependencies
22 HFILE_GLOB=$(top_srcdir)/gdk-pixbuf/*.h $(top_srcdir)/contrib/gdk-pixbuf-xlib/*.h
23 CFILE_GLOB=$(top_srcdir)/gdk-pixbuf/*.c $(top_srcdir)/contrib/gdk-pixbuf-xlib/*.c
24
25 # Header files to ignore when scanning
26 IGNORE_HFILES=                          \
27         pixops                          \
28         gdk-pixbuf-marshal.h            \
29         gdk-pixbuf-xlib-private.h       \
30         gdk-pixbuf-i18n.h               \
31         gdk-pixbuf-private.h            \
32         io-gif-animation.h              \
33         io-ani-animation.h              \
34         test-images.h
35
36 # Extra files to add when scanning
37 EXTRA_HFILES=
38
39 # Images to copy into HTML directory
40 HTML_IMAGES = 
41
42 # Extra SGML files that are included by DOC_MAIN_SGML_FILE
43 content_files =                         \
44         version.xml                     \
45         gdk-pixbuf-from-drawables.sgml  \
46         gdk-pixbuf-rendering.sgml       \
47         gdk-pixbuf.sgml                 \
48         porting-from-imlib.sgml
49
50 # Other files to distribute
51 extra_files = version.xml.in
52
53 # CFLAGS and LDFLAGS for compiling scan program. Only needed
54 # if $(DOC_MODULE).types is non-empty.
55 GTKDOC_CFLAGS = @STRIP_BEGIN@                           \
56         @CFLAGS@                                        \
57         -I$(top_srcdir)                                 \
58         -I$(top_builddir)                               \
59         -I$(top_builddir)/gdk                           \
60         @GTK_DEBUG_FLAGS@                               \
61         @GTK_DEP_CFLAGS@                                \
62 @STRIP_END@
63
64 GTKDOC_LIBS = @STRIP_BEGIN@                                             \
65         $(top_builddir)/gdk-pixbuf/libgdk_pixbuf-$(GTK_API_VERSION).la  \
66         $(top_builddir)/gdk/@gdktargetlib@                              \
67         $(top_builddir)/gtk/@gtktargetlib@                              \
68         @GTK_DEP_LIBS@                                                  \
69 @STRIP_END@
70
71 GTKDOC_CC=$(LIBTOOL) --mode=compile $(CC)
72 GTKDOC_LD=$(LIBTOOL) --mode=link $(CC)
73
74
75 ####################################
76 # Everything below here is generic #
77 ####################################
78
79 # We set GPATH here; this gives us semantics for GNU make
80 # which are more like other make's VPATH, when it comes to
81 # whether a source that is a target of one rule is then
82 # searched for in VPATH/GPATH.
83 #
84 GPATH = $(srcdir)
85
86 TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
87
88 EXTRA_DIST =                            \
89         $(content_files)                \
90         $(extra_files)                  \
91         $(HTML_IMAGES)                  \
92         $(DOC_MAIN_SGML_FILE)           \
93         $(DOC_MODULE).types             \
94         $(DOC_MODULE)-sections.txt      \
95         $(DOC_MODULE)-overrides.txt
96
97 DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
98            $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp
99
100 SCANOBJ_FILES =                  \
101         $(DOC_MODULE).args       \
102         $(DOC_MODULE).hierarchy  \
103         $(DOC_MODULE).interfaces \
104         $(DOC_MODULE).prerequisites \
105         $(DOC_MODULE).signals
106
107 if ENABLE_GTK_DOC
108 all-local: html-build.stamp
109
110 #### scan ####
111
112 scan-build.stamp: $(HFILE_GLOB)
113         @echo '*** Scanning header files ***'
114         if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null ; then \
115             CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \
116         else \
117             cd $(srcdir) ; \
118             for i in $(SCANOBJ_FILES) ; do \
119                test -f $$i || touch $$i ; \
120             done \
121         fi
122         cd $(srcdir) && \
123           gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES)
124         touch scan-build.stamp
125
126 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp
127         @true
128
129 #### templates ####
130
131 tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
132         @echo '*** Rebuilding template files ***'
133         cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE)
134         touch tmpl-build.stamp
135
136 tmpl.stamp: tmpl-build.stamp
137         @true
138
139 #### sgml ####
140
141 sgml-build.stamp: tmpl.stamp $(CFILE_GLOB) $(srcdir)/tmpl/*.sgml
142         @echo '*** Building SGML ***'
143         cd $(srcdir) && \
144         gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) $(MKDB_OPTIONS)
145         touch sgml-build.stamp
146
147 sgml.stamp: sgml-build.stamp
148         @true
149
150 #### html ####
151
152 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
153         @echo '*** Building HTML ***'
154         rm -rf $(srcdir)/html 
155         mkdir $(srcdir)/html
156         cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
157         test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
158         @echo '-- Fixing Crossreferences' 
159         cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
160         touch html-build.stamp
161 endif
162
163 ##############
164
165 clean-local:
166         rm -f *~ *.bak $(SCANOBJ_FILES) *-unused.txt $(DOC_STAMPS)
167
168 maintainer-clean-local: clean
169         cd $(srcdir) && rm -rf sgml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
170
171 install-data-local:
172         $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
173         (installfiles=`echo $(srcdir)/html/*`; \
174         if test "$$installfiles" = '$(srcdir)/html/*'; \
175         then echo '-- Nothing to install' ; \
176         else \
177           for i in $$installfiles; do \
178             echo '-- Installing '$$i ; \
179             $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
180           done; \
181           echo '-- Installing $(srcdir)/html/index.sgml' ; \
182           $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR); \
183         fi)
184
185 #
186 # Require gtk-doc when making dist
187 #
188 if ENABLE_GTK_DOC
189 dist-check-gtkdoc:
190 else
191 dist-check-gtkdoc:
192         @echo "*** gtk-doc must be installed and enabled in order to make dist"
193         @false
194 endif
195
196 dist-hook: dist-check-gtkdoc dist-hook-local
197         mkdir $(distdir)/tmpl
198         mkdir $(distdir)/xml
199         mkdir $(distdir)/html
200         -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
201         -cp $(srcdir)/xml/*.xml $(distdir)/xml
202         -cp $(srcdir)/html/* $(distdir)/html
203
204 .PHONY : dist-hook-local