@echo off if NOT EXIST .\build mkdir .\build set commonLinkerFlags= -opt:ref user32.lib Gdi32.lib winmm.lib set commonCompilerFlags=^ -MT %= Make sure the C runtime library is statically linked =%^ -Gm- %= Turns off incremently building =%^ -nologo %= No one cares you made the compiler Microsoft =%^ -Oi %= Always use intrinsics =%^ -EHa- %= Disable exception handling =%^ -GR- %= Never use runtime type info from C++ =%^ -WX -W4 -wd4201 -wd4100 -wd4189 -wd4505 %= Compiler warnings, -WX warnings as errors, -W4 warning level 4, -wdXXXX disable warning XXXX =%^ -DHANDMADE_INTERNAL=1 -DHANDMADE_SLOW=1 -DHANDMADE_WIN32=1 %= Custom #defines =%^ -FC %= Full path of source code file in diagnostics =%^ -Zi %= Generate debugger info =% pushd .\build cl %commonCompilerFlags% ..\src\handmade.cpp -Fmhandmade.map -LD /link -incremental:no -EXPORT:gameGetSoundSamples -EXPORT:gameUpdateAndRender cl %commonCompilerFlags% -Fe:handmade_win32.exe ..\src\win32_handmade.cpp -Fmwin32_handmade.map /link -incremental:no %commonLinkerFlags% popd exit /b :error echo Failed with error #%errorlevel%. exit /b %errorlevel%