Repository navigation
Expand file tree
/
Copy pathbuild.cmd
More file actions
34 lines (25 loc) · 1.47 KB
/
Copy pathbuild.cmd
File metadata and controls
34 lines (25 loc) · 1.47 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
@echo off
setlocal enabledelayedexpansion
pushd "%~dp0"
set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
if not exist "!VSWHERE!" echo vswhere.exe not found - install Visual Studio Build Tools. && exit /b 1
set VSPATH=
for /f "usebackq tokens=*" %%i in (`""!VSWHERE!" -latest -products * -property installationPath"`) do set "VSPATH=%%i"
if "!VSPATH!"=="" echo No Visual Studio installation found. && exit /b 1
call "%VSPATH%\Common7\Tools\VsDevCmd.bat" -arch=x86 -host_arch=x64 -no_logo >nul 2>&1
if errorlevel 1 exit /b 1
set MLFLAGS=/nologo /c /coff /W3 /safeseh /Isrc
set LINKFLAGS=/nologo /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /RELEASE /MERGE:.rdata=.text /MAP:build\FoxImg.map
if /i "%1"=="debug" (
set MLFLAGS=%MLFLAGS% /Zi
set LINKFLAGS=%LINKFLAGS% /DEBUG
)
if not exist build mkdir build
set OBJS=
for %%f in (main ui iso9660 theme vfs isowrite preview eltorito dragdrop worker udf udfwrite container strutil xdvdfs xdvdwrite gcmwrite opera operawrite floppy fatwrite d64write adfwrite floppywrite t64write a2write cpmwrite hfswrite prowrite hfsxwrite hfs amiga c64 g64 hfe t64 apple2 cpm teledisk hfsplus deflate bzip2 zstd rvz writers gamecube audio) do (
ml %MLFLAGS% /Fo build\%%f.obj src\%%f.asm || exit /b 1
set OBJS=!OBJS! build\%%f.obj
)
rc /nologo /fo build\foximg.res res\foximg.rc || exit /b 1
link %LINKFLAGS% /OUT:build\FoxImg.exe %OBJS% build\foximg.res || exit /b 1
for %%f in (build\FoxImg.exe) do echo Built %%f (%%~zf bytes)