Logo AND Algorithmique Numérique Distribuée

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