Some further makefile improvement.
[platform/upstream/glib.git] / docs / reference / glib / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2
3 # The name of the module.
4 DOC_MODULE=glib
5
6 # The top-level SGML file.
7 DOC_MAIN_SGML_FILE=glib-docs.sgml
8
9 # The directory containing the source code
10 DOC_SOURCE_DIR=$(top_srcdir)
11
12 # Extra options to supply to gtkdoc-fixref
13 FIXXREF_OPTIONS=
14
15 # Headers to ignore
16 IGNORE_HFILES=                  \
17         gobject                 \
18         config.h                \
19         gmoduleconf.h           \
20         gunidecomp.h            \
21         gunichartables.h        \
22         glibconfig-sysdefs.h
23
24 tmpl_sources =                          \
25         tmpl/allocators.sgml            \
26         tmpl/arrays.sgml                \
27         tmpl/arrays_byte.sgml           \
28         tmpl/arrays_pointer.sgml        \
29         tmpl/async_queues.sgml          \
30         tmpl/byte_order.sgml            \
31         tmpl/caches.sgml                \
32         tmpl/completion.sgml            \
33         tmpl/datalist.sgml              \
34         tmpl/datasets.sgml              \
35         tmpl/date.sgml                  \
36         tmpl/error_reporting.sgml       \
37         tmpl/glib-unused.sgml           \
38         tmpl/hash_tables.sgml           \
39         tmpl/hooks.sgml                 \
40         tmpl/iochannels.sgml            \
41         tmpl/limits.sgml                \
42         tmpl/linked_lists_double.sgml   \
43         tmpl/linked_lists_single.sgml   \
44         tmpl/macros.sgml                \
45         tmpl/macros_misc.sgml           \
46         tmpl/main.sgml                  \
47         tmpl/memory.sgml                \
48         tmpl/memory_chunks.sgml         \
49         tmpl/messages.sgml              \
50         tmpl/misc_utils.sgml            \
51         tmpl/modules.sgml               \
52         tmpl/numerical.sgml             \
53         tmpl/quarks.sgml                \
54         tmpl/queue.sgml                 \
55         tmpl/random_numbers.sgml        \
56         tmpl/relations.sgml             \
57         tmpl/scanner.sgml               \
58         tmpl/string_chunks.sgml         \
59         tmpl/string_utils.sgml          \
60         tmpl/strings.sgml               \
61         tmpl/thread_pools.sgml          \
62         tmpl/threads.sgml               \
63         tmpl/timers.sgml                \
64         tmpl/trash_stack.sgml           \
65         tmpl/trees-binary.sgml          \
66         tmpl/trees-nary.sgml            \
67         tmpl/type_conversion.sgml       \
68         tmpl/types.sgml                 \
69         tmpl/unicode.sgml               \
70         tmpl/warnings.sgml              \
71         tmpl/windows.sgml
72
73
74 ####################################
75 # Everything below here is generic #
76 ####################################
77
78 TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
79
80 EXTRA_DIST =                            \
81         $(DOC_MAIN_SGML_FILE)           \
82         $(DOC_MODULE)-sections.txt      \
83         $(DOC_MODULE)-overrides.txt
84
85 if ENABLE_GTK_DOC
86 all-local: html/index.html
87
88 $(DOC_MODULE)-decl.txt: 
89         $(MAKE) scan
90
91 $(tmpl_sources): $(DOC_MODULE)-decl.txt $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
92         $(MAKE) templates
93
94 sgml/$(DOC_MODULE)-doc.bottom: $(tmpl_sources) $(DOC_MODULE)-decl.txt
95         $(MAKE) sgml
96
97 html/index.html: sgml/$(DOC_MODULE)-doc.bottom $(DOC_MAIN_SGML_FILE)
98         $(MAKE) html
99 endif
100
101 scan:
102         -(cd $(srcdir) \
103         && gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" )
104
105 templates: 
106         cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE)
107
108 sgml:
109         cd $(srcdir) \
110         && gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR)
111
112 html:
113         test -d $(srcdir)/html || mkdir $(srcdir)/html
114         -cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
115         @echo '-- Fixing Crossreferences' 
116         gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIOJNS)
117
118 clean-local:
119         rm -f *~ *.bak *.signals *-unused.txt
120
121 maintainer-clean-local: clean
122         cd $(srcdir) && rm -rf sgml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
123
124 install-data-local:
125         $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
126         (installfiles=`echo $(srcdir)/html/*.html`; \
127         if test "$$installfiles" = '$(srcdir)/html/*.html'; \
128         then echo '-- Nothing to install' ; \
129         else \
130           for i in $$installfiles; do \
131             echo '-- Installing '$$i ; \
132             $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
133           done; \
134           echo '-- Installing $(srcdir)/html/index.sgml' ; \
135           $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR); \
136         fi)
137
138 #
139 # Require gtk-doc when making dist
140 #
141 if ENABLE_GTK_DOC
142 dist-check-gtkdoc:
143 else
144 dist-check-gtkdoc:
145         @echo "*** gtk-doc must be installed and enabled in order to make dist
146         @false
147 endif
148
149 dist-hook: dist-check-gtkdoc
150         mkdir $(distdir)/html
151         mkdir $(distdir)/sgml
152         mkdir $(distdir)/tmpl
153         -cp $(srcdir)/html/*.html $(srcdir)/html/*.css $(distdir)/html
154         -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
155         -cp $(srcdir)/sgml/*.sgml $(distdir)/sgml
156         -cp $(srcdir)/sgml/*.bottom $(srcdir)/sgml/*.top $(distdir)/sgml
157
158 .PHONY : html sgml templates scan