-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy pathbuild_windows.mk
More file actions
253 lines (228 loc) · 11.4 KB
/
build_windows.mk
File metadata and controls
253 lines (228 loc) · 11.4 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
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# ---------------------------------------------------------------------------------------------------------------------
#
# Copyright (C) Microsoft Corporation.
# Copyright (C) 2025 IAMAI CONSULTING CORP
#
# MIT License. All rights reserved.
#
# Module Name:
#
# build_windows.mk
#
# Abstract:
#
# Main makefile for Windows builds to drive CMake/UBT commands.
#
# ---------------------------------------------------------------------------------------------------------------------
REDIRECT_OUTPUT = > NUL 2>&1
default:
@echo =======================================================================
@echo No target specified. Please run 'build [target]' using the following targets:
@echo.
@echo. all = Build + Test + Package everything
@echo. rebuild_all = Clean + Build + Test + Package everything
@echo. all_no_test = Build + Package everything
@echo. clean = Clean sim libs + Blocks build files
@echo.
@echo. simlibs_debug = Build + Package sim libs for Debug
@echo. simlibs_release = Build + Package sim libs for Release
@echo. test_simlibs_debug = Test sim libs for Debug
@echo. test_simlibs_release = Test sim libs for Release
@echo.
@echo. blocks_debuggame = Build Plugin + Blocks for DebugGame (uses Debug sim libs)
@echo. blocks_development = Build Plugin + Blocks for Development (uses Release sim libs)
@echo. blocks_shipping = Build Plugin + Blocks for Shipping (uses Release sim libs)
@echo.
@echo. package_simlibs = Package sim libs for Debug + Release
@echo. package_plugin = Package UE Plugin for Debug + Release
@echo. package_blocks_debuggame = Package stand-alone Blocks environment executable for DebugGame
@echo. package_blocks_development = Package stand-alone Blocks environment executable for Development
@echo. package_blocks_shipping = Package stand-alone Blocks environment executable for Shipping
.PHONY: all
all: simlibs_debug test_simlibs_debug simlibs_release test_simlibs_release package_simlibs package_plugin package_blocks_debuggame package_blocks_development package_blocks_shipping
.PHONY: rebuild_all
rebuild_all: clean simlibs_debug test_simlibs_debug simlibs_release test_simlibs_release package_simlibs package_plugin package_blocks_debuggame package_blocks_development package_blocks_shipping
.PHONY: all_no_test
all_no_test: simlibs_debug simlibs_release package_simlibs package_plugin package_blocks_debuggame package_blocks_development package_blocks_shipping
# ---------------------------------------------------------------------------------------------------------------------
#
# CMAKE integration.
#
# ---------------------------------------------------------------------------------------------------------------------
CMAKE_BUILD_DIR = build\win64
CMAKE_CMD = cmake -G "Ninja" \
-DCMAKE_C_COMPILER=cl.exe \
-DCMAKE_CXX_COMPILER=cl.exe
CMAKE_DBG_BUILD_CMD = cmake --build $(CMAKE_BUILD_DIR)\Debug
CMAKE_REL_BUILD_CMD = cmake --build $(CMAKE_BUILD_DIR)\Release
.PHONY: config_simlibs_debug
config_simlibs_debug:
@echo =======================================================================
@echo Configuring the ProjectAirSimLibs project for Win64-Debug...
-mkdir $(CMAKE_BUILD_DIR)\Debug $(REDIRECT_OUTPUT)
cd $(CMAKE_BUILD_DIR)\Debug && $(CMAKE_CMD) -DCMAKE_BUILD_TYPE=Debug ..\..\..
.PHONY: simlibs_debug
simlibs_debug: config_simlibs_debug
@echo =======================================================================
@echo Building the ProjectAirSimLibs project for Win64-Debug...
$(CMAKE_DBG_BUILD_CMD)
.PHONY: config_simlibs_release
config_simlibs_release:
@echo =======================================================================
@echo Configuring the ProjectAirSimLibs project for Win64-Release...
-mkdir $(CMAKE_BUILD_DIR)\Release $(REDIRECT_OUTPUT)
cd $(CMAKE_BUILD_DIR)\Release && $(CMAKE_CMD) -DCMAKE_BUILD_TYPE=Release ..\..\..
.PHONY: simlibs_release
simlibs_release: config_simlibs_release
@echo =======================================================================
@echo Building the ProjectAirSimLibs project for Win64-Release...
$(CMAKE_REL_BUILD_CMD)
.PHONY: package_simlibs
package_simlibs: simlibs_debug simlibs_release
@echo =======================================================================
@echo Packaging sim libs for use in custom projects...
-robocopy "%CD%\unreal\Blocks\Plugins\ProjectAirSim\SimLibs" \
"%CD%\packages\projectairsim_simlibs" \
/E /NP $(REDIRECT_OUTPUT)
@echo Packaging completed to: %CD%\packages\projectairsim_simlibs
.PHONY: clean
clean:
@echo =======================================================================
@echo Cleaning build files...
-rmdir /S /Q $(CMAKE_BUILD_DIR) $(REDIRECT_OUTPUT)
-rmdir /S /Q physics\matlab_sfunc\_deps $(REDIRECT_OUTPUT)
-rmdir /S /Q physics\matlab_sfunc\message $(REDIRECT_OUTPUT)
-rmdir /S /Q packages\projectairsim_simlibs $(REDIRECT_OUTPUT)
-rmdir /S /Q unreal\Blocks\Plugins\ProjectAirSim\SimLibs $(REDIRECT_OUTPUT)
@echo Cleaning Blocks build folders...
-rmdir /S /Q unreal\Blocks\Binaries $(REDIRECT_OUTPUT)
-rmdir /S /Q unreal\Blocks\Build $(REDIRECT_OUTPUT)
-rmdir /S /Q unreal\Blocks\Intermediate $(REDIRECT_OUTPUT)
-rmdir /S /Q unreal\Blocks\Saved $(REDIRECT_OUTPUT)
-rmdir /S /Q unreal\Blocks\Plugins\ProjectAirSim\Binaries $(REDIRECT_OUTPUT)
-rmdir /S /Q unreal\Blocks\Plugins\ProjectAirSim\Intermediate $(REDIRECT_OUTPUT)
-rmdir /S /Q unity\BlocksUnity\Assets\Plugins $(REDIRECT_OUTPUT)
-rmdir /S /Q packages\Blocks $(REDIRECT_OUTPUT)
-rmdir /S /Q packages\projectairsim_ue_plugin $(REDIRECT_OUTPUT)
# ---------------------------------------------------------------------------------------------------------------------
#
# Test integration.
#
# ---------------------------------------------------------------------------------------------------------------------
CTEST_DBG_CMD = ctest -C Debug -V -T test --no-compress-output
CTEST_REL_CMD = ctest -C Release -V -T test --no-compress-output
CMAKE_DBG_TEST_CMD = cd $(CMAKE_BUILD_DIR)\Debug && $(CTEST_DBG_CMD)
CMAKE_REL_TEST_CMD = cd $(CMAKE_BUILD_DIR)\Release && $(CTEST_REL_CMD)
.PHONY: test_simlibs_debug
test_simlibs_debug: simlibs_debug
@echo =======================================================================
@echo Testing the ProjectAirSimLibs project for Win64-Debug...
$(CMAKE_DBG_TEST_CMD)
.PHONY: test_simlibs_release
test_simlibs_release: simlibs_release
@echo =======================================================================
@echo Testing the ProjectAirSimLibs project for Win64-Release...
$(CMAKE_REL_TEST_CMD)
# ---------------------------------------------------------------------------------------------------------------------
#
# UE build/package integration.
#
# ---------------------------------------------------------------------------------------------------------------------
.PHONY: blocks_debuggame
blocks_debuggame: simlibs_debug
@echo =======================================================================
@echo Building UE plugin and game for DebugGame (with Debug sim libs) variant...
!ifndef UE_ROOT
@echo.
@echo ERROR: UE_ROOT environmant variable is not set. It must be set to the target \
Unreal engine's root folder path, ex. C:\Program Files\Epic Games\UE_4.25
!else
@echo UE_ROOT env variable set to: %%UE_ROOT%%
"%UE_ROOT%\Engine\Build\BatchFiles\Build.bat" Blocks Win64 DebugGame \
-project="%CD%\unreal\Blocks\Blocks.uproject"
"%UE_ROOT%\Engine\Build\BatchFiles\Build.bat" BlocksEditor Win64 DebugGame \
-project="%CD%\unreal\Blocks\Blocks.uproject"
!endif
.PHONY: blocks_development
blocks_development: simlibs_release
@echo =======================================================================
@echo Building UE plugin and game for Development (with Release sim libs) variant...
!ifndef UE_ROOT
@echo.
@echo ERROR: UE_ROOT environmant variable is not set. It must be set to the target \
Unreal engine's root folder path, ex. C:\Program Files\Epic Games\UE_4.25
!else
@echo UE_ROOT env variable set to: %%UE_ROOT%%
"%UE_ROOT%\Engine\Build\BatchFiles\Build.bat" Blocks Win64 Development \
-project="%CD%\unreal\Blocks\Blocks.uproject"
!endif
.PHONY: blocks_shipping
blocks_shipping: simlibs_release
@echo =======================================================================
@echo Building UE plugin and game for Shipping (with Release sim libs) variant...
!ifndef UE_ROOT
@echo.
@echo ERROR: UE_ROOT environmant variable is not set. It must be set to the target \
Unreal engine's root folder path, ex. C:\Program Files\Epic Games\UE_4.25
!else
@echo UE_ROOT env variable set to: %%UE_ROOT%%
"%UE_ROOT%\Engine\Build\BatchFiles\Build.bat" Blocks Win64 Shipping \
-project="%CD%\unreal\Blocks\Blocks.uproject"
!endif
# Cooking content uses Development Editor so packaging DebugGame needs both Debug and Release sim libs builds
.PHONY: package_blocks_debuggame
package_blocks_debuggame: simlibs_debug simlibs_release
@echo =======================================================================
@echo Building/cooking/packaging UE stand-alone game for DebugGame (with Debug sim libs) variant...
!ifndef UE_ROOT
@echo.
@echo ERROR: UE_ROOT environmant variable is not set. It must be set to the target \
Unreal engine's root folder path, ex. C:\Program Files\Epic Games\UE_4.25
!else
@echo UE_ROOT env variable set to: %%UE_ROOT%%
"%UE_ROOT%\Engine\Build\BatchFiles\RunUAT.bat" BuildCookRun \
-project="%CD%\unreal\Blocks\Blocks.uproject" \
-nop4 -nocompile -build -cook -compressed -pak -allmaps -stage \
-archive -archivedirectory="%CD%\packages\Blocks\DebugGame" \
-clientconfig=DebugGame -clean -utf8output -prereqs
!endif
.PHONY: package_blocks_development
package_blocks_development: simlibs_release
@echo =======================================================================
@echo Building/cooking/packaging UE stand-alone game for Development (with Release sim libs) variant...
!ifndef UE_ROOT
@echo.
@echo ERROR: UE_ROOT environmant variable is not set. It must be set to the target \
Unreal engine's root folder path, ex. C:\Program Files\Epic Games\UE_4.25
!else
@echo UE_ROOT env variable set to: %%UE_ROOT%%
"%UE_ROOT%\Engine\Build\BatchFiles\RunUAT.bat" BuildCookRun \
-project="%CD%\unreal\Blocks\Blocks.uproject" \
-nop4 -nocompile -build -cook -compressed -pak -allmaps -stage \
-archive -archivedirectory="%CD%\packages\Blocks\Development" \
-clientconfig=Development -clean -utf8output -prereqs
!endif
.PHONY: package_blocks_shipping
package_blocks_shipping: simlibs_release
@echo =======================================================================
@echo Building/cooking/packaging UE stand-alone game for Shipping (with Release sim libs) variant...
!ifndef UE_ROOT
@echo.
@echo ERROR: UE_ROOT environmant variable is not set. It must be set to the target \
Unreal engine's root folder path, ex. C:\Program Files\Epic Games\UE_4.25
!else
@echo UE_ROOT env variable set to: %%UE_ROOT%%
"%UE_ROOT%\Engine\Build\BatchFiles\RunUAT.bat" BuildCookRun \
-project="%CD%\unreal\Blocks\Blocks.uproject" \
-nop4 -nocompile -build -cook -compressed -pak -allmaps -stage \
-archive -archivedirectory="%CD%\packages\Blocks\Shipping" \
-clientconfig=Shipping -clean -utf8output -prereqs -nodebuginfo
!endif
.PHONY: package_plugin
package_plugin: blocks_debuggame blocks_development blocks_shipping
@echo =======================================================================
@echo Packaging UE plugin for use in custom environments...
-robocopy "%CD%\unreal\Blocks\Plugins" \
"%CD%\packages\projectairsim_ue_plugin\Plugins" \
/E /NP /XD Binaries Intermediate $(REDIRECT_OUTPUT)
@echo Packaging completed to: %CD%\packages\projectairsim_ue_plugin