source: trunk/adm/makefile @ 5

Last change on this file since 5 was 4, checked in by pinsard, 16 years ago

better manuals production tool

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