Revision | 7034 (tree) |
---|---|
Time | 2018-02-10 16:25:13 |
Author | (del#1144) |
ビルド用バッチを Oniguruma 6.7.1 に対応
ソースディレクトリ・ビルド用ディレクトリを変数で指定するようになった
出力ディレクトリはカレントディレクトリになる
https://github.com/kkos/oniguruma/pull/75
release と debug でディレクトリを分け、ファイル名を変えなくてもよく
できるはずだが
- vcproj を全部変更する必要がある
- openssl,SFMT,zlib でも同じようにする方法がわからない
ので保留
@@ -1,23 +1,32 @@ | ||
1 | -cd oniguruma\src | |
1 | +pushd oniguruma\src | |
2 | 2 | |
3 | -if exist "Makefile" goto build | |
4 | -del onig_sd.lib | |
5 | -nmake clean | |
6 | -copy config.h.win32 config.h | |
7 | -perl -e "open(IN,'Makefile.windows');while(<IN>){s|CFLAGS =|CFLAGS = /MT|;print $_;}close(IN);" > Makefile | |
8 | -perl -e "open(IN,'Makefile.windows');while(<IN>){s|CFLAGS = -O2|CFLAGS = /MTd -Od|;s|_s.lib|_sd.lib|;print $_;}close(IN);" > Makefile.debug | |
3 | +SET ONIG_DIR=. | |
4 | +SET BUILD_DIR=. | |
9 | 5 | |
6 | +if not exist "%ONIG_DIR%\Makefile" goto mkmf | |
7 | +for %%F in (Makefile) do set mftime=%%~tF | |
8 | +for %%F in (..\..\buildoniguruma6.bat) do set battime=%%~tF | |
9 | +if "%battime%" leq "%mftime%" goto build | |
10 | + | |
11 | +del %ONIG_DIR%\onig_sd.lib | |
12 | +nmake -f %ONIG_DIR%\Makefile clean | |
13 | + | |
14 | +:mkmf | |
15 | +copy %ONIG_DIR%\config.h.win32 %ONIG_DIR%\config.h | |
16 | +perl -e "open(IN,'%ONIG_DIR%\Makefile.windows');while(<IN>){s|CFLAGS =|CFLAGS = /MT|;print $_;}close(IN);" > %ONIG_DIR%\Makefile | |
17 | +perl -e "open(IN,'%ONIG_DIR%\Makefile.windows');while(<IN>){s|CFLAGS = -O2|CFLAGS = /MTd -Od|;s|_s.lib|_sd.lib|;print $_;}close(IN);" > %ONIG_DIR%\Makefile.debug | |
18 | + | |
10 | 19 | :build |
11 | -if exist "onig_sd.lib" goto build_release | |
12 | -nmake -f Makefile.debug clean | |
13 | -nmake -f Makefile.debug | |
14 | -move onig_sd.lib ..\sample\ | |
15 | -nmake clean | |
16 | -move ..\sample\onig_sd.lib .\ | |
20 | +if exist "%ONIG_DIR%\onig_sd.lib" goto build_release | |
21 | +nmake -f %ONIG_DIR%\Makefile.debug clean | |
22 | +nmake -f %ONIG_DIR%\Makefile.debug | |
23 | +move %ONIG_DIR%\onig_sd.lib %ONIG_DIR%\..\sample\ | |
24 | +nmake -f %ONIG_DIR%\Makefile.debug clean | |
25 | +move %ONIG_DIR%\..\sample\onig_sd.lib %ONIG_DIR% | |
17 | 26 | |
18 | 27 | :build_release |
19 | -if exist "onig_s.lib" goto end | |
20 | -nmake | |
28 | +if exist "%ONIG_DIR%\onig_s.lib" goto end | |
29 | +nmake -f %ONIG_DIR%\Makefile | |
21 | 30 | |
22 | 31 | :end |
23 | -cd ..\.. | |
32 | +popd |