New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
makefile in branches/DEV_r1879_FCM/NEMOGCM/TOOLS/adm – NEMO

source: branches/DEV_r1879_FCM/NEMOGCM/TOOLS/adm/makefile @ 1985

Last change on this file since 1985 was 1972, checked in by flavoni, 14 years ago

Add TOOLS directory and scripts to compile with FCM, see ticket: #685

  • Property svn:executable set to *
File size: 8.1 KB
Line 
1#+
2#
3# ========
4# makefile
5# ========
6#
7# ---------------------------------------
8# generation of documentation of superbib
9# ---------------------------------------
10#
11# TODO
12# ====
13#
14# add -W to sphinx command when encoding problems are solved
15#
16# usage of sphinx/source/Makefile
17#
18# revision of manual section of php and xsl
19#
20# EVOLUTIONS
21# ==========
22#
23# $Id: makefile 101 2010-04-26 12:12:15Z pinsard $
24#
25# - fplod 20100419T145702Z aedon.locean-ipsl.upmc.fr (Darwin)
26#
27#   * remove rest2web (sphinx is prefered)
28#
29# - fplod 20100323T135104Z aedon.locean-ipsl.upmc.fr (Darwin)
30#
31#   * remove one pdf and html
32#
33# - fplod 20100311T143131Z aedon.locean-ipsl.upmc.fr (Darwin)
34#
35#   * add rest2web (alternative to sphinx)
36#
37# - fplod 20100310T190253Z aedon.locean-ipsl.upmc.fr (Darwin)
38#
39#   * add php and xsl files to man_troff
40#
41# - fplod 20100310T182201Z aedon.locean-ipsl.upmc.fr (Darwin)
42#
43#   * usage of sphinx (for the first time !) not yet ok ...
44#
45# - fplod 20100310T091541Z aedon.locean-ipsl.upmc.fr (Darwin)
46#
47#   * add man_troff with shell scripts possible now with docutils 0.6
48#     can be test with
49#      $ man -M ../doc//manuals/man bibopa.sh
50#
51# - fplod 2009-05-13T14:08:49Z aedon.locean-ipsl.upmc.fr (Darwin)
52#
53#   * implicit rules
54#
55#     nb : may be will only work wih GNU make
56#     but easier to update : only one line to add in thi makefile when
57#     a new file is added in $(DIRSRC) directory
58#
59#   * rst2latex usage of manuals_many.sty and manual_one.sty (for TOC and parindent)
60#   * bug fix for PDF manual (missing one pdf2latex)
61#
62# - fplod 2008-10-28T10:59:44Z aedon.locean-ipsl.upmc.fr (Darwin)
63#
64#   * add newpage directive
65#     (thanks to http://docutils.sourceforge.net/docs/user/latex.html)
66#
67# - fplod 2008-09-17T09:16:08Z aedon.locean-ipsl.upmc.fr (Darwin)
68#   * add xsl files
69#
70# - fplod 2008-09-16T14:59:02Z aedon.locean-ipsl.upmc.fr (Darwin)
71#   * creation
72#
73# SEE ALSO
74# ========
75#
76# extract_rst.sh_
77#
78# .. _extract_rst.sh: ../extract_rst.sh.html
79#
80#-
81#
82PRODUCT = \
83NEMO_UTIL
84
85PRODUCTNAME = \
86$$(echo $(PRODUCT) | tr [:lower:] [:upper:])
87
88DIRSRC = \
89../
90
91DIRADM = \
92./
93
94DIRTMP = \
95./
96
97DIRDESIGN = \
98./design/
99
100DIRWWW = \
101../doc/
102
103URLPUBLISH = \
104http://192.168.0.12/~rblod/$(PRODUCT)
105
106LIST_SRCSH = $(wildcard $(DIRSRC)/*.sh)
107#$(DIRSRC)/Fcheck_archfile.sh \
108#$(DIRSRC)/Fcheck_config.sh \
109#$(DIRSRC)/Fclean_var.sh \
110#$(DIRSRC)/Fgo_to_TOOLS.sh \
111#$(DIRSRC)/Fmake_config.sh \
112#$(DIRSRC)/Fcopy_dir.sh  \
113#$(DIRSRC)/Fmake_WORK.sh  \
114#$(DIRSRC)/Fread_dir.sh \
115#$(DIRSRC)/makenemo_fcm.sh
116
117LIST_SRCSH_RST = \
118$(shell echo "$(LIST_SRCSH)" | \
119   sed -e "s+$(DIRSRC)+$(DIRTMP)/+g" \
120       -e "s+\.sh+.sh.rst+g")
121
122LIST_SRCSH_R2W = \
123$(shell echo "$(LIST_SRCSH)" | \
124   sed -e "s+$(DIRSRC)+$(DIRTMP)/rest2web_tmpdir+g" \
125       -e "s+\.s+.s.txt+g")
126
127
128LIST_SRCSH_TROFF = \
129$(shell echo "$(LIST_SRCSH)" | \
130   sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/man/man1/+g" \
131       -e "s+\.sh+.sh.1+g")
132
133LIST_SRCSH_HTML = \
134$(shell echo "$(LIST_SRCSH)" | \
135   sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/html/many/+g" \
136       -e "s+\.sh+.sh.html+g")
137
138LIST_SRCSH_PDF = \
139$(shell echo "$(LIST_SRCSH)" | \
140   sed -e "s+$(DIRSRC)+$(DIRWWW)/manuals/pdf/many/+g" \
141       -e "s+\.sh+.sh.pdf+g")
142
143RST2MAN = \
144rst2man.py
145
146RST2HTML = \
147rst2html.py
148
149RST2LATEX = \
150rst2latex.py
151
152RST2LATEX_OPTIONS_MANY = \
153--documentclass=article \
154--stylesheet=manuals_many.sty \
155--traceback \
156--use-verbatim-when-possible
157
158.PHONY : \
159help \
160before \
161clean \
162cleantmp \
163design \
164htmllinkcheckb \
165htmllinkchecka \
166spellcheck \
167all \
168man \
169man_troff \
170man_html \
171man_html_many \
172man_html_sphinx \
173man_pdf \
174man_pdf_many \
175man_pdf_sphinx
176
177help :
178   @echo "Prepare output directories :"
179   @echo "\$$ make before"
180   @echo ""
181   @echo "Following commands are available to build outputs :"
182   @echo "\$$ make all"
183   @echo " "
184   @echo "Check links before installation : "
185   @echo "\$$ make htmllinkcheckb"
186   @echo " "
187   @echo "Last step = installation"
188   @echo "\$$ make install"
189   @echo " "
190   @echo "Check links after installation : "
191   @echo "\$$ make htmllinkchecka"
192   @echo " "
193
194before :
195   @mkdir -p $(DIRWWW)/manuals/man/man1/
196   @mkdir -p $(DIRWWW)/manuals/html/many/
197   @mkdir -p $(DIRWWW)/manuals/html/rest2web/
198   @mkdir -p $(DIRWWW)/manuals/html/rest2web/css/
199   @mkdir -p $(DIRWWW)/manuals/html/sphinx/
200   @mkdir -p $(DIRWWW)/manuals/pdf/many/
201   @mkdir -p $(DIRWWW)/manuals/pdf/sphinx/
202   @mkdir -p $(DIRTMP)/sphinx_tmpdir/doctrees/
203   @mkdir -p $(DIRTMP)/rest2web_tmpdir/
204
205install :
206   @install.sh -w $(DIRWWW) -u $(URLPUBLISH)
207
208clean : \
209cleantmp
210   -@rm -fr $(DIRWWW)/
211   -@rm -fr $(DIRWWW)/manuals/man/
212   -@rm -fr $(DIRWWW)/manuals/html/
213   -@rm -fr $(DIRWWW)/manuals/pdf/
214
215cleantmp :
216   -@rm -f $(DIRTMP)/all.xml
217   -@rm -f $(DIRTMP)/*.rst
218   -@rm -f $(DIRTMP)/*.tex
219   -@rm -rf $(DIRTMP)/rest2web_tmpdir/
220   -@rm -f $(DIRTMP)/rest2web.log
221   -@rm -f $(DIRWWW)/manuals/pdf/many/*.aux
222   -@rm -f $(DIRWWW)/manuals/pdf/many/*.log
223   -@rm -f $(DIRWWW)/manuals/pdf/many/*.out
224   -@rm -rf $(DIRTMP)/sphinx_tmpdir/
225   -@rm -f $(DIRTMP)/sphinx_*.log
226
227design : \
228$(DIRDESIGN)/images/$(PRODUCT)_fulldependencies.png \
229$(DIRDESIGN)/images/$(PRODUCT)_fulldependencies.svg
230
231htmllinkcheckb :
232   @linkchecker.sh -d $(DIRWWW)/manuals/html/
233
234htmllinkchecka :
235   @linkchecker.sh -u $(URLPUBLISH)
236
237spellcheck :
238   @++aspell --mode=sgml --master=francais -c \
239   $(DIRSRC)/$(PRODUCT).xml
240
241all : \
242man_troff \
243man_html \
244man_pdf
245
246man_troff : \
247$(LIST_SRCSH_TROFF)
248
249man_html : \
250man_html_many \
251man_html_sphinx
252
253man_html_many : \
254$(DIRWWW)/manuals/html/many/index.html \
255$(LIST_SRCSH_HTML)
256
257man_html_sphinx : \
258$(DIRADM)/sphinx/conf.py \
259$(DIRTMP)/sphinx_tmpdir/index.rst \
260$(LIST_SRCSH_RST)
261   @cp $(LIST_SRCSH_RST) $(DIRTMP)/sphinx_tmpdir/
262   sphinx-build -b html -c $(DIRADM)/sphinx \
263       -d $(DIRTMP)/sphinx_tmpdir/doctrees \
264       -w $(DIRTMP)/sphinx_html.log \
265       $(DIRTMP)/sphinx_tmpdir/ \
266       $(DIRWWW)/manuals/html/sphinx/
267
268man_pdf : \
269man_pdf_many \
270man_pdf_sphinx
271
272man_pdf_many : \
273$(LIST_SRCSH_PHP)
274
275man_pdf_sphinx : \
276$(DIRADM)/sphinx/conf.py \
277$(DIRTMP)/sphinx_tmpdir/index.rst \
278$(LIST_SRCSH_RST)
279   @cp $(LIST_SRCSH_RST) $(DIRTMP)/sphinx_tmpdir/
280   @sphinx-build -b latex -c $(DIRADM)/sphinx \
281       -d $(DIRTMP)/sphinx_tmpdir/doctrees \
282       -w $(DIRTMP)/sphinx_pdf.log \
283       $(DIRTMP)/sphinx_tmpdir/ \
284       $(DIRTMP)/sphinx_tmpdir/latex_output
285   cd $(DIRTMP)/sphinx_tmpdir/latex_output/; make all-pdf
286   cp $(DIRTMP)/sphinx_tmpdir/latex_output/*.pdf \
287      $(DIRWWW)/manuals/pdf/sphinx/
288
289$(DIRWWW)/manuals/html/many/index.html : \
290$(DIRTMP)/index_many.rst
291   @$(RST2HTML) --input-encoding=ISO-8859-15 --strict \
292   $< $@
293
294$(DIRTMP)/index_many.rst :
295   @echo "$(PRODUCTNAME) manuals" | tr [:print:] = > $@
296   @echo "$(PRODUCTNAME) manuals" >> $@
297   @echo "$(PRODUCTNAME) manuals" | tr [:print:] = >> $@
298   @echo " " >> $@
299   @echo "Shell scripts" >> $@
300   @echo "Shell scripts" | tr [:print:] = >> $@
301   @for file in $(LIST_SRCSH); do echo " ";echo "$$(basename $${file})_"; echo " "; echo ".. _$$(basename $${file}) : $$(basename $${file}).html"; done >> $@
302
303$(DIRTMP)/sphinx_tmpdir/index.rst :
304   @echo ".. _index:" >> $@
305   @echo " " >> $@
306   @echo "$(PRODUCTNAME) manuals" | tr [:print:] = >> $@
307   @echo "$(PRODUCTNAME) manuals" >> $@
308   @echo "$(PRODUCTNAME) manuals" | tr [:print:] = >> $@
309   @echo " " >> $@
310   @echo "Shell scripts" >> $@
311   @echo "Shell scripts" | tr [:print:] = >> $@
312   @echo ".. toctree::" >> $@
313   @echo "   :maxdepth: 1" 1>> $@
314   @echo "   :glob:" 1>> $@
315   @echo " " >> $@
316   @for file in $(LIST_SRCSH); \
317   do \
318      echo "   $$(basename $${file})"; \
319   done >> $@
320   @echo " " >> $@
321
322$(DIRWWW)/manuals/man/man1/%.1:$(DIRTMP)/%.rst
323   @$(RST2MAN) --input-encoding=ISO-8859-15 --strict \
324   $< $@
325
326$(DIRWWW)/manuals/html/many/%.html:$(DIRTMP)/%.rst
327   @$(RST2HTML) --input-encoding=ISO-8859-15 --strict \
328   $< $@
329
330$(DIRWWW)/manuals/pdf/many/%.pdf : $(DIRTMP)/%.tex
331   @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
332   @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
333
334$(DIRTMP)/%.tex : $(DIRTMP)/%.rst
335   @$(RST2LATEX) $(RST2LATEX_OPTIONS_MANY) --input-encoding=ISO-8859-15 --strict \
336   $< $@
337
338$(DIRTMP)/%.sh.rst : $(DIRSRC)/%.sh
339   @$(DIRADM)/extract_rst.sh -i $< -l sh -o $@
340
341$(DIRDESIGN)/images/%.png : $(DIRDESIGN)/images/%.svg
342   @convert $< $@
343
344$(DIRDESIGN)/images/%.svg : $(DIRDESIGN)/%.dot
345   @dot -Tsvg -o $@ $<
346
347$(DIRDESIGN)/$(PRODUCT)_fulldependencies.dot : \
348./makefile
349   @makeppgraph --graphviz --output=$@
Note: See TracBrowser for help on using the repository browser.