-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild_libs.bat
More file actions
37 lines (34 loc) · 852 Bytes
/
Copy pathbuild_libs.bat
File metadata and controls
37 lines (34 loc) · 852 Bytes
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
31
32
33
34
35
36
37
@echo off
VERIFY errors 2>nul
SETLOCAL ENABLEEXTENSIONS
IF ERRORLEVEL 1 GOTO :EOF
TITLE ImpLib SDK
echo Compiling the import libraries
echo.
FOR /f "delims=" %%i IN ('dir /A-D /B /S src\MSVCRT32\*.def src\Win32\*.def src\Win64\*.def 2^>NUL ^| findstr /E /R ".*.def" ^|sort') DO CALL :BLD "%%i"
pause
ENDLOCAL
@echo on
GOTO :EOF
:BLD
SET F=%~n1
SET P=%~p1
FOR %%f IN ("%P:~0,-1%") DO SET P="%%~nxf"
SET P=%P:"=%
CALL :DO_BLD %1 lib\%P%\%F%.lib 0 MS
CALL :DO_BLD %1 lib\%P%\lld\%F%.lib 1 LLD
GOTO :EOF
:DO_BLD
IF NOT EXIST %2 GOTO FASM
XCOPY /L /D /Y %1 %2 | FINDSTR /B /C:"1 " >nul && GOTO FASM
GOTO :EOF
:FASM
SET /p impline=< %1
echo Compiling %2, %4-compatible format
(
echo %impline%
echo RENAME_AR_MEMBERS equ %3
more +1 %1
) >"%~1.tmp"
bin\FASM "%~1.tmp" %2
del /s "%~1.tmp" >nul 2>&1