]> Pileus Git - ~andy/gtk/blob - docs/reference/gdk/Makefile.am
Released Gtk+-1.3.3.
[~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 (if it contains documentation).
10 DOC_SOURCE_DIR=$(top_srcdir)/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=
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
38 EXTRA_HFILES=                   \
39         $(top_srcdir)/gdk/x11/gdkx.h 
40
41 # Images to copy into HTML directory
42 HTML_IMAGES =
43
44 # Extra SGML files that are included by DOC_MAIN_SGML_FILE
45 content_files =
46
47 # Other files to distribute
48 extra_files =
49
50 # CFLAGS and LDFLAGS for compiling scan program. Only needed
51 # if $(DOC_MODULE).types is non-empty.
52 GTKDOC_CFLAGS =
53 GTKDOC_LIBS =
54
55 # Commands for compiling and linking 
56 GTKDOC_CC=$(LIBTOOL) --mode=compile $(CC)
57 GTKDOC_LD=$(LIBTOOL) --mode=link $(CC)
58
59
60 ####################################
61 # Everything below here is generic #
62 ####################################
63
64 TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
65
66 EXTRA_DIST =                            \
67         $(content_files)                \
68         $(extra_files)                  \
69         $(HTML_IMAGES)                  \
70         $(DOC_MAIN_SGML_FILE)           \
71         $(DOC_MODULE).types             \
72         $(DOC_MODULE)-sections.txt      \
73         $(DOC_MODULE)-overrides.txt
74
75 DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
76            $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp
77
78 SCANOBJ_FILES =                 \
79         $(DOC_MODULE).args      \
80         $(DOC_MODULE).hierarchy \
81         $(DOC_MODULE).signals
82
83 if ENABLE_GTK_DOC
84 all-local: html-build.stamp
85
86 #### scan ####
87
88 scan-build.stamp: $(HFILE_GLOB)
89         @echo '*** Scanning header files ***'
90         cd $(srcdir) && ( \
91         if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null ; then \
92             CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj --module=$(DOC_MODULE) ; \
93         else \
94             for i in $(SCANOBJ_FILES) ; do \
95                test -f $$i || touch $$i ; \
96             done \
97         fi )
98         cd $(srcdir) && \
99           gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES)
100         touch scan-build.stamp
101
102 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp
103         @true
104
105 #### templates ####
106
107 tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
108         @echo '*** Rebuilding template files ***'
109         cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE)
110         touch tmpl-build.stamp
111
112 tmpl.stamp: tmpl-build.stamp
113         @true
114
115 #### sgml ####
116
117 sgml-build.stamp: tmpl.stamp $(CFILE_GLOB) tmpl/*.sgml
118         @echo '*** Building SGML ***'
119         cd $(srcdir) && \
120         gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) $(MKDB_OPTIONS)
121         touch sgml-build.stamp
122
123 sgml.stamp: sgml-build.stamp
124         @true
125
126 #### html ####
127
128 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
129         @echo '*** Building HTML ***'
130         test -d $(srcdir)/html || mkdir $(srcdir)/html
131         cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
132         test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
133         @echo '-- Fixing Crossreferences' 
134         cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
135         touch html-build.stamp
136 endif
137
138 ##############
139
140 clean-local:
141         rm -f *~ *.bak $(SCANOBJ_FILES) *-unused.txt $(DOC_STAMPS)
142
143 maintainer-clean-local: clean
144         cd $(srcdir) && rm -rf sgml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
145
146 install-data-local:
147         $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
148         (installfiles=`echo $(srcdir)/html/*.html`; \
149         if test "$$installfiles" = '$(srcdir)/html/*.html'; \
150         then echo '-- Nothing to install' ; \
151         else \
152           for i in $$installfiles; do \
153             echo '-- Installing '$$i ; \
154             $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
155           done; \
156           echo '-- Installing $(srcdir)/html/index.sgml' ; \
157           $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR); \
158         fi)
159
160 #
161 # Require gtk-doc when making dist
162 #
163 if ENABLE_GTK_DOC
164 dist-check-gtkdoc:
165 else
166 dist-check-gtkdoc:
167         @echo "*** gtk-doc must be installed and enabled in order to make dist"
168         @false
169 endif
170
171 dist-hook: dist-check-gtkdoc dist-hook-local
172         mkdir $(distdir)/tmpl
173         mkdir $(distdir)/sgml
174         mkdir $(distdir)/html
175         -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
176         -cp $(srcdir)/sgml/*.sgml $(distdir)/sgml
177         -cp $(srcdir)/sgml/*.bottom $(srcdir)/sgml/*.top $(distdir)/sgml
178         -cp $(srcdir)/html/index.sgml $(distdir)/html
179         -cp $(srcdir)/html/*.html $(srcdir)/html/*.css $(distdir)/html
180
181 #       for i in $(HTML_IMAGES) ; do          \
182 #         cp $(srcdir)/$$i $(distdir)/html ;  \
183 #       done
184
185 .PHONY : dist-hook-local