forked from Aphoh/blst
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.bat
executable file
·30 lines (29 loc) · 977 Bytes
/
build.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
@echo off
set TOP=%~dp0
cl /nologo /c /O2 /Zi /Fdblst.pdb /W4 /MT /Zl %TOP%src\server.c || EXIT /B
FOR %%F IN (%TOP%build\win64\*-x86_64.asm) DO (
ml64 /nologo /c /Cp /Cx /Zi %%F || EXIT /B
)
rem FOR %%F IN (%TOP%src\asm\*-x86_64.pl) DO (
rem IF NOT EXIST %%~nF.asm (perl %%F masm %%~nF.asm)
rem )
rem FOR %%F IN (*.asm) DO (ml64 /nologo /c /Cp /Cx /Zi %%F || EXIT /B)
SETLOCAL ENABLEDELAYEDEXPANSION
set static=/out:blst.lib
set shared=
FOR %%O IN (%*) DO (
set opt=%%O
IF "!opt!" == "-shared" (
IF [!shared!] EQU [] set shared=/out:blst.dll
) ELSE IF "!opt:~0,5!" == "/out:" (
IF "!opt:~-4!" == ".dll" (set shared=!opt!) ELSE (set static=!opt!)
)
)
IF [%shared%] NEQ [] (
cl /nologo /c /O2 /Oi- /MD %TOP%build\win64\dll.c || EXIT /B
link /nologo /debug /dll /entry:DllMain /incremental:no %shared% /def:%TOP%build\win64\blst.def *.obj kernel32.lib && del *.obj
) ELSE (
lib /nologo %static% *.obj && del *.obj
)
ENDLOCAL
EXIT /B