source: trunk/adm/makefile

Last change on this file was 66, checked in by pinsard, 14 years ago

improve makefile dependencies

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 7.3 KB
Line 
1#+
2#
3# module
4# ======
5#
6# génération des manuels
7#
8# TODO
9# ====
10#
11# ++ lien avec les guides
12#
13# EVOLUTIONS
14# ==========
15#
16# $Id$
17#
18# - fplod 20100910T150149Z aedon.locean-ipsl.upmc.fr (Darwin)
19#
20#   * try to improve dependencies
21#   * clean useless macros
22#
23# - fplod 20100712T140824Z aedon.locean-ipsl.upmc.fr (Darwin)
24#
25#   * add installation of src_browser output
26#
27# - fplod 20100419T121920Z aedon.locean-ipsl.upmc.fr (Darwin)
28#
29#   * add design target
30#
31# - fplod 20100419T092414Z aedon.locean-ipsl.upmc.fr (Darwin)
32#
33#   * add browser for MATLAB sources
34#   * add sphinx for HTML and PDF productions
35#   * remove html_one and pdf_one
36#
37# - fplod 20100310T132252Z aedon.locean-ipsl.upmc.fr (Darwin)
38#
39#   * remove TOOLBOX/verLessThan.m because not home made (so no ReSt
40#     comments)
41#
42# - fplod 2009-10-01T14:15:23Z aedon.locean-ipsl.upmc.fr (Darwin)
43#
44#   * add TOOLBOX/verLessThan.m
45#
46# - fplod 2009-09-23T08:11:03Z aedon.locean-ipsl.upmc.fr (Darwin)
47#
48#   * add adm/matv7tomatv6.m
49#
50# - fplod 2009-09-21T09:49:38Z aedon.locean-ipsl.upmc.fr (Darwin)
51#
52#   * some m files have been moved from PROGRAMMES to TOOLBOX,
53#     and some m files in PROGRAMMES have been deleted.
54#
55# - fplod 2009-08-21T10:32:47Z aedon.locean-ipsl.upmc.fr (Darwin)
56#
57#   * creation
58#
59# SEE ALSO
60# ========
61#
62# extract_rst.sh_
63#
64# .. _extract_rst.sh: ../extract_rst.sh.html
65#
66#-
67#
68PRODUCT = \
69tpacpandreg
70
71PRODUCTNAME = \
72$$(echo $(PRODUCT) | tr [:lower:] [:upper:])
73
74SUBPRODUCT = \
75tpacpandreg_ws
76
77DIRSRC = \
78../
79
80DIRADM = \
81./
82
83DIRTMP = \
84./
85
86DIRDESIGN = \
87./design/
88
89DIRWWW = \
90../doc/
91
92URLPUBLISH = \
93http://www.locean-ipsl.upmc.fr/~fplod/$(PRODUCT)/$(SUBPRODUCT)/doc/manuals/
94
95LIST_SRCSH =
96
97LIST_SRCSH_RST = \
98$(shell echo "$(LIST_SRCSH)" | \
99        sed -e "s+$(DIRSRC)/PROGRAMMES/+$(DIRTMP)/sphinx_tmpdir/manuals/+g" \
100            -e "s+\.sh+.sh.rst+g")
101
102LIST_SRCMATLAB = \
103$(DIRSRC)/PROGRAMMES/$(PRODUCT)_startup.m \
104$(DIRSRC)/PROGRAMMES/carte_SST.m \
105$(DIRSRC)/PROGRAMMES/eof_NCEP_sais.m \
106$(DIRSRC)/TOOLBOX/colorbartype.m \
107$(DIRSRC)/TOOLBOX/contlab.m \
108$(DIRSRC)/TOOLBOX/initfig.m \
109$(DIRSRC)/TOOLBOX/normalisation.m \
110$(DIRSRC)/TOOLBOX/whorldmap.m \
111$(DIRSRC)/RESULTATS/carteetstd_SST.m \
112$(DIRSRC)/RESULTATS/eof_NCEP_an.m \
113$(DIRSRC)/RESULTATS/regandsignif_seriestemporelles.m \
114$(DIRSRC)/adm/matv7tomatv6.m
115
116LIST_SRCMATLAB_RST = \
117$(shell echo "$(LIST_SRCMATLAB)" | \
118        sed -e "s+$(DIRSRC)/PROGRAMMES/+$(DIRTMP)/sphinx_tmpdir/manuals/+g" \
119            -e "s+$(DIRSRC)/RESULTATS/+$(DIRTMP)/sphinx_tmpdir/manuals/+g" \
120            -e "s+$(DIRSRC)/TOOLBOX/+$(DIRTMP)/sphinx_tmpdir/manuals/+g" \
121            -e "s+$(DIRSRC)/adm/+$(DIRTMP)/sphinx_tmpdir/manuals/+g" \
122            -e "s+\.m+.m.rst+g")
123
124.PHONY : \
125help \
126before \
127clean \
128cleantmp \
129design \
130htmllinkcheckb \
131htmllinkchecka \
132spellcheck \
133all \
134man \
135html \
136html_sphinx \
137html_sphinx_one \
138pdf \
139pdf_sphinx \
140html_src_browser \
141html_src_browser_doxygen
142
143help :
144        @echo "Prepare output directories :"
145        @echo "\$$ make before"
146        @echo ""
147        @echo "Following commands are available to build outputs :"
148        @echo "\$$ make all"
149        @echo " "
150        @echo "Check links before installation : "
151        @echo "\$$ make htmllinkcheckb"
152        @echo " "
153        @echo "Last step = installation of HTML and pdf files"
154        @echo "\$$ make install_all"
155        @echo " "
156        @echo "Check links after installation : "
157        @echo "\$$ make htmllinkchecka"
158        @echo " "
159
160before :
161        @mkdir -p $(DIRWWW)/manuals/html/sphinx/
162        @mkdir -p $(DIRWWW)/manuals/pdf/sphinx/
163        @mkdir -p $(DIRTMP)/sphinx_tmpdir/doctrees/
164        @mkdir -p $(DIRTMP)/sphinx_tmpdir/manuals/
165        @mkdir -p $(DIRWWW)/src_browser/
166
167install_all : \
168install_html \
169install_pdf \
170install_browser
171
172install_html :
173        @$(DIRADM)/install.sh -w $(DIRWWW)/manuals/html/ -u $(URLPUBLISH)/html/
174
175install_pdf :
176        @$(DIRADM)/install.sh -w $(DIRWWW)/manuals/pdf/ -u $(URLPUBLISH)/pdf/
177
178install_browser :
179        @$(DIRADM)/install.sh -w $(DIRWWW)/src_browser/doxygen/html/ -u $(URLPUBLISH)/src_browser/doxygen/html/
180
181clean : \
182cleantmp
183        -@rm -fr $(DIRWWW)/manuals/html/
184        -@rm -fr $(DIRWWW)/manuals/pdf/
185        -@rm -fr $(DIRWWW)/src_browser/
186
187cleantmp :
188        -@rm -f $(DIRTMP)/all.xml
189        -@rm -f $(DIRTMP)/*.tex
190        -@rm -fr $(DIRTMP)/sphinx_tmpdir/
191        -@rm -f $(DIRTMP)/sphinx_*.log
192
193design : \
194$(DIRDESIGN)/images/$(PRODUCT)_fulldependencies.png \
195$(DIRDESIGN)/images/$(PRODUCT)_fulldependencies.svg
196
197htmllinkcheckb :
198        @$(DIRADM)/linkchecker.sh -d $(DIRWWW)/manuals/html/
199
200htmllinkchecka :
201        @$(DIRADM)/linkchecker.sh -u $(URLPUBLISH)
202
203spellcheck :
204        @++aspell --mode=sgml --master=english -c \
205        $(DIRSRC)/$(PRODUCT).xml
206
207all : \
208man \
209html_src_browser
210
211man : \
212html \
213pdf
214
215html : \
216html_sphinx \
217html_sphinx_one
218
219html_src_browser : \
220html_src_browser_doxygen
221
222html_sphinx : \
223$(DIRADM)/sphinx/conf.py \
224$(DIRTMP)/sphinx_tmpdir/index.rst \
225$(LIST_SRCMATLAB_RST)
226        @sphinx-build -b html -c $(DIRADM)/sphinx \
227            -d $(DIRTMP)/sphinx_tmpdir/doctrees \
228            -w $(DIRTMP)/sphinx_html.log \
229            $(DIRTMP)/sphinx_tmpdir/ \
230            $(DIRWWW)/manuals/html/sphinx/
231
232html_sphinx_one : \
233$(DIRADM)/sphinx/conf.py \
234$(DIRTMP)/sphinx_tmpdir/index.rst \
235$(LIST_SRCMATLAB_RST)
236        @sphinx-build -b singlehtml -c $(DIRADM)/sphinx \
237            -d $(DIRTMP)/sphinx_tmpdir/doctrees \
238            -w $(DIRTMP)/sphinx_html.log \
239            $(DIRTMP)/sphinx_tmpdir/ \
240            $(DIRWWW)/manuals/html/sphinx_one/
241
242pdf : \
243pdf_sphinx
244
245pdf_sphinx : \
246$(DIRADM)/sphinx/conf.py \
247$(DIRTMP)/sphinx_tmpdir/index.rst \
248$(LIST_SRCMATLAB_RST)
249        @sphinx-build -b latex -c $(DIRADM)/sphinx \
250            -d $(DIRTMP)/sphinx_tmpdir/doctrees \
251            -w $(DIRTMP)/sphinx_pdf.log \
252            $(DIRTMP)/sphinx_tmpdir/ \
253            $(DIRTMP)/sphinx_tmpdir/latex_output
254        cd $(DIRTMP)/sphinx_tmpdir/latex_output/; make all-pdf
255        cp $(DIRTMP)/sphinx_tmpdir/latex_output/*.pdf \
256           $(DIRWWW)/manuals/pdf/sphinx/
257
258$(DIRTMP)/sphinx_tmpdir/index.rst :
259        @echo ".. _index:" > $@
260        @echo " " >> $@
261        @echo "$(PRODUCTNAME) manuals" | tr [:print:] = >> $@
262        @echo "$(PRODUCTNAME) manuals" >> $@
263        @echo "$(PRODUCTNAME) manuals" | tr [:print:] = >> $@
264        @echo " " >> $@
265        @echo "MATLAB scripts" >> $@
266        @echo "MATLAB scripts" | tr [:print:] = >> $@
267        @echo ".. toctree::" >> $@
268        @echo "   :maxdepth: 1" 1>> $@
269        @echo "   :glob:" 1>> $@
270        @echo " " >> $@
271        @for file in $(LIST_SRCMATLAB); \
272        do \
273           echo "   manuals/$$(basename $${file})"; \
274        done >> $@
275        @echo " " >> $@
276        @echo "Indices and tables" >> $@
277        @echo "Indices and tables" | tr [:print:] = >> $@
278        @echo "* :ref:\`search\`" >> $@
279        @echo " " >> $@
280
281html_src_browser_doxygen : \
282        $(DIRWWW)/src_browser/doxygen/
283
284$(DIRWWW)/src_browser/doxygen/ : \
285$(DIRADM)/Doxyfile_$(PRODUCT) \
286$(LIST_SRCMATLAB)
287        @doxygen $<
288        @touch $@
289
290$(DIRTMP)/sphinx_tmpdir/manuals/%.sh.rst : $(DIRSRC)/PROGRAMMES/%.sh $(DIRADM)/extract_rst.sh
291        @$(DIRADM)/extract_rst.sh -i $< -l sh -o $@
292
293$(DIRTMP)/sphinx_tmpdir/manuals/%.m.rst : $(DIRSRC)/PROGRAMMES/%.m $(DIRADM)/extract_rst.sh
294        @$(DIRADM)/extract_rst.sh -i $< -l matlab -o $@
295
296$(DIRTMP)/sphinx_tmpdir/manuals/%.m.rst : $(DIRSRC)/TOOLBOX/%.m $(DIRADM)/extract_rst.sh
297        @$(DIRADM)/extract_rst.sh -i $< -l matlab -o $@
298
299$(DIRTMP)/sphinx_tmpdir/manuals/%.m.rst : $(DIRSRC)/RESULTATS/%.m $(DIRADM)/extract_rst.sh
300        @$(DIRADM)/extract_rst.sh -i $< -l matlab -o $@
301
302$(DIRTMP)/sphinx_tmpdir/manuals/%.m.rst : $(DIRSRC)/adm/%.m $(DIRADM)/extract_rst.sh
303        @$(DIRADM)/extract_rst.sh -i $< -l matlab -o $@
304
305$(DIRDESIGN)/images/%.png : $(DIRDESIGN)/images/%.svg
306        @convert $< $@
307
308$(DIRDESIGN)/images/%.svg : $(DIRDESIGN)/%.dot
309        @dot -Tsvg -o $@ $<
310
311$(DIRDESIGN)/$(PRODUCT)_fulldependencies.dot : \
312./makefile
313        @makeppgraph --graphviz --output=$@
314
Note: See TracBrowser for help on using the repository browser.