Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Lesson 9 is done
[simgrid.git] / doc / Makefile.am
1 DOCSOURCES = $(shell find @top_srcdir@/tools/gras  @top_srcdir@/src @top_srcdir@/include -name "*.[chl]") \
2  $(shell find @srcdir@ -name "*.doc")
3 FIGS=simgrid_modules.fig amok_bw_test.fig amok_bw_sat.fig
4 PNGS=$(patsubst %.fig,%.png,$(FIGS)) simgrid_logo.png simgrid_logo_small.png
5
6 EXTRA_DIST = html Doxyfile \
7  modules.doc FAQ.doc contrib.doc index.doc publis.doc footer.html \
8  $(foreach file,$(FIGS),fig/$(file)) $(PNGS)
9
10
11 CLEANFILES = .*.toc
12 DISTCLEANFILES = index-API.doc simgrid.tag
13 MAINTAINERCLEANFILES = html
14
15 if MAINTAINER_MODE
16 simgrid_modules.map: fig/simgrid_modules.fig
17         fig2dev -Lmap fig/simgrid_modules.fig | grep -e IMG -e MAP -e AREA | \
18         sed 's/imagemap/simgrid_modules/g' | sed 's/\.gif/.png/' | \
19         sed 's/<IMG /<IMG style="border:0px "/g' | sed 's/\.gif/.png/' \
20         > simgrid_modules.map
21
22 %.png: fig/%.fig
23         fig2dev -Lpng $^ > $@
24
25 html: Doxyfile ./logcategories.doc simgrid_modules.map $(PNGS) $(DOCSOURCES)
26         : # Setting up
27         touch index-API.doc .FAQ.doc.toc .index.doc.toc .contrib.doc.toc
28         test -e html || mkdir html
29         cp $(foreach file,$(PNGS),@srcdir@/$(file)) html/
30         cp @srcdir@/Paje_MSG_screenshot_thn.jpg @srcdir@/Paje_MSG_screenshot.jpg html/
31         cp @srcdir@/simgrid.css html/
32         : # First pass
33         doxygen Doxyfile >/dev/null
34         @top_srcdir@/tools/doxygen/index_create.pl simgrid.tag index-API.doc
35         @top_srcdir@/tools/doxygen/toc_create.pl \
36            @srcdir@/FAQ.doc @srcdir@/index.doc @srcdir@/contrib.doc \
37            @srcdir@/gtut-introduction.doc
38         : # Second pass
39         doxygen Doxyfile >/dev/null
40         : # Post-processing
41         rm -f html/dir* 
42         @top_srcdir@/tools/doxygen/index_php.pl @srcdir@/index.php.in html/index.html index.php
43         @top_srcdir@/tools/doxygen/doxygen_postprocesser.pl
44
45 publish:
46         $(MAKE) -C .. sync-gforge
47 endif
48
49 ./logcategories.doc: $(DOCSOURCES)
50         pwd=`pwd`; rm $$pwd/logcategories.doc; set -e; \
51         echo "/* Generated file, do not edit */"          > $$pwd/logcategories.doc; \
52         echo "/** \addtogroup XBT_log_cats"              >> $$pwd/logcategories.doc; \
53         echo "    @{"                                    >> $$pwd/logcategories.doc; \
54         cd @top_srcdir@/src; ./xbt_log_extract_hierarchy >> $$pwd/logcategories.doc; \
55         echo "@}*/"                                      >> $$pwd/logcategories.doc;
56
57 install-data-local: 
58         @for file in `find html/ -type d` ; do \
59            echo "test -z \"$(prefix)/doc/simgrid/$$file\" || $(mkdir_p) \"$(prefix)/doc/simgrid/$$file\"";\
60            test -z "$(prefix)/doc/simgrid/$$file" || $(mkdir_p) "$(prefix)/doc/simgrid/$$file";\
61         done
62         @for file in `find html/ -type f` ; do \
63            echo " $(INSTALL_DATA) '$$file' '$(prefix)/doc/simgrid/$$file'";\
64            $(INSTALL_DATA) $$file $(prefix)/doc/simgrid/$$file ;\
65         done
66
67 uninstall-local:
68         for file in `find html/ -type f` ; do \
69            echo " rm -f '$(prefix)/doc/simgrid/$$file'";\
70            rm -f $(prefix)/doc/simgrid/$$file ;\
71         done
72
73
74 check-gtut-tocs:
75         @echo Check individual TOCs
76         @for n in gtut-tour-*.doc ; do \
77           sed -n '/Table of Contents/,/hr/p' $$n|grep ref > tmp.curtoc; \
78           \
79           grep -E '\\s?u?b?section' $$n | grep -v _toc| \
80              sed -e 's/\\section //' -e 's/\\subsection /subsection/' -e 's/ .*//' |\
81              sed -e 's/^/ - \\ref /' -e 's/- \\ref subsection/   - \\ref /' > tmp.realtoc; \
82           \
83           if ! diff -q tmp.curtoc tmp.realtoc >/dev/null; then \
84             echo Wrong toc for $$n. Should be ; \
85             cat tmp.realtoc; \
86           fi ; \
87         done
88         @rm tmp.realtoc tmp.curtoc
89         @echo "Check main TOC"
90         @for n in gtut-tour-*doc; do \
91           grep @page $$n |sed -e 's/@page //' -e 's/ .*//' -e 's/^/ - \\ref /' >>tmp.realtoc;\
92           sed -n -e '/Table of Contents/,/hr/p' $$n|sed -e 's/^/   /'|\
93              grep -v toc|grep -v '<hr>'|grep [^[:blank:]] >>tmp.realtoc;\
94         done
95         @grep ' *- \\ref' gtut-tour.doc > tmp.curtoc
96         @if ! diff -b -u tmp.curtoc tmp.realtoc ; then \
97           echo "Wrong toc for gtut-tour.doc Right one is in tmp.realtoc"; \
98         else \
99           rm tmp.realtoc; \
100         fi ;
101         @rm tmp.curtoc
102         
103
104 .PHONY: html
105
106 include $(top_srcdir)/acmacro/dist-files.mk