58 lines
1.1 KiB
Batchfile
58 lines
1.1 KiB
Batchfile
@echo off
|
|
setlocal enabledelayedexpansion
|
|
cd /D "%~dp0"
|
|
if not exist build mkdir build
|
|
|
|
::::::::::::::::::::::::::::::::
|
|
::~ Unpack args
|
|
|
|
for %%a in (%*) do set "%%a=1"
|
|
|
|
if "%~1" == "" (
|
|
echo [No arguments provided, assuming default `pp` build]
|
|
set meta=1
|
|
set pp=1
|
|
)
|
|
|
|
if "%~1" == "release" if "%~2" == "" (
|
|
echo [No arguments provided, assuming default 'pp' build]
|
|
set meta=1
|
|
set pp=1
|
|
)
|
|
|
|
if not "%release%" == "1" set debug=1
|
|
|
|
if "%release%" == "1" echo [Release]
|
|
if "%debug%" == "1" echo [Debug]
|
|
|
|
::::::::::::::::::::::::::::::::
|
|
::~ Build meta program
|
|
|
|
if "%meta%" == "1" (
|
|
echo [Building meta]
|
|
|
|
:: cl.exe /Fe"build/" /Fo"build/" /c src\\meta\\meta.c /link build/meta.obj
|
|
"cl" /Zi /DEBUG src/meta/meta.c /Fo:build/meta.obj /Fe:build/meta.exe /nologo
|
|
|
|
if not "!errorlevel!" == "0" (
|
|
echo .
|
|
echo Failed to build meta program
|
|
exit /b 1
|
|
)
|
|
)
|
|
|
|
::::::::::::::::::::::::::::::::
|
|
::~ Build power play
|
|
|
|
if "%pp%" == "1" (
|
|
echo [Building power play]
|
|
|
|
"build/meta.exe" pp.lay
|
|
|
|
if not "!errorlevel!" == "0" (
|
|
echo.
|
|
echo Failed to run meta program
|
|
exit /b 1
|
|
)
|
|
)
|