-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
54 lines (41 loc) · 1.37 KB
/
build.bat
File metadata and controls
54 lines (41 loc) · 1.37 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
@echo off
setlocal
set SRC=main.c
set OUT=undeadwest.exe
@REM --- CONFIGURE ------------------------------------------------------------------
set MODE=dev
if "%1%"=="debug" set MODE=debug
if "%1%"=="release" set MODE=release
if "%1%"=="push" set MODE=push
if "%MODE%"=="push" (
echo [pushing to Itch.io]
pushd build || exit /b 1
if not exist undead-west-windows mkdir undead-west-windows
pushd undead-west-windows
move ..\%OUT% .
xcopy ..\..\res\ .\res\ /E /y
popd
butler push undead-west-windows goldenbergdev/undead-west:windows --userversion 0.7-dev || /b exit 1
popd
exit /b 0
)
set TARGET=windows_amd64
if not "%2%"=="" (
set TARGET=%2%
)
set COMMON= /std:c17 /nologo /Iext\
if "%MODE%"=="dev" set CFLAGS= /Od /DDEV_MODE
if "%MODE%"=="debug" set CFLAGS= /Od /Z7 /W1 /DDEBUG /DDEV_MODE
if "%MODE%"=="release" set CFLAGS= /O2 /DRELEASE
set LFLAGS= /link /incremental:no /libpath:ext\sokol\lib sokol.lib
echo [target:%TARGET%]
echo [mode:%MODE%]
@REM --- PREPROCESS -----------------------------------------------------------------
@REM echo [process]
@REM shadertoh src\shaders\ src\render\shaders.h
@REM --- BUILD ----------------------------------------------------------------------
echo [build]
if not exist out mkdir out
cl %COMMON% %CFLAGS% %FSAN% src\%SRC% /Feout\%OUT% %LFLAGS% || exit /b 1
del *.obj
if "%MODE%"=="dev" out\%OUT%