From 5902c54c30a64d66ffbd0a6270c79336e4b170b9 Mon Sep 17 00:00:00 2001 From: MITSUNARI Shigeo Date: Sun, 15 Jul 2018 13:41:19 +0900 Subject: bat file to make test/bls_c384_test.exe --- mk.bat | 8 ++++---- mklib.bat | 16 +++++++--------- setvar.bat | 28 +++++++++++++++++++++++----- 3 files changed, 34 insertions(+), 18 deletions(-) diff --git a/mk.bat b/mk.bat index 2386bc7..b86d127 100644 --- a/mk.bat +++ b/mk.bat @@ -1,9 +1,9 @@ @echo off -call setvar.bat + +call setvar.bat lib set SRC=%1 set EXE=%SRC:.cpp=.exe% set EXE=%EXE:.c=.exe% -set EXE=%EXE:test\=bin\% -set EXE=%EXE:sample\=bin\% +set EXE=%EXE:test/=bin/% +set EXE=%EXE:sample/=bin/% cl %CFLAGS% %1 %2 %3 /Fe:%EXE% /link %LDFLAGS% -rem cl %1 -I../cybozulib/include /EHsc -Iinclude -I../mcl/include /DMCLBN_FP_UNIT_SIZE=4 /Fe:%EXE% /link /libpath:lib diff --git a/mklib.bat b/mklib.bat index 14f1bd4..1e769ff 100644 --- a/mklib.bat +++ b/mklib.bat @@ -1,10 +1,8 @@ @echo off -call setvar.bat -echo make bls.lib -rem cl /c %CFLAGS% src\bls.cpp -rem lib /OUT:lib\bls.lib /nodefaultlib bls.obj %LDFLAGS% -rem echo make bls256.lib -cl /c %CFLAGS% src\bls_c.cpp /I../mcl/ /DMCL_NO_AUTOLINK -rem lib /OUT:lib\bls256.lib /nodefaultlib bls_c.obj %LDFLAGS% -echo make bls256.dll -link /nologo /DLL /OUT:bin\bls256.dll bls_c.obj %LDFLAGS% ../mcl/lib/mcl.lib /implib:lib\bls256.lib + +call setvar.bat lib +echo make lib/lib384.%MODE% +echo CFLAGS=%CFLAGS% +cl /c %CFLAGS% /Foobj/bls_c.obj src/bls_c.cpp +cl /c %CFLAGS% /Foobj/fp.obj ../mcl/src/fp.cpp +lib /OUT:lib/bls384.lib /nodefaultlib obj/bls_c.obj obj/fp.obj %LDFLAGS% diff --git a/setvar.bat b/setvar.bat index 79e44e1..4a3ed3a 100755 --- a/setvar.bat +++ b/setvar.bat @@ -1,6 +1,24 @@ @echo off -set MCLBN_FP_UNIT_SIZE=4 -echo MCLBN_FP_UNIT_SIZE=%MCLBN_FP_UNIT_SIZE% -set CFLAGS=/MT /DNOMINMAX /Ox /DNDEBUG /W4 /Zi /EHsc /nologo -I ./include -I../cybozulib/include -I../cybozulib_ext/include -I../mcl/include/ -set CFLAGS=%CFLAGS% /DMCLBN_FP_UNIT_SIZE=%MCLBN_FP_UNIT_SIZE% /DMCL_NO_AUTOLINK -set LDFLAGS=/LIBPATH:..\cybozulib_ext\lib /LIBPATH:.\lib /LIBPATH:..\mcl\lib +set MODE= +if /i "%1"=="lib" ( + set MODE=lib +) +if /i "%1"=="dll" ( + set MODE=dll +) +if "%MODE%"=="" ( + echo error + echo setvar lib or dll + goto exit +) +set MCLBN_FP_UNIT_SIZE=6 +set CFLAGS=/MT /DNOMINMAX /Ox /DNDEBUG /W4 /Zi /EHsc /nologo +set CFLAGS=%CFLAGS% -I ./include -I../cybozulib/include -I../cybozulib_ext/include -I../mcl/include/ -I../mcl/src -I./ -I../xbyak/ +set CFLAGS=%CFLAGS% /DMCLBN_FP_UNIT_SIZE=%MCLBN_FP_UNIT_SIZE% /DMCL_NO_AUTOLINK /DMCLBN_NO_AUTOLINK +set LDFLAGS=/LIBPATH:../cybozulib_ext/lib /LIBPATH:./lib + +if %MODE%==lib ( + set CFLAGS=%CFLAGS% /DBLS_DONT_EXPORT +) + +:exit -- cgit v1.2.3