]> Pileus Git - ~andy/gtk/blob - docs/reference/gdk/Makefile.am
Markup fixes
[~andy/gtk] / docs / reference / gdk / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2
3 # The name of the module.
4 DOC_MODULE=gdk
5
6 # The top-level SGML file.
7 DOC_MAIN_SGML_FILE=gdk-docs.sgml
8
9 # The directory containing the source code. Relative to $(srcdir)
10 DOC_SOURCE_DIR=../../../gdk
11
12 # Extra options to supply to gtkdoc-scan
13 SCAN_OPTIONS=--deprecated-guards="GDK_ENABLE_BROKEN|GDK_DISABLE_DEPRECATED"
14
15 # Extra options to supply to gtkdoc-mkdb
16 MKDB_OPTIONS=--sgml-mode --output-format=xml
17
18 # Extra options to supply to gtkdoc-fixref
19 FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html
20
21 # Used for dependencies
22 HFILE_GLOB=$(top_srcdir)/gdk/*.h $(top_srcdir)/gdk/x11/gdkx.h
23 CFILE_GLOB=$(top_srcdir)/gdk/*.c
24
25 # Header files to ignore when scanning
26 IGNORE_HFILES=                  \
27         gdkkeysyms.h            \
28         gdkinternals.h          \
29         gdkprivate.h            \
30         gdkpoly-generic.h       \
31         gdkregion-generic.h     \
32         linux-fb                \
33         nanox                   \
34         win32                   \
35         x11
36
37 # Extra files to add when scanning (relative to $srcdir)
38 EXTRA_HFILES=                   \
39         ../../../gdk/x11/gdkx.h 
40
41 # Images to copy into HTML directory
42 HTML_IMAGES =                           \
43         images/X_cursor.png             \
44         images/arrow.png                \
45         images/based_arrow_down.png     \
46         images/based_arrow_up.png       \
47         images/boat.png                 \
48         images/bogosity.png             \
49         images/bottom_left_corner.png   \
50         images/bottom_right_corner.png  \
51         images/bottom_side.png          \
52         images/bottom_tee.png           \
53         images/box_spiral.png           \
54         images/center_ptr.png           \
55         images/circle.png               \
56         images/clock.png                \
57         images/coffee_mug.png           \
58         images/cross.png                \
59         images/cross_reverse.png        \
60         images/crosshair.png            \
61         images/diamond_cross.png        \
62         images/dot.png                  \
63         images/dotbox.png               \
64         images/double_arrow.png         \
65         images/draft_large.png          \
66         images/draft_small.png          \
67         images/draped_box.png           \
68         images/exchange.png             \
69         images/fleur.png                \
70         images/gobbler.png              \
71         images/gumby.png                \
72         images/hand1.png                \
73         images/hand2.png                \
74         images/heart.png                \
75         images/icon.png                 \
76         images/iron_cross.png           \
77         images/left_ptr.png             \
78         images/left_side.png            \
79         images/left_tee.png             \
80         images/leftbutton.png           \
81         images/ll_angle.png             \
82         images/lr_angle.png             \
83         images/man.png                  \
84         images/middlebutton.png         \
85         images/mouse.png                \
86         images/pencil.png               \
87         images/pirate.png               \
88         images/plus.png                 \
89         images/question_arrow.png       \
90         images/right_ptr.png            \
91         images/right_side.png           \
92         images/right_tee.png            \
93         images/rightbutton.png          \
94         images/rtl_logo.png             \
95         images/sailboat.png             \
96         images/sb_down_arrow.png        \
97         images/sb_h_double_arrow.png    \
98         images/sb_left_arrow.png        \
99         images/sb_right_arrow.png       \
100         images/sb_up_arrow.png          \
101         images/sb_v_double_arrow.png    \
102         images/shuttle.png              \
103         images/sizing.png               \
104         images/spider.png               \
105         images/spraycan.png             \
106         images/star.png                 \
107         images/target.png               \
108         images/tcross.png               \
109         images/top_left_arrow.png       \
110         images/top_left_corner.png      \
111         images/top_right_corner.png     \
112         images/top_side.png             \
113         images/top_tee.png              \
114         images/trek.png                 \
115         images/ul_angle.png             \
116         images/umbrella.png             \
117         images/ur_angle.png             \
118         images/watch.png                \
119         images/xterm.png 
120
121 # Extra SGML files that are included by DOC_MAIN_SGML_FILE
122 content_files =
123
124 # Other files to distribute
125 extra_files =
126
127 # CFLAGS and LDFLAGS for compiling scan program. Only needed
128 # if $(DOC_MODULE).types is non-empty.
129 GTKDOC_CFLAGS = @STRIP_BEGIN@                           \
130         @CFLAGS@                                        \
131         -I$(top_srcdir)                                 \
132         -I$(top_builddir)                               \
133         -I$(top_builddir)/gdk                           \
134         @GTK_DEBUG_FLAGS@                               \
135         @GDK_DEP_CFLAGS@                                \
136 @STRIP_END@
137
138 GTKDOC_LIBS = @STRIP_BEGIN@                                             \
139         $(top_builddir)/gdk/@gdktargetlib@                              \
140 @STRIP_END@
141
142 # Commands for compiling and linking 
143 GTKDOC_CC=$(LIBTOOL) --mode=compile $(CC)
144 GTKDOC_LD=$(LIBTOOL) --mode=link $(CC)
145
146
147 ####################################
148 # Everything below here is generic #
149 ####################################
150
151 # We set GPATH here; this gives us semantics for GNU make
152 # which are more like other make's VPATH, when it comes to
153 # whether a source that is a target of one rule is then
154 # searched for in VPATH/GPATH.
155 #
156 GPATH = $(srcdir)
157
158 TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
159
160 EXTRA_DIST =                            \
161         $(content_files)                \
162         $(extra_files)                  \
163         $(HTML_IMAGES)                  \
164         $(DOC_MAIN_SGML_FILE)           \
165         $(DOC_MODULE).types             \
166         $(DOC_MODULE)-sections.txt      \
167         $(DOC_MODULE)-overrides.txt
168
169 DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
170            $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp
171
172 SCANOBJ_FILES =                 \
173         $(DOC_MODULE).args      \
174         $(DOC_MODULE).hierarchy \
175         $(DOC_MODULE).signals
176
177 if ENABLE_GTK_DOC
178 all-local: html-build.stamp
179
180 #### scan ####
181
182 scan-build.stamp: $(HFILE_GLOB)
183         @echo '*** Scanning header files ***'
184         if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null ; then \
185             CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \
186         else \
187             cd $(srcdir) ; \
188             for i in $(SCANOBJ_FILES) ; do \
189                test -f $$i || touch $$i ; \
190             done \
191         fi
192         cd $(srcdir) && \
193           gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES)
194         touch scan-build.stamp
195
196 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp
197         @true
198
199 #### templates ####
200
201 tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
202         @echo '*** Rebuilding template files ***'
203         cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE)
204         touch tmpl-build.stamp
205
206 tmpl.stamp: tmpl-build.stamp
207         @true
208
209 #### sgml ####
210
211 sgml-build.stamp: tmpl.stamp $(CFILE_GLOB) $(srcdir)/tmpl/*.sgml
212         @echo '*** Building SGML ***'
213         cd $(srcdir) && \
214         gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) $(MKDB_OPTIONS)
215         touch sgml-build.stamp
216
217 sgml.stamp: sgml-build.stamp
218         @true
219
220 #### html ####
221
222 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
223         @echo '*** Building HTML ***'
224         rm -rf $(srcdir)/html 
225         mkdir $(srcdir)/html
226         cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
227         test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
228         @echo '-- Fixing Crossreferences' 
229         cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
230         touch html-build.stamp
231 endif
232
233 ##############
234
235 clean-local:
236         rm -f *~ *.bak $(SCANOBJ_FILES) *-unused.txt $(DOC_STAMPS)
237
238 maintainer-clean-local: clean
239         cd $(srcdir) && rm -rf sgml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
240
241 install-data-local:
242         $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
243         (installfiles=`echo $(srcdir)/html/*`; \
244         if test "$$installfiles" = '$(srcdir)/html/*'; \
245         then echo '-- Nothing to install' ; \
246         else \
247           for i in $$installfiles; do \
248             echo '-- Installing '$$i ; \
249             $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
250           done; \
251           echo '-- Installing $(srcdir)/html/index.sgml' ; \
252           $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR); \
253         fi)
254
255 #
256 # Require gtk-doc when making dist
257 #
258 if ENABLE_GTK_DOC
259 dist-check-gtkdoc:
260 else
261 dist-check-gtkdoc:
262         @echo "*** gtk-doc must be installed and enabled in order to make dist"
263         @false
264 endif
265
266 dist-hook: dist-check-gtkdoc dist-hook-local
267         mkdir $(distdir)/tmpl
268         mkdir $(distdir)/sgml
269         mkdir $(distdir)/html
270         -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
271         -cp $(srcdir)/sgml/*.sgml $(distdir)/sgml
272         -cp $(srcdir)/html/* $(distdir)/html
273
274 .PHONY : dist-hook-local