-if MAINTAINER_MODE
-simgrid_modules.map: simgrid_modules.fig
- fig2dev -Lmap simgrid_modules.fig | sed 's/imagemap/simgrid_modules/g' | sed 's/\.gif/.png/' | grep -e IMG -e MAP -e AREA > simgrid_modules.map
-
-simgrid_modules.png: simgrid_modules.fig
- fig2dev -Lpng simgrid_modules.fig > simgrid_modules.png
-
-html: $(DOCSOURCES) Doxyfile.API Doxyfile.Examples Doxyfile.main logcategories.doc simgrid_modules.map simgrid_modules.png
- touch api_index.doc
- doxygen Doxyfile.main >/dev/null
- doxygen Doxyfile.API >/dev/null
- doxygen Doxyfile.Examples >/dev/null
- @top_srcdir@/tools/doxygen/index_create.pl html/API/API.tag api_index.doc
- cp @srcdir@/simgrid_logo.png @srcdir@/simgrid_modules.png html/
- doxygen Doxyfile.API >/dev/null
- doxygen Doxyfile.Examples >/dev/null
- doxygen Doxyfile.main >/dev/null
-# @cd html ; @top_srcdir@/tools/fix_doxygen2.pl `find . -name '*.html'`
-# @rm -rf html/API html/examples
-# for i in `find doc/html -name "*.html" -exec grep -l "group_[^_]" {} \;` ; do tools/fix_doxygen.pl $$i; rm $$i.bak; done
+if MAINTAINER_MODE
+if HAVE_DOXYGEN
+simgrid_modules.map: fig/simgrid_modules.fig
+ fig2dev -Lmap fig/simgrid_modules.fig | grep -e IMG -e MAP -e AREA | \
+ sed 's/imagemap/simgrid_modules/g' | sed 's/\.gif/.png/' | \
+ sed 's/<IMG /<IMG style="border:0px "/g' | sed 's/\.gif/.png/' \
+ > simgrid_modules.map
+
+%.png: fig/%.fig
+ fig2dev -Lpng $^ > $@
+
+html: Doxyfile ./logcategories.doc simgrid_modules.map $(PNGS) $(DOCSOURCES) \
+ html/gras.html html/amok.html html/msg.html html/simdag.html \
+ publis_core_bib.html publis_extern_bib.html publis_intra_bib.html publis_count.html
+ : # Setting up
+ touch index-API.doc .FAQ.doc.toc .index.doc.toc .contrib.doc.toc .history.doc.toc
+ test -e html || mkdir html
+ cp $(foreach file,$(PNGS),@srcdir@/$(file)) html/
+ cp @srcdir@/webcruft/Paje_MSG_screenshot_thn.jpg @srcdir@/webcruft/Paje_MSG_screenshot.jpg html/
+ cp @srcdir@/simgrid.css html/
+ : # First pass
+ doxygen Doxyfile >/dev/null
+ @top_srcdir@/tools/doxygen/index_create.pl simgrid.tag index-API.doc
+ @top_srcdir@/tools/doxygen/toc_create.pl \
+ @srcdir@/FAQ.doc @srcdir@/index.doc @srcdir@/contrib.doc \
+ @srcdir@/gtut-introduction.doc @srcdir@/history.doc
+ : # Second pass
+ doxygen Doxyfile >/dev/null
+ : # Post-processing
+ rm -f html/dir*
+ @top_srcdir@/tools/doxygen/index_php.pl @srcdir@/index.php.in html/index.html index.php
+ @top_srcdir@/tools/doxygen/doxygen_postprocesser.pl
+
+html/gras.html:
+ mkdir -p html
+ echo "<html><META HTTP-EQUIV='Refresh' content='0;URL=http://simgrid.gforge.inria.fr/doc/group__GRAS__API.html'>" > $@
+ echo "<center><h2><br><a href='http://simgrid.gforge.inria.fr/doc/group__GRAS__API.html'>Grid Reality And Simulation.</a></h2></center></html>" >> $@
+html/amok.html:
+ echo "<html><META HTTP-EQUIV='Refresh' content='0;URL=http://simgrid.gforge.inria.fr/doc/group__AMOK__API.html'>" > $@
+ echo "<center><h2><br><a href='http://simgrid.gforge.inria.fr/doc/group__AMOK__API.html'>Advanced Metacomputing Overlay Kit.</a></h2></center></html>" >> $@
+html/msg.html:
+ echo "<html><META HTTP-EQUIV='Refresh' content='0;URL=http://simgrid.gforge.inria.fr/doc/group__MSG__API.html'>" > $@
+ echo "<center><h2><br><a href='http://simgrid.gforge.inria.fr/doc/group__MSG__API.html'>Meta SimGrid.</a></h2></center></html>" >> $@
+html/simdag.html:
+ echo "<html><META HTTP-EQUIV='Refresh' content='0;URL=http://simgrid.gforge.inria.fr/doc/group__SD__API.html'>" > $@
+ echo "<center><h2><br><a href='http://simgrid.gforge.inria.fr/doc/group__SD__API.html'>DAG Simulator.</a></h2></center></html>" >> $@
+
+if HAVE_BIBTEX2HTML
+
+publis_count.html: all.bib
+ @top_srcdir@/tools/doxygen/bibtex2html_table_count.pl < $^ > $@
+
+publis_core.bib: all.bib
+ $(BIBTOOL) -- 'select.by.string={category "core"}' -- 'preserve.key.case={on}' -- 'preserve.keys={on}' $< > $@
+
+publis_extern.bib: all.bib
+ $(BIBTOOL) -- 'select.by.string={category "extern"}' -- 'preserve.key.case={on}' -- 'preserve.keys={on}' $< > $@
+
+publis_intra.bib: all.bib
+ $(BIBTOOL) -- 'select.by.string={category "intra"}' -- 'preserve.key.case={on}' -- 'preserve.keys={on}' $< > $@
+
+%_bib.latin1.html: %.bib
+ $(BIBTEX2HTML) -single-output -nv -force -sort year -copy-icons $^ | @top_srcdir@/tools/doxygen/bibtex2html_postprocessor.pl > $@
+
+%_bib.html: %_bib.latin1.html
+ $(ICONV) --from-code latin1 --to-code utf8 $^ --output $@
+endif
+
+publish:
+ $(MAKE) -C .. sync-gforge
+endif