-
-
Notifications
You must be signed in to change notification settings - Fork 99
/
Copy pathbuild-all.bat
91 lines (71 loc) · 3.76 KB
/
build-all.bat
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
@ECHO OFF
REM Build script for cleaning and/or building everything
SET PLATFORM=%1
SET ACTION=%2
SET TARGET=%3
if "%ACTION%" == "build" (
SET ACTION=all
SET ACTION_STR=Building
SET ACTION_STR_PAST=built
SET DO_VERSION=yes
) else (
if "%ACTION%" == "clean" (
SET ACTION=clean
SET ACTION_STR=Cleaning
SET ACTION_STR_PAST=cleaned
SET DO_VERSION=no
) else (
echo "Unknown action %ACTION%. Aborting" && exit
)
)
if "%PLATFORM%" == "windows" (
SET ENGINE_LINK=-luser32
) else (
if "%PLATFORM%" == "linux" (
SET ENGINE_LINK=
) else (
if "%PLATFORM%" == "macos" (
SET ENGINE_LINK=
) else (
echo "Unknown platform %PLATFORM%. Aborting" && exit
)
)
)
REM del bin\*.pdb
SET INC_CORE_RT=-Ikohi.core\src -Ikohi.runtime\src
SET LNK_CORE_RT=-lkohi.core -lkohi.runtime
ECHO "%ACTION_STR% everything on %PLATFORM% (%TARGET%)..."
REM Version Generator - Build this first so it can be used later in the build process.
make -j -f "Makefile.executable.mak" %ACTION% TARGET=%TARGET% ASSEMBLY=kohi.tools.versiongen
IF %ERRORLEVEL% NEQ 0 (echo Error:%ERRORLEVEL% && exit)
REM Engine core lib
make -j -f "Makefile.library.mak" %ACTION% TARGET=%TARGET% ASSEMBLY=kohi.core DO_VERSION=%DO_VERSION% ADDL_LINK_FLAGS="-lgdi32 %ENGINE_LINK%"
IF %ERRORLEVEL% NEQ 0 (echo Error:%ERRORLEVEL% && exit)
REM Engine runtime lib
make -j -f "Makefile.library.mak" %ACTION% TARGET=%TARGET% ASSEMBLY=kohi.runtime DO_VERSION=%DO_VERSION% ADDL_INC_FLAGS="%INC_CORE_RT%" ADDL_LINK_FLAGS="-lkohi.core %ENGINE_LINK%"
IF %ERRORLEVEL% NEQ 0 (echo Error:%ERRORLEVEL% && exit)
REM Vulkan Renderer plugin lib
make -j -f "Makefile.library.mak" %ACTION% TARGET=%TARGET% ASSEMBLY=kohi.plugin.renderer.vulkan DO_VERSION=%DO_VERSION% ADDL_INC_FLAGS="%INC_CORE_RT% -I%VULKAN_SDK%\include" ADDL_LINK_FLAGS="%LNK_CORE_RT% -lvulkan-1 -lshaderc_shared -L%VULKAN_SDK%\Lib"
IF %ERRORLEVEL% NEQ 0 (echo Error:%ERRORLEVEL% && exit)
REM OpenAL plugin lib
make -j -f "Makefile.library.mak" %ACTION% TARGET=%TARGET% ASSEMBLY=kohi.plugin.audio.openal DO_VERSION=%DO_VERSION% ADDL_INC_FLAGS="%INC_CORE_RT% -I'%programfiles(x86)%\OpenAL 1.1 SDK\include'" ADDL_LINK_FLAGS="%LNK_CORE_RT% -lopenal32 -L'%programfiles(x86)%\OpenAL 1.1 SDK\libs\win64'"
IF %ERRORLEVEL% NEQ 0 (echo Error:%ERRORLEVEL% && exit)
REM Standard UI lib
make -j -f "Makefile.library.mak" %ACTION% TARGET=%TARGET% ASSEMBLY=kohi.plugin.ui.standard DO_VERSION=%DO_VERSION% ADDL_INC_FLAGS="%INC_CORE_RT%" ADDL_LINK_FLAGS="%LNK_CORE_RT%"
IF %ERRORLEVEL% NEQ 0 (echo Error:%ERRORLEVEL% && exit)
REM Testbed lib
make -j -f "Makefile.library.mak" %ACTION% TARGET=%TARGET% ASSEMBLY=testbed.klib DO_VERSION=%DO_VERSION% ADDL_INC_FLAGS="%INC_CORE_RT% -Ikohi.plugin.ui.standard\src -Ikohi.plugin.audio.openal\src" ADDL_LINK_FLAGS="%LNK_CORE_RT% -lkohi.plugin.ui.standard -lkohi.plugin.audio.openal"
IF %ERRORLEVEL% NEQ 0 (echo Error:%ERRORLEVEL% && exit)
@REM ---------------------------------------------------
@REM Executables
@REM ---------------------------------------------------
REM Testbed
make -j -f "Makefile.executable.mak" %ACTION% TARGET=%TARGET% ASSEMBLY=testbed.kapp ADDL_INC_FLAGS="%INC_CORE_RT%" ADDL_LINK_FLAGS="%LNK_CORE_RT%"
IF %ERRORLEVEL% NEQ 0 (echo Error:%ERRORLEVEL% && exit)
REM Tests
make -j -f "Makefile.executable.mak" %ACTION% TARGET=%TARGET% ASSEMBLY=kohi.core.tests ADDL_INC_FLAGS="%INC_CORE_RT%" ADDL_LINK_FLAGS="%LNK_CORE_RT%"
IF %ERRORLEVEL% NEQ 0 (echo Error:%ERRORLEVEL% && exit)
REM Tools
make -j -f "Makefile.executable.mak" %ACTION% TARGET=%TARGET% ASSEMBLY=kohi.tools ADDL_INC_FLAGS="%INC_CORE_RT%" ADDL_LINK_FLAGS="%LNK_CORE_RT%"
IF %ERRORLEVEL% NEQ 0 (echo Error:%ERRORLEVEL% && exit)
ECHO All assemblies %ACTION_STR_PAST% successfully on %PLATFORM% (%TARGET%).