-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
63 lines (54 loc) · 1.38 KB
/
Copy pathbuild.bat
File metadata and controls
63 lines (54 loc) · 1.38 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
@echo off
setlocal
cd /d "%~dp0"
rem Build DTE 3.0 with 32-bit MASM and Crinkler.
rem Run this from an x86 Native Tools Command Prompt.
set "NAME=dte"
set "ASM=%NAME%.asm"
set "OBJ=%NAME%.obj"
set "EXE=%NAME%.exe"
if not exist "%ASM%" (
echo ERROR: %ASM% was not found beside this batch file.
exit /b 1
)
where ml.exe >nul 2>&1
if errorlevel 1 (
echo ERROR: ml.exe was not found.
echo Run this from an x86 Native Tools Command Prompt.
exit /b 1
)
if exist "%~dp0Crinkler.exe" (
set "CRINKLER=%~dp0Crinkler.exe"
) else (
where Crinkler.exe >nul 2>&1
if errorlevel 1 (
echo ERROR: Crinkler.exe was not found.
echo Put Crinkler.exe beside this batch file or add it to PATH.
exit /b 1
)
set "CRINKLER=Crinkler.exe"
)
echo Assembling %ASM%...
ml.exe /nologo /c /coff /Fo"%OBJ%" "%ASM%"
if errorlevel 1 (
echo ERROR: MASM assembly failed.
exit /b 1
)
echo Linking and compressing %EXE%...
"%CRINKLER%" ^
/OUT:"%EXE%" ^
/ENTRY:WinX86Entry ^
/SUBSYSTEM:WINDOWS ^
/NODEFAULTLIB ^
/TINYIMPORT ^
/UNALIGNCODE ^
/NOINITIALIZERS ^
/ORDERTRIES:2000 ^
"%OBJ%" kernel32.lib user32.lib gdi32.lib
if errorlevel 1 (
echo ERROR: Crinkler build failed.
exit /b 1
)
for %%F in ("%EXE%") do echo Built %%~nxF - %%~zF bytes
del "%OBJ%"
exit /b 0