fc845c32cb86a5485760ce0efe7e3215550c0abb
[hildon] / doc / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2
3 # This is a blank Makefile.am for using gtk-doc.
4 # Copy this to your project's API docs directory and modify the variables to
5 # suit your project. See the GTK+ Makefiles in gtk+/docs/reference for examples
6 # of using the various options.
7
8 # The name of the module, e.g. 'glib'.
9 DOC_MODULE=hildon-libs
10
11 # The top-level SGML file. Change it if you want.
12 DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml
13
14 # The directory containing the source code. Relative to $(srcdir).
15 # gtk-doc will search all .c & .h files beneath here for inline comments
16 # documenting functions and macros.
17 DOC_SOURCE_DIR=../hildon-widgets
18
19 # Extra options to pass to gtkdoc-scanobj or gtkdoc-scangobj.
20 SCANOBJ_OPTIONS=--type-init-func="gtk_type_init(0)"
21
22 # Extra options to supply to gtkdoc-scan.
23 SCAN_OPTIONS=
24
25 # Header files to ignore when scanning.
26 IGNORE_HFILES=*private* config.h ut md5.h hildon-volumebar-range.h hildon-volumebar-private.h \
27                 hildon-app-private.h
28
29 # Files to ignore when making the DB.
30 IGNORE_FILES=$(IGNORE_HFILES)
31
32 # Extra options to supply to gtkdoc-mkdb.
33 MKDB_OPTIONS=--ignore-files="$(IGNORE_FILES)" --sgml-mode --output-format=xml
34
35 # Extra options to supply to gtkdoc-fixref.
36 FIXXREF_OPTIONS=
37
38 # Used for dependencies.
39 HFILE_GLOB=$(top_srcdir)/hildon-widgets/*.h
40 CFILE_GLOB=$(top_srcdir)/hildon-widgets/*.c
41
42
43
44 # Images to copy into HTML directory.
45 HTML_IMAGES =
46
47 # Extra SGML files that are included by $(DOC_MAIN_SGML_FILE).
48 content_files =
49
50 # Other files to distribute.
51 extra_files =
52
53 # CFLAGS and LDFLAGS for compiling scan program. Only needed if your app/lib
54 # contains GtkObjects/GObjects and you want to document signals and properties.
55 GTKDOC_CFLAGS = $(GTK_CFLAGS) -I$(top_srcdir) $(GNOME_VFS_CFLAGS)
56 GTKDOC_LIBS = $(GTK_LIBS) ../hildon-widgets/libhildonwidgets.la 
57
58 GTKDOC_CC=$(LIBTOOL) --mode=compile $(CC)
59 GTKDOC_LD=$(LIBTOOL) --mode=link $(CC)
60
61 # If you need to override some of the declarations, place them in the
62 # $(DOC_MODULE)-overrides.txt file and uncomment the second line here.
63 DOC_OVERRIDES =
64 #DOC_OVERRIDES = $(DOC_MODULE)-overrides.txt
65
66
67
68 ###########################################################################
69 # Everything below here is generic and you shouldn't need to change it.
70 ###########################################################################
71
72 TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
73
74 EXTRA_DIST =                            \
75         $(content_files)                \
76         $(extra_files)                  \
77         $(HTML_IMAGES)                  \
78         $(DOC_MAIN_SGML_FILE)           \
79         $(DOC_MODULE).types             \
80         $(DOC_OVERRIDES)
81
82 DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
83            $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp
84
85 SCANOBJ_FILES =                  \
86         $(DOC_MODULE).args       \
87         $(DOC_MODULE).hierarchy  \
88         $(DOC_MODULE).interfaces \
89         $(DOC_MODULE).prerequisites \
90         $(DOC_MODULE).signals
91
92 if ENABLE_GTK_DOC
93 all-local: html-build.stamp
94
95 #### scan ####
96
97 scan-build.stamp: $(HFILE_GLOB)
98         @echo '*** Scanning header files ***'
99         if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null ; then \
100             CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" CFLAGS="$(GTKDOC_CFLAGS)" LDFLAGS="$(GTKDOC_LIBS)" gtkdoc-scangobj $(SCANOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \
101         else \
102             cd $(srcdir) ; \
103             for i in $(SCANOBJ_FILES) ; do \
104                test -f $$i || touch $$i ; \
105             done \
106         fi
107         cd $(srcdir) && \
108           gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES)
109         touch scan-build.stamp
110
111 $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES): scan-build.stamp
112         @true
113
114 #### templates ####
115
116 tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_OVERRIDES)
117         @echo '*** Rebuilding template files ***'
118         cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE)
119         touch tmpl-build.stamp
120
121 tmpl.stamp: tmpl-build.stamp
122         @true
123
124 #### xml ####
125
126 sgml-build.stamp: tmpl.stamp $(CFILE_GLOB) $(srcdir)/tmpl/*.sgml
127         @echo '*** Building XML ***'
128         cd $(srcdir) && \
129         gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS)
130         touch sgml-build.stamp
131
132 sgml.stamp: sgml-build.stamp
133         @true
134
135 #### html ####
136
137 html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
138         @echo '*** Building HTML ***'
139         rm -rf $(srcdir)/html
140         mkdir $(srcdir)/html
141         cd $(srcdir)/html && gtkdoc-mkhtml $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
142         test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
143         @echo '-- Fixing Crossreferences' 
144         cd $(srcdir) && gtkdoc-fixxref --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
145         touch html-build.stamp
146 endif
147
148 ##############
149
150 clean-local:
151         rm -rf *~ *.bak $(SCANOBJ_FILES) .libs *-unused.txt $(DOC_STAMPS)
152
153 maintainer-clean-local: clean
154         cd $(srcdir) && rm -rf sgml html $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
155
156 gtkdocdir=$(docdir)
157 gtkdochtmldir=$(gtkdocdir)/html
158 gtkdocpackagedir=$(gtkdochtmldir)/$(DOC_MODULE)
159
160 gtkdocpackage_DATA = $(wildcard $(srcdir)/html/*.html)
161
162 #install-data-local:
163 #       $(mkinstalldirs) $(DESTDIR)$(TARGET_DIR)
164 #       (installfiles=`echo $(srcdir)/html/*.html`; \
165 #       if test "$$installfiles" = '$(srcdir)/html/*.html'; \
166 #       then echo '-- Nothing to install' ; \
167 #       else \
168 #         for i in $$installfiles; do \
169 #           echo '-- Installing '$$i ; \
170 #           $(INSTALL_DATA) $$i $(DESTDIR)$(TARGET_DIR); \
171 #         done; \
172 #         echo '-- Installing $(srcdir)/html/index.sgml' ; \
173 #         $(INSTALL_DATA) $(srcdir)/html/index.sgml $(DESTDIR)$(TARGET_DIR); \
174 #       fi)
175
176 #
177 # Require gtk-doc when making dist
178 #
179 if ENABLE_GTK_DOC
180 dist-check-gtkdoc:
181 else
182 dist-check-gtkdoc:
183         @echo "*** gtk-doc must be installed and enabled in order to make dist"
184         @false
185 endif
186
187 dist-hook: dist-check-gtkdoc dist-hook-local
188         mkdir $(distdir)/tmpl
189         mkdir $(distdir)/sgml
190         mkdir $(distdir)/html
191         -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
192         -cp $(srcdir)/xml/*.xml $(distdir)/xml
193         -cp $(srcdir)/html/*.html $(srcdir)/html/*.css $(distdir)/html
194
195         images=$(HTML_IMAGES) ;               \
196         for i in $$images ; do                \
197           cp $(srcdir)/$$i $(distdir)/html ;  \
198         done
199
200 .PHONY : dist-hook-local