refactor mklib.bat and mk.bat

dev
MITSUNARI Shigeo 8 years ago
parent a04b1099b6
commit 6c47afc952
  1. 3
      include/mcl/bn256_if.h
  2. 9
      mk.bat
  3. 19
      mklib.bat
  4. 1
      readme.md
  5. 2
      setvar.bat

@ -44,6 +44,9 @@ typedef struct BN256_GT BN256_GT;
#define BN256_DLL_API __declspec(dllexport) #define BN256_DLL_API __declspec(dllexport)
#else #else
#define BN256_DLL_API __declspec(dllimport) #define BN256_DLL_API __declspec(dllimport)
#ifndef MCL_NO_AUTOLINK
#pragma comment(lib, "bn256_if.lib")
#endif
#endif #endif
#else #else
#define BN256_DLL_API #define BN256_DLL_API

@ -1,2 +1,9 @@
@echo off @echo off
cl /MT /DNOMINMAX /Ox /DNDEBUG /W4 /Zi /EHsc -I ./include -I../xbyak -I../cybozulib/include -I../cybozulib_ext/include %1 %2 /link /LIBPATH:..\cybozulib_ext\lib /LIBPATH:.\lib call setvar.bat
set SRC=%1
set EXE=%SRC:.cpp=.exe%
set EXE=%EXE:.c=.exe%
set EXE=%EXE:test\=bin\%
set EXE=%EXE:sample\=bin\%
echo cl %CFLAGS% %1 %2 %3 /Fe:%EXE% /link %LDFLAGS%
cl %CFLAGS% %1 %2 %3 /Fe:%EXE% /link %LDFLAGS%

@ -1,15 +1,14 @@
@echo off @echo off
set CFLAGS=/MT /DNOMINMAX /Ox /DNDEBUG /W4 /Zi /EHsc -I ./include -I../xbyak -I../cybozulib/include -I../cybozulib_ext/include call setvar.bat
set LDFLAGS=/link /LIBPATH:..\cybozulib_ext\lib /LIBPATH:.\lib
rem nasm -f win64 -D_WIN64 src\asm\low_x86-64.asm rem nasm -f win64 -D_WIN64 src\asm\low_x86-64.asm
rem lib /OUT:lib\mcl.lib /nodefaultlib fp.obj src\asm\low_x86-64.obj rem lib /OUT:lib\mcl.lib /nodefaultlib fp.obj src\asm\low_x86-64.obj
echo cl /c %CFLAGS% src\fp.cpp echo cl /c %CFLAGS% src\fp.cpp /Foobj\fp.obj
cl /c %CFLAGS% src\fp.cpp cl /c %CFLAGS% src\fp.cpp /Foobj\fp.obj
echo lib /OUT:lib\mcl.lib /nodefaultlib fp.obj echo lib /nologo /OUT:lib\mcl.lib /nodefaultlib obj\fp.obj
lib /OUT:lib\mcl.lib /nodefaultlib fp.obj lib /nologo /OUT:lib\mcl.lib /nodefaultlib obj\fp.obj
echo cl /c %CFLAGS% src\bn256_if.cpp echo cl /c %CFLAGS% src\bn256_if.cpp /Foobj\bn256_if.obj
cl /c %CFLAGS% src\bn256_if.cpp cl /c %CFLAGS% src\bn256_if.cpp /Foobj\bn256_if.obj
echo cl /LD /Febin\bn256_if.dll bn256_if.obj fp.obj %LDFLAGS% echo link /nologo /DLL /OUT:bin\bn256_if.dll obj\bn256_if.obj obj\fp.obj %LDFLAGS% /implib:lib\bn256_if.lib
cl /LD /Febin\bn256_if.dll bn256_if.obj fp.obj %LDFLAGS% link /nologo /DLL /OUT:bin\bn256_if.dll obj\bn256_if.obj obj\fp.obj %LDFLAGS% /implib:lib\bn256_if.lib

@ -62,6 +62,7 @@ mklib.bat
2) make exe binary of sample\pairing.cpp 2) make exe binary of sample\pairing.cpp
``` ```
mk sample\pairing.cpp mk sample\pairing.cpp
bin/bn_test.exe
``` ```
open mcl.sln and build or if you have msbuild.exe open mcl.sln and build or if you have msbuild.exe

@ -0,0 +1,2 @@
set CFLAGS=/MT /DNOMINMAX /Ox /DNDEBUG /W4 /Zi /EHsc /nologo -I ./include -I../xbyak -I../cybozulib/include -I../cybozulib_ext/include
set LDFLAGS=/LIBPATH:..\cybozulib_ext\lib /LIBPATH:.\lib
Loading…
Cancel
Save