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