make.bat 2.24 KB
Newer Older
William Bundy's avatar
William Bundy committed
1 2 3 4
@echo off
SET msvcdir=C:\Program Files^ (x86)\Microsoft^ Visual^ Studio^ 14.0\VC\
if not defined DevEnvDir call "%msvcdir%vcvarsall.bat" amd64

5 6
SET MAINFILEBASE=rituals_main
SET MAINFILE=src\%MAINFILEBASE%.cpp
William Bundy's avatar
William Bundy committed
7 8
SET PPC_OUT_RAW=%MAINFILEBASE%.i
SET PPC_OUT=rituals_ppc.cpp
William Bundy's avatar
William Bundy committed
9
SET BASENAME=Rituals.exe
William Bundy's avatar
William Bundy committed
10 11
SET OUTPUT=bin\Rituals.exe
SET PDBOUT=bin\Rituals.pdb
12 13
SET LIBRARIES="msvc_libs\lib"
SET INCLUDES=msvc_libs\include\
William Bundy's avatar
William Bundy committed
14 15 16 17 18 19 20

SET DEBUG_DEF=DEBUG
SET RELEASE_DEF=RELEASE

SET DISABLED_WARNINGS=/wd4477 ^
	/wd4244 ^
	/wd4267 ^
William Bundy's avatar
William Bundy committed
21 22
	/wd4334 ^
	/wd4305
William Bundy's avatar
William Bundy committed
23 24 25 26

SET LIBS=SDL2.lib ^
	SDL2main.lib ^
	SDL2_mixer.lib ^
William Bundy's avatar
William Bundy committed
27 28
	opengl32.lib ^
	Shlwapi.lib
William Bundy's avatar
William Bundy committed
29

William Bundy's avatar
William Bundy committed
30
start python autogit.py
William Bundy's avatar
William Bundy committed
31

32 33 34 35 36 37 38

cl ^
	/P ^
	/I %INCLUDES% ^
	%MAINFILE% ^
	/DPREPROCESSOR

William Bundy's avatar
William Bundy committed
39 40 41
del %PPC_OUT%
ren %PPC_OUT_RAW% %PPC_OUT%

42
metaprogram -m %PPC_OUT% > src\rituals_reflection.cpp
William Bundy's avatar
William Bundy committed
43
metaprogram -t -s -p %PPC_OUT% > src\rituals_types.cpp
44

William Bundy's avatar
William Bundy committed
45
taskkill /IM %BASENAME% 
46
ctime -begin rituals.ctm
William Bundy's avatar
William Bundy committed
47
if "%~1"=="" goto DEBUG_BUILD
William Bundy's avatar
William Bundy committed
48
if "%~1"=="meta" goto META_BUILD
William Bundy's avatar
William Bundy committed
49 50 51 52
if "%~1"=="release" goto RELEASE_BUILD
if "%~1"=="debug" goto DEBUG_BUILD
if "%~1"=="run" goto DEBUG_BUILD

William Bundy's avatar
William Bundy committed
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
:META_BUILD
set META_MAIN=src\metaprogram\metaprogram_main.cpp
set META_OUT=metaprogram.exe
set META_PDB=metaprogram.pdb

cl ^
	/Zi ^
	/MTd ^
	/W3 ^
	/Gd ^
	%DISABLED_WARNINGS% ^
	%META_MAIN% ^
	/EHsc ^
	/Fe%META_OUT% ^
	/Fd%META_PDB% ^
	/D%DEBUG_DEF% ^
	/DRITUALS_WINDOWS#1 ^
	/link ^
	/SUBSYSTEM:CONSOLE ^
	/NOLOGO ^
	/INCREMENTAL:NO
goto END


William Bundy's avatar
William Bundy committed
77 78 79 80 81
:DEBUG_BUILD
echo Building a debug build with %DEBUG_DEF% defined
cl ^
	/I %INCLUDES% ^
	/Zi ^
William Bundy's avatar
William Bundy committed
82
	/MTd ^
William Bundy's avatar
William Bundy committed
83 84 85 86 87 88 89 90 91
	/W3 ^
	/Gd ^
	%DISABLED_WARNINGS% ^
	%MAINFILE% ^
	%LIBS% ^
	/EHsc ^
	/Fe%OUTPUT% ^
	/Fd%PDBOUT% ^
	/D%DEBUG_DEF% ^
William Bundy's avatar
William Bundy committed
92
	/DRITUALS_WINDOWS#1 ^
William Bundy's avatar
William Bundy committed
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
	/link ^
	/LIBPATH:%LIBRARIES% ^
	/SUBSYSTEM:CONSOLE ^
	/NOLOGO ^
	/INCREMENTAL:NO
pushd bin
GOTO END

:RELEASE_BUILD
echo Building a release build with %RELEASE_DEF% defined
cl ^
	/I %INCLUDES% ^
	/MT ^
	%DISABLED_WARNINGS% ^
	/Gd ^
	/O2 ^
	%MAINFILE% ^
	%LIBS% ^
	/Fe%OUTPUT% ^
	/Fd%PDBOUT% ^
	/D%RELEASE_DEF% ^
William Bundy's avatar
William Bundy committed
114
	/DRITUALS_WINDOWS#1 ^
William Bundy's avatar
William Bundy committed
115 116 117
	/EHsc ^
	/link ^
	/LIBPATH:%LIBRARIES% ^
118
	/SUBSYSTEM:CONSOLE ^
William Bundy's avatar
William Bundy committed
119 120 121 122 123 124 125 126
	/NOLOGO ^
	/INCREMENTAL:NO
pushd bin
GOTO END

:END
popd
del *.obj
127
ctime -end rituals.ctm
William Bundy's avatar
William Bundy committed
128 129 130 131 132 133 134 135 136 137 138
echo Build Complete
if "%~1"=="run" goto RUN_APP
if "%~2"=="run" goto RUN_APP
GOTO END2

:RUN_APP
start %OUTPUT%
GOTO END2

:END2