source: trunk/adm/makefile @ 9

Last change on this file since 9 was 9, checked in by pinsard, 15 years ago

bug fix for user/location independency of working space

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 7.7 KB
Line 
1#+
2#
3# module
4# ======
5#
6# génération des manuels ircaam
7#
8# FILES
9# =====
10#
11# /usr/home/fplod/incas/ircaam/ircaam_ws/adm/makefile sur aedon.locean-ipsl.upmc.fr
12#
13# TODO
14# ====
15#
16# ++ amélioration de la page index
17#
18# ++ lien avec les guides
19#
20# EVOLUTIONS
21# ==========
22#
23# $Id$
24#
25# - fplod 2008-12-05T11:15:37Z aedon.locean-ipsl.upmc.fr (Darwin)
26#
27#   * creation
28#
29# SEE ALSO
30# ========
31#
32# extract_rst.sh_
33#
34# .. _extract_rst.sh: ../extract_rst.sh.html
35#
36#-
37#
38PRODUCT = \
39ircaam
40
41PRODUCTNAME = \
42$$(echo $(PRODUCT) | tr [:lower:] [:upper:])
43
44SUBPRODUCT = \
45ircaam_ws
46
47DIRSRC = \
48../src/
49
50DIRTMP = \
51./
52
53DIRWWW = \
54../doc/
55
56URLPUBLISH = \
57http://www.locean-ipsl.upmc.fr/~fplod/$(PRODUCT)/$(SUBPRODUCT)/
58
59LIST_SRCSH = \
60$(DIRSRC)/$(PRODUCT)_profile.sh \
61$(DIRSRC)/dlogd.sh \
62$(DIRSRC)/elogd.sh \
63$(DIRSRC)/plogd.sh \
64$(DIRSRC)/tlogd.sh
65
66.PHONY : \
67help \
68before \
69clean \
70htmllinkcheckb \
71htmllinkchecka \
72spellcheck \
73all \
74html \
75pdf
76
77help :
78        @echo "Prepare output directories :"
79        @echo "\$$ make before"
80        @echo ""
81        @echo "Following commands are available to build outputs :"
82        @echo "\$$ make all"
83        @echo " "
84        @echo "Check links before installation : "
85        @echo "\$$ make htmllinkcheckb"
86        @echo " "
87        @echo "Last step = installation"
88        @echo "\$$ make install"
89        @echo " "
90        @echo "Check links after installation : "
91        @echo "\$$ make htmllinkchecka"
92        @echo " "
93
94before :
95        @mkdir -p $(DIRWWW)/manuals/html/one/
96        @mkdir -p $(DIRWWW)/manuals/html/many/
97        @mkdir -p $(DIRWWW)/manuals/pdf/one/
98        @mkdir -p $(DIRWWW)/manuals/pdf/many/
99
100install :
101        @install.sh -w $(DIRWWW) -u $(URLPUBLISH)
102
103clean : \
104cleantmp
105        -@rm -fr $(DIRWWW)/manuals/html/
106        -@rm -fr $(DIRWWW)/manuals/pdf/
107        -@rm -fr $(DIRWWW)/src_browser/
108
109cleantmp :
110        -@rm -f $(DIRTMP)/all.xml
111        -@rm -f $(DIRTMP)/*.rst
112        -@rm -f $(DIRTMP)/*.rst[12]
113        -@rm -f $(DIRTMP)/links.rst*
114        -@rm -f $(DIRTMP)/*.tex
115        -@rm -f $(DIRWWW)/manuals/pdf/one/*.aux
116        -@rm -f $(DIRWWW)/manuals/pdf/one/*.log
117        -@rm -f $(DIRWWW)/manuals/pdf/one/*.out
118        -@rm -f $(DIRWWW)/manuals/pdf/many/*.aux
119        -@rm -f $(DIRWWW)/manuals/pdf/many/*.log
120        -@rm -f $(DIRWWW)/manuals/pdf/many/*.out
121
122htmllinkcheckb :
123        @linkchecker.sh -d $(DIRWWW)/manuals/html/
124
125htmllinkchecka :
126        @linkchecker.sh -u $(URLPUBLISH)
127
128spellcheck :
129        @++aspell --mode=sgml --master=english -c \
130        $(DIRSRC)/$(PRODUCT).xml
131
132all : \
133man_html \
134man_pdf
135
136man_html : \
137man_html_one \
138man_html_many
139
140man_html_one : \
141$(DIRWWW)/manuals/html/one/index.html
142
143man_html_many : \
144$(DIRWWW)/manuals/html/many/index.html \
145$(DIRWWW)/manuals/html/many/$(PRODUCT)_profile.sh.html \
146$(DIRWWW)/manuals/html/many/dlogd.sh.html \
147$(DIRWWW)/manuals/html/many/elogd.sh.html \
148$(DIRWWW)/manuals/html/many/plogd.sh.html \
149$(DIRWWW)/manuals/html/many/tlogd.sh.html
150
151man_pdf : \
152man_pdf_one \
153man_pdf_many
154
155man_pdf_one : \
156$(DIRWWW)/manuals/pdf/one/$(PRODUCT)_manuals.pdf \
157
158man_pdf_many : \
159$(DIRWWW)/manuals/pdf/many/$(PRODUCT)_profile.sh.pdf \
160$(DIRWWW)/manuals/pdf/many/dlogd.sh.pdf \
161$(DIRWWW)/manuals/pdf/many/elogd.sh.pdf \
162$(DIRWWW)/manuals/pdf/many/plogd.sh.pdf \
163$(DIRWWW)/manuals/pdf/many/tlogd.sh.pdf
164
165$(DIRWWW)/manuals/html/many/index.html : \
166$(DIRTMP)/index.rst
167        @rst2html.py --input-encoding=ISO-8859-15 --strict \
168        $< $@
169
170$(DIRWWW)/manuals/html/one/index.html : \
171$(DIRTMP)/$(PRODUCT)_manuals.rst
172        @rst2html.py --input-encoding=ISO-8859-15 --strict \
173        $< $@
174
175$(DIRWWW)/manuals/pdf/one/$(PRODUCT)_manuals.pdf : \
176$(DIRTMP)/$(PRODUCT)_manuals.tex
177        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/one/ $<
178
179$(DIRTMP)/$(PRODUCT)_manuals.tex : \
180$(DIRTMP)/$(PRODUCT)_manuals.rst
181        @rst2newlatex.py --input-encoding=ISO-8859-15 --strict \
182        $< $@
183
184$(DIRTMP)/$(PRODUCT)_manuals.rst : \
185$(DIRTMP)/index.rst \
186$(DIRTMP)/$(PRODUCT)_profile.sh.rst \
187$(DIRTMP)/dlogd.sh.rst \
188$(DIRTMP)/elogd.sh.rst \
189$(DIRTMP)/plogd.sh.rst \
190$(DIRTMP)/tlogd.sh.rst
191        @cat $(DIRTMP)/index.rst > ${DIRTMP}/$(PRODUCT)_manuals.rst1
192        @for file in $(LIST_SRCSH); \
193        do echo " " >> ${DIRTMP}/$(PRODUCT)_manuals.rst1 ;\
194        echo ".. raw:: latex" >> ${DIRTMP}/$(PRODUCT)_manuals.rst1 ;\
195        echo " " >> ${DIRTMP}/$(PRODUCT)_manuals.rst1 ;\
196        echo "  \newpage" >> ${DIRTMP}/$(PRODUCT)_manuals.rst1 ;\
197        echo " " >> ${DIRTMP}/$(PRODUCT)_manuals.rst1 ;\
198        echo ".. _$$(basename $${file}) :" >> ${DIRTMP}/$(PRODUCT)_manuals.rst1 ;\
199        echo " " >> ${DIRTMP}/$(PRODUCT)_manuals.rst1 ;\
200        echo "$$(basename $${file})" >> ${DIRTMP}/$(PRODUCT)_manuals.rst1 ;\
201        echo "$$(basename $${file} | tr [:print:] =)" >> ${DIRTMP}/$(PRODUCT)_manuals.rst1 ; \
202        echo " " >> ${DIRTMP}/$(PRODUCT)_manuals.rst1; \
203        sed -e "s/^==*$$/-----------------/" ${DIRTMP}/$$(basename $${file}).rst >> ${DIRTMP}/$(PRODUCT)_manuals.rst1; \
204        done
205        @grep "\.\. _.*: .*$$" ${DIRTMP}/$(PRODUCT)_manuals.rst1 > \
206        ${DIRTMP}/links.rst
207        @sed -e "s/^ *//" ${DIRTMP}/links.rst | sort -u > ${DIRTMP}/links.rst2
208        @sed -e "/\.\. _.*: .*$$/d" ${DIRTMP}/$(PRODUCT)_manuals.rst1 > \
209        ${DIRTMP}/$(PRODUCT)_manuals.rst2
210        @cp ${DIRTMP}/$(PRODUCT)_manuals.rst2 $@
211
212$(DIRTMP)/index.rst :
213        @echo "=================" >> $@
214        @echo "$(PRODUCTNAME) manuals" >> $@
215        @echo "=================" >> $@
216        @echo " " >> $@
217        @echo "Shell scripts" >> $@
218        @echo "=============" >> $@
219        @for file in $(LIST_SRCSH); do echo " ";echo "$$(basename $${file})_"; echo " "; echo ".. _$$(basename $${file}) : $$(basename $${file}).html"; done >> $@
220        @echo " " >> $@
221
222$(DIRWWW)/manuals/html/many/$(PRODUCT)_profile.sh.html : \
223$(DIRTMP)/$(PRODUCT)_profile.sh.rst
224        @rst2html.py --input-encoding=ISO-8859-15 --strict \
225        $< $@
226
227$(DIRWWW)/manuals/pdf/many/$(PRODUCT)_profile.sh.pdf : \
228$(DIRTMP)/$(PRODUCT)_profile.sh.tex
229        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
230
231$(DIRTMP)/$(PRODUCT)_profile.sh.tex : \
232$(DIRTMP)/$(PRODUCT)_profile.sh.rst
233        @rst2newlatex.py --input-encoding=ISO-8859-15 --strict \
234        $< $@
235
236$(DIRTMP)/$(PRODUCT)_profile.sh.rst : \
237$(DIRSRC)/$(PRODUCT)_profile.sh
238        @extract_rst.sh -i $< -l sh -o $@
239
240$(DIRWWW)/manuals/html/many/dlogd.sh.html : \
241$(DIRTMP)/dlogd.sh.rst
242        @rst2html.py --input-encoding=ISO-8859-15 --strict \
243        $< $@
244
245$(DIRWWW)/manuals/pdf/many/dlogd.sh.pdf : \
246$(DIRTMP)/dlogd.sh.tex
247        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
248        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
249
250$(DIRTMP)/dlogd.sh.tex : \
251$(DIRTMP)/dlogd.sh.rst
252        @rst2newlatex.py --input-encoding=ISO-8859-15 --strict \
253        $< $@
254
255$(DIRTMP)/dlogd.sh.rst : \
256$(DIRSRC)/dlogd.sh
257        @extract_rst.sh -i $< -l sh -o $@
258
259$(DIRWWW)/manuals/html/many/elogd.sh.html : \
260$(DIRTMP)/elogd.sh.rst
261        @rst2html.py --input-encoding=ISO-8859-15 --strict \
262        $< $@
263
264$(DIRWWW)/manuals/pdf/many/elogd.sh.pdf : \
265$(DIRTMP)/elogd.sh.tex
266        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
267        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
268
269$(DIRTMP)/elogd.sh.tex : \
270$(DIRTMP)/elogd.sh.rst
271        @rst2newlatex.py --input-encoding=ISO-8859-15 --strict \
272        $< $@
273
274$(DIRTMP)/elogd.sh.rst : \
275$(DIRSRC)/elogd.sh
276        @extract_rst.sh -i $< -l sh -o $@
277
278$(DIRWWW)/manuals/html/many/plogd.sh.html : \
279$(DIRTMP)/plogd.sh.rst
280        @rst2html.py --input-encoding=ISO-8859-15 --strict \
281        $< $@
282
283$(DIRWWW)/manuals/pdf/many/plogd.sh.pdf : \
284$(DIRTMP)/plogd.sh.tex
285        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
286        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
287
288$(DIRTMP)/plogd.sh.tex : \
289$(DIRTMP)/plogd.sh.rst
290        @rst2newlatex.py --input-encoding=ISO-8859-15 --strict \
291        $< $@
292
293$(DIRTMP)/plogd.sh.rst : \
294$(DIRSRC)/plogd.sh
295        @extract_rst.sh -i $< -l sh -o $@
296
297$(DIRWWW)/manuals/html/many/tlogd.sh.html : \
298$(DIRTMP)/tlogd.sh.rst
299        @rst2html.py --input-encoding=ISO-8859-15 --strict \
300        $< $@
301
302$(DIRWWW)/manuals/pdf/many/tlogd.sh.pdf : \
303$(DIRTMP)/tlogd.sh.tex
304        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
305        @-pdflatex -output-directory $(DIRWWW)/manuals/pdf/many/ $<
306
307$(DIRTMP)/tlogd.sh.tex : \
308$(DIRTMP)/tlogd.sh.rst
309        @rst2newlatex.py --input-encoding=ISO-8859-15 --strict \
310        $< $@
311
312$(DIRTMP)/tlogd.sh.rst : \
313$(DIRSRC)/tlogd.sh
314        @extract_rst.sh -i $< -l sh -o $@
Note: See TracBrowser for help on using the repository browser.