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