version 1.2, 2013/09/03 12:13:44 |
version 1.4, 2015/03/15 19:27:14 |
|
|
@rem $OpenXM$ |
@rem $OpenXM: OpenXM_contrib2/windows/help/makehelp2.bat,v 1.3 2015/03/12 17:25:50 ohara Exp $
|
@echo off |
@echo off
|
|
|
setlocal |
setlocal
|
|
|
set PATH=..;..\..;%PATH% |
set PATH=..;..\..;%PATH%
|
set lang=%~1 |
set lang=%~1
|
set PERL=c:\cygwin\bin\perl |
set PERL=c:\cygwin\bin\perl
|
|
|
set srcdir1=..\..\..\..\..\OpenXM\src\asir-doc |
REM 相対パスを絶対パスに変換する
|
set srcdir2=..\..\..\..\..\OpenXM\src\asir-contrib\packages\doc |
REM 重要!! %%~fi と ) の間に空白を入れてはならない!!
|
set srcdir3=..\..\..\..\..\OpenXM\src\asir-contrib\packages\src |
for %%i in ( ..\..\..\OpenXM\src ) do (set oxsrc=%%~fi)
|
set srcdir4=..\..\..\..\asir2000\lib |
for %%i in ( ..\..\asir2000\lib ) do (set srcdir4=%%~fi)
|
|
|
mkdir %lang% |
set srcdir1=%oxsrc%\asir-doc
|
pushd %lang% |
set srcdir2=%oxsrc%\asir-contrib\packages\doc
|
|
set srcdir3=%oxsrc%\asir-contrib\packages\src
|
REM case 1: asir 標準マニュアル |
|
|
mkdir %lang%
|
mkdir asir\parts\builtin |
pushd %lang%
|
pushd asir |
|
|
REM case 1: asir 標準マニュアル
|
for %%i in ( texinfo.tex texinfo.ini txi-ja.tex txi-en.tex ) do ( |
|
nkf32 -e %srcdir1%\%%i > %%i |
mkdir asir\parts\builtin
|
) |
pushd asir
|
|
|
for %%i in ( man.texi parts\algnum.texi parts\appendix.texi parts\asir.texi parts\builtin.texi parts\debug.texi parts\ff.texi parts\groebner.texi parts\intro.texi parts\process.texi parts\risa.texi parts\type.texi parts\builtin\array.texi parts\builtin\bit.texi parts\builtin\function.texi parts\builtin\io.texi parts\builtin\list.texi parts\builtin\misc.texi parts\builtin\module.texi parts\builtin\num.texi parts\builtin\numeric.texi parts\builtin\poly.texi parts\builtin\string.texi parts\builtin\structure.texi parts\builtin\type.texi parts\builtin\upoly.texi ) do ( |
for %%i in ( texinfo.tex texinfo.ini txi-ja.tex txi-en.tex ) do (
|
extract_man %lang% %srcdir1%\%%i | nkf32 -e > %%i |
nkf32 -e %srcdir1%\%%i > %%i
|
) |
)
|
|
|
%PERL% ../../texi2html -menu -split_node man.texi |
for %%i in ( man.texi parts\algnum.texi parts\appendix.texi parts\asir.texi parts\builtin.texi parts\debug.texi parts\ff.texi parts\groebner.texi parts\intro.texi parts\process.texi parts\risa.texi parts\type.texi parts\builtin\array.texi parts\builtin\bit.texi parts\builtin\function.texi parts\builtin\io.texi parts\builtin\list.texi parts\builtin\misc.texi parts\builtin\module.texi parts\builtin\num.texi parts\builtin\numeric.texi parts\builtin\poly.texi parts\builtin\string.texi parts\builtin\structure.texi parts\builtin\type.texi parts\builtin\upoly.texi ) do (
|
call :html_euc_to_sjis |
extract_man %lang% %srcdir1%\%%i | nkf32 -e > %%i
|
popd |
)
|
|
|
gen_hh asir . |
%PERL% ../../texi2html -menu -split_node man.texi
|
hhc asirhelp.hhp |
call :html_euc_to_sjis
|
|
popd
|
REM case 2: asir-contrib マニュアル |
|
|
gen_hh asir .
|
mkdir cman |
hhc asirhelp.hhp
|
pushd cman |
|
|
REM case 2: asir-contrib マニュアル
|
nkf32 -e %srcdir2%\top\cman-%lang%.texi > cman-%lang%.texi |
|
nkf32 -e %srcdir3%\names.rr > names.rr |
mkdir cman
|
|
pushd cman
|
for %%i in ( base calculus complex glib graphic hypergeometric intro load matrix misc names number oxrfc100 oxshell poly print series util windows ) do ( |
|
nkf32 -e %srcdir2%\top\%%i.oxw | oxweave C %lang% > %%i.%lang% |
nkf32 -e %srcdir2%\top\cman-%lang%.texi > cman-%lang%.texi
|
) |
nkf32 -e %srcdir3%\names.rr > names.rr
|
|
|
for %%i in ( base matrix number poly print util ) do ( |
for %%i in ( base calculus complex glib graphic hypergeometric intro load matrix misc names number oxrfc100 oxshell poly print series util windows ) do (
|
oxweave usage < names.rr | oxgentexi --category %%i --%lang% --upnode %%i --noSorting --author "OpenXM.org" --infoName asir-contrib-%%i > %%i-auto.%lang% |
nkf32 -e %srcdir2%\top\%%i.oxw | oxweave C %lang% > %%i.%lang%
|
) |
)
|
|
|
for %%i in ( glib ) do ( |
for %%i in ( base matrix number poly print util ) do (
|
nkf32 -e %srcdir4%\%%i | oxweave usage | oxgentexi --category %%i --%lang% --upnode %%i --noSorting --author "OpenXM.org" --infoName asir-contrib-%%i > %%i-auto.%lang% |
oxweave usage < names.rr | oxgentexi --category %%i --%lang% --upnode %%i --noSorting --author "OpenXM.org" --infoName asir-contrib-%%i > %%i-auto.%lang%
|
) |
)
|
|
|
for %%i in ( oxshell ) do ( |
for %%i in ( glib ) do (
|
nkf32 -e %srcdir3%\%%i.rr | oxweave usage | oxgentexi --category %%i --%lang% --upnode %%i --noSorting --author "OpenXM.org" --infoName asir-contrib-%%i > %%i-auto.%lang% |
nkf32 -e %srcdir4%\%%i | oxweave usage | oxgentexi --category %%i --%lang% --upnode %%i --noSorting --author "OpenXM.org" --infoName asir-contrib-%%i > %%i-auto.%lang%
|
) |
)
|
|
|
%PERL% ../../texi2html -menu -split_node cman-%lang%.texi |
for %%i in ( oxshell ) do (
|
call :html_euc_to_sjis |
nkf32 -e %srcdir3%\%%i.rr | oxweave usage | oxgentexi --category %%i --%lang% --upnode %%i --noSorting --author "OpenXM.org" --infoName asir-contrib-%%i > %%i-auto.%lang%
|
popd |
)
|
|
|
gen_hh cman . %lang% |
%PERL% ../../texi2html -menu -split_node cman-%lang%.texi
|
hhc cmanhelp.hhp |
call :html_euc_to_sjis
|
|
popd
|
REM 個別の場合 |
|
|
gen_hh cman . %lang%
|
REM case 3a: *.{oxg,oxw} から生成。 |
hhc cmanhelp.hhp
|
|
|
for %%i in ( dsolv gnuplot mathematica ok_diff ok_dmodule phc tigers ) do ( |
REM 個別の場合
|
mkdir %%i |
|
pushd %%i |
REM case 3a: *.{oxg,oxw} から生成。
|
nkf32 -e %srcdir2%\%%i\%%i.oxg | oxweave usage-%lang% | oxgentexi --noSorting --author "OpenXM.org" --infoName asir-contrib-%%i --title "%%i manual" > %%i-%lang%.texi |
|
nkf32 -e %srcdir2%\%%i\%%i.oxw | oxweave C %lang% > %%i.%lang% |
for %%i in ( dsolv gnuplot mathematica ok_diff ok_dmodule phc tigers ) do (
|
%PERL% ../../texi2html -menu -split_node %%i-%lang%.texi |
mkdir %%i
|
call :html_euc_to_sjis |
pushd %%i
|
popd |
nkf32 -e %srcdir2%\%%i\%%i.oxg | oxweave usage-%lang% | oxgentexi --noSorting --author "OpenXM.org" --infoName asir-contrib-%%i --title "%%i manual" > %%i-%lang%.texi
|
gen_hh %%i . %lang% |
nkf32 -e %srcdir2%\%%i\%%i.oxw | oxweave C %lang% > %%i.%lang%
|
hhc %%ihelp.hhp |
%PERL% ../../texi2html -menu -split_node %%i-%lang%.texi
|
) |
call :html_euc_to_sjis
|
|
popd
|
REM case 3b: plucker, sm1: *.{oxg,oxw,rr} から生成。 |
gen_hh %%i . %lang%
|
|
hhc %%ihelp.hhp
|
for %%i in ( plucker sm1 ) do ( |
)
|
mkdir %%i |
|
pushd %%i |
REM case 3b: plucker, sm1: *.{oxg,oxw,rr} から生成。
|
nkf32 -e %srcdir2%\%%i\%%i.oxg | oxweave usage-%lang% | oxgentexi --noSorting --author "OpenXM.org" --infoName asir-contrib-%%i --title "%%i manual" > %%i-%lang%.texi |
|
nkf32 -e %srcdir2%\%%i\%%i.oxw | oxweave C %lang% > %%i.%lang% |
for %%i in ( plucker sm1 ) do (
|
nkf32 -e %srcdir3%\%%i.rr | oxweave usage | oxgentexi --category %name% --en --upnode %%i --noSorting --author "OpenXM.org" --infoName asir-contrib-%%i > %%i-auto.%lang% |
mkdir %%i
|
%PERL% ../../texi2html -menu -split_node %%i-%lang%.texi |
pushd %%i
|
call :html_euc_to_sjis |
nkf32 -e %srcdir2%\%%i\%%i.oxg | oxweave usage-%lang% | oxgentexi --noSorting --author "OpenXM.org" --infoName asir-contrib-%%i --title "%%i manual" > %%i-%lang%.texi
|
popd |
nkf32 -e %srcdir2%\%%i\%%i.oxw | oxweave C %lang% > %%i.%lang%
|
gen_hh %%i . %lang% |
nkf32 -e %srcdir3%\%%i.rr | oxweave usage | oxgentexi --category %name% --en --upnode %%i --noSorting --author "OpenXM.org" --infoName asir-contrib-%%i > %%i-auto.%lang%
|
hhc %%ihelp.hhp |
%PERL% ../../texi2html -menu -split_node %%i-%lang%.texi
|
) |
call :html_euc_to_sjis
|
|
popd
|
REM case 3c: pfpcoh: *.{oxg,oxw,rr} から生成。 |
gen_hh %%i . %lang%
|
|
hhc %%ihelp.hhp
|
for %%i in ( pfpcoh ) do ( |
)
|
mkdir %%i |
|
pushd %%i |
REM case 3c: pfpcoh: *.{oxg,oxw,rr} から生成。
|
nkf32 -e %srcdir2%\%%i\%%i.oxg | oxweave usage-%lang% | oxgentexi --noSorting --author "OpenXM.org" --infoName asir-contrib-%%i --title "%%i manual" > %%i-%lang%.texi |
|
nkf32 -e %srcdir2%\%%i\%%i.oxw | oxweave C %lang% > %%i.%lang% |
for %%i in ( pfpcoh ) do (
|
nkf32 -e %srcdir3%\%%i.rr %srcdir3%\pfphom.rr | oxweave usage | oxgentexi --%lang% --upnode %%i --noSorting --author "OpenXM.org" --infoName asir-contrib-%%i > %%i-auto.%lang% |
mkdir %%i
|
%PERL% ../../texi2html -menu -split_node %%i-%lang%.texi |
pushd %%i
|
call :html_euc_to_sjis |
nkf32 -e %srcdir2%\%%i\%%i.oxg | oxweave usage-%lang% | oxgentexi --noSorting --author "OpenXM.org" --infoName asir-contrib-%%i --title "%%i manual" > %%i-%lang%.texi
|
popd |
nkf32 -e %srcdir2%\%%i\%%i.oxw | oxweave C %lang% > %%i.%lang%
|
gen_hh %%i . %lang% |
nkf32 -e %srcdir3%\%%i.rr %srcdir3%\pfphom.rr | oxweave usage | oxgentexi --%lang% --upnode %%i --noSorting --author "OpenXM.org" --infoName asir-contrib-%%i > %%i-auto.%lang%
|
hhc %%ihelp.hhp |
%PERL% ../../texi2html -menu -split_node %%i-%lang%.texi
|
) |
call :html_euc_to_sjis
|
|
popd
|
REM case 3d: om: *.{oxg,rr} から生成。 |
gen_hh %%i . %lang%
|
|
hhc %%ihelp.hhp
|
for %%i in ( om ) do ( |
)
|
mkdir %%i |
|
pushd %%i |
REM case 3d: om: *.{oxg,rr} から生成。
|
nkf32 -e %srcdir2%\%%i\%%i.oxg | oxweave usage-%lang% | oxgentexi --noSorting --author "OpenXM.org" --infoName asir-contrib-%%i --title "%%i manual" > %%i-%lang%.texi |
|
echo /*^&%lang% > %%i.oxw |
for %%i in ( om ) do (
|
nkf32 -e %srcdir3%\%%i.rr >> %%i.oxw |
mkdir %%i
|
echo */ >> %%i.oxw |
pushd %%i
|
oxweave C %lang% < %%i.oxw > %%i.%lang% |
nkf32 -e %srcdir2%\%%i\%%i.oxg | oxweave usage-%lang% | oxgentexi --noSorting --author "OpenXM.org" --infoName asir-contrib-%%i --title "%%i manual" > %%i-%lang%.texi
|
%PERL% ../../texi2html -menu -split_node %%i-%lang%.texi |
echo /*^&%lang% > %%i.oxw
|
call :html_euc_to_sjis |
nkf32 -e %srcdir3%\%%i.rr >> %%i.oxw
|
popd |
echo */ >> %%i.oxw
|
gen_hh %%i . %lang% |
oxweave C %lang% < %%i.oxw > %%i.%lang%
|
hhc %%ihelp.hhp |
%PERL% ../../texi2html -menu -split_node %%i-%lang%.texi
|
) |
call :html_euc_to_sjis
|
|
popd
|
REM case 4a: *.texi から生成。 |
gen_hh %%i . %lang%
|
|
hhc %%ihelp.hhp
|
for %%i in ( nn_ndbf ) do ( |
)
|
mkdir %%i |
|
pushd %%i |
REM case 4a: *.texi から生成。
|
nkf32 -e %srcdir2%\%%i\%%i.texi > %%i.texi |
|
extract_man %lang% %%i.texi > %%i-%lang%.texi |
for %%i in ( nn_ndbf ) do (
|
oxreplace --old @fref --new @ref %%i-%lang%.texi |
mkdir %%i
|
%PERL% ../../texi2html -menu -split_node %%i-%lang%.texi |
pushd %%i
|
call :html_euc_to_sjis |
nkf32 -e %srcdir2%\%%i\%%i.texi > %%i.texi
|
popd |
extract_man %lang% %%i.texi > %%i-%lang%.texi
|
gen_hh %%i . %lang% |
oxreplace --old @fref --new @ref %%i-%lang%.texi
|
hhc %%ihelp.hhp |
%PERL% ../../texi2html -menu -split_node %%i-%lang%.texi
|
) |
call :html_euc_to_sjis
|
|
popd
|
REM case 4b: *-{ja,en}.texi から生成。 |
gen_hh %%i . %lang%
|
|
hhc %%ihelp.hhp
|
for %%i in ( ns_twistedlog ) do ( |
)
|
mkdir %%i |
|
pushd %%i |
REM case 4b: *-{ja,en}.texi から生成。
|
nkf32 -e %srcdir2%\%%i\%%i-%lang%.texi > %%i-%lang%.texi |
|
%PERL% ../../texi2html -menu -split_node %%i-%lang%.texi |
for %%i in ( ns_twistedlog ) do (
|
call :html_euc_to_sjis |
mkdir %%i
|
popd |
pushd %%i
|
gen_hh %%i . %lang% |
nkf32 -e %srcdir2%\%%i\%%i-%lang%.texi > %%i-%lang%.texi
|
hhc %%ihelp.hhp |
%PERL% ../../texi2html -menu -split_node %%i-%lang%.texi
|
) |
call :html_euc_to_sjis
|
|
popd
|
REM case 4c: *-ja.texi から生成。日本語のみ。 |
gen_hh %%i . %lang%
|
|
hhc %%ihelp.hhp
|
for %%i in ( noro_matrix noro_mwl noro_pd todo_parametrize ) do ( |
)
|
if exist %srcdir2%\%%i\%%i-%lang%.texi ( |
|
mkdir %%i |
REM case 4c: *-ja.texi から生成。日本語のみ。
|
pushd %%i |
|
nkf32 -e %srcdir2%\%%i\%%i-%lang%.texi > %%i-%lang%.texi |
for %%i in ( noro_matrix noro_mwl noro_pd todo_parametrize ) do (
|
%PERL% ../../texi2html -menu -split_node %%i-%lang%.texi |
if exist %srcdir2%\%%i\%%i-%lang%.texi (
|
call :html_euc_to_sjis |
mkdir %%i
|
popd |
pushd %%i
|
gen_hh %%i . %lang% |
nkf32 -e %srcdir2%\%%i\%%i-%lang%.texi > %%i-%lang%.texi
|
hhc %%ihelp.hhp |
%PERL% ../../texi2html -menu -split_node %%i-%lang%.texi
|
) |
call :html_euc_to_sjis
|
) |
popd
|
|
gen_hh %%i . %lang%
|
popd |
hhc %%ihelp.hhp
|
|
)
|
exit /b 0 |
)
|
|
|
:html_euc_to_sjis |
popd
|
for %%i in ( *.html ) do ( |
|
rename %%i __tmp |
exit /b 0
|
nkf32 -Es __tmp > %%i |
|
del /q __tmp |
:html_euc_to_sjis
|
) |
for %%i in ( *.html ) do (
|
|
rename %%i __tmp
|
exit /b 0 |
nkf32 -Es __tmp > %%i
|
|
del /q __tmp
|
|
)
|
|
|
|
exit /b 0
|