Initial checkins and mods for gtk-doc generation for C bindings.
[platform/core/uifw/at-spi2-atk.git] / docs / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2
3 EXTRA_DIST = Makefile.am at-spi-docs.sgml at-spi-sections.txt
4
5 # The name of the module.
6 DOC_MODULE=at-spi
7
8 # The top-level SGML file.
9 DOC_MAIN_SGML_FILE=at-spi-docs.sgml
10
11 # The directory containing the source code (if it contains documentation).
12 DOC_SOURCE_DIR=../cspi
13
14 INSTALLDIR=$(prefix)/share/gtk-doc
15
16 HTML_DIR = ${datadir}/gtk-doc/html
17
18 TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
19
20 # Images to copy into HTML directory
21 HTML_IMAGES =
22
23 # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE)
24 content_files =
25
26 # Other files to distribute
27 extra_files =
28
29 ####################################
30 # Everything below here is generic #
31 ####################################
32
33 # We set GPATH here; this gives us semantics for GNU make
34 # which are more like other make's VPATH, when it comes to
35 # whether a source that is a target of one rule is then
36 # searched for in VPATH/GPATH.
37 #
38 GPATH = $(srcdir)
39
40 TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
41
42 EXTRA_DIST =                            \
43         $(content_files)                \
44         $(extra_files)                  \
45         $(HTML_IMAGES)                  \
46         $(DOC_MAIN_SGML_FILE)           \
47         $(DOC_MODULE)-sections.txt      \
48         $(DOC_MODULE)-overrides.txt
49
50 DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \           $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp
51
52 SCANOBJ_FILES =                 \
53         $(DOC_MODULE).args      \
54         $(DOC_MODULE).hierarchy \
55         $(DOC_MODULE).signals
56
57 if ENABLE_GTK_DOC
58 all-local: html-build.stamp
59
60 #### scan ####
61
62 scan-build.stamp: $(HFILE_GLOB)
63         @echo '*** Scanning header files ***'
64         if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null ; then \
65             CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \
66                 else \
67         cd $(srcdir) ; \
68         for i in $(SCANOBJ_FILES) ; do \
69                 test -f $$i || touch $$i ; \
70         done \
71         fi
72         cd $(srcdir) && \
73           gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES)
74         touch scan-build.stamp
75
76 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp
77         @true
78
79 #### templates ####
80
81 tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
82         @echo '*** Rebuilding template files ***'
83         cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE)
84         touch tmpl-build.stamp
85
86 tmpl.stamp: tmpl-build.stamp
87         @true
88
89 #### sgml ####
90
91 sgml-build.stamp: tmpl.stamp $(CFILE_GLOB) $(srcdir)/tmpl/*.sgml
92         @echo '*** Building SGML ***'
93         cd $(srcdir) && \
94         gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) $(MKDB_OPTIONS)
95         touch sgml-build.stamp
96
97 sgml.stamp: sgml-build.stamp
98         @true
99
100 #### html ####
101
102 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
103         @echo '*** Building HTML ***'
104         test -d $(srcdir)/html || mkdir $(srcdir)/html
105         cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
106         test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
107         @echo '-- Fixing Crossreferences'
108         cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
109         touch html-build.stamp
110 endif
111
112 ##############
113
114 clean-local:
115         rm -f *~ *.bak $(SCANOBJ_FILES) *-unused.txt $(DOC_STAMPS)
116
117 maintainer-clean-local: clean
118         cd $(srcdir) && rm -rf sgml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
119
120 install-data-local:
121         $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
122         (installfiles=`echo $(srcdir)/html/*.html`; \
123         if test "$$installfiles" = '$(srcdir)/html/*.html'; \
124         then echo '-- Nothing to install' ; \
125         else \
126           for i in $$installfiles; do \
127         echo '-- Installing '$$i ; \
128         $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
129           done; \
130           echo '-- Installing $(srcdir)/html/index.sgml' ; \
131           $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR); \
132         fi)
133
134 #
135 # Require gtk-doc when making dist
136 #
137 if ENABLE_GTK_DOC
138 dist-check-gtkdoc:
139 else
140 dist-check-gtkdoc:
141         @echo "*** gtk-doc must be installed and enabled in order to make dist"
142         @false
143 endif
144
145 dist-hook: dist-check-gtkdoc dist-hook-local
146         mkdir $(distdir)/tmpl
147         mkdir $(distdir)/sgml
148         mkdir $(distdir)/html
149         -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
150         -cp $(srcdir)/sgml/*.sgml $(distdir)/sgml
151         cp $(srcdir)/html/index.sgml $(distdir)/html
152         -cp $(srcdir)/html/*.html $(srcdir)/html/*.css $(distdir)/html
153
154         images=$(HTML_IMAGES) ;                 \
155         for i in $$images ; do                  \
156           cp $(srcdir)/$$i $(distdir)/html ;  \
157         done
158
159 .PHONY : html sgml templates scan dist-hook-local