Because the build tools of UE4 works across platforms (Windows, Mac OS, Linux), steps in this article can be applied to Mac OS and Windows as well.
On Windows, You need to replace RunUAT.sh
with RunUAT.bat
though.
First, get Unreal Engine 4 sourcecode and export the following environment variables:
- $UE4_ROOT Engine sourcecode directory, which contains
Setup.sh
- $GAME_UPROJECT Path of the
.uproject
file of your game project - $ARCHIVED_DIR Your build output directory.
cd $UE4_ROOT
./Setup.sh
./GenerateProjectFiles.sh
make UE4Editor UE4Game UnrealPak CrashReportClient ShaderCompileWorker UnrealLightmass
This will generate Makefiles on Linux (Visual Studio files on Windows, XCode files on Mac OS).
$UE4_ROOT/GenerateProjectFiles.sh -project="$GAME_UPROJECT" -game
$UE4_ROOT/Engine/Build/BatchFiles/RunUAT.sh \
BuildCookRun -project="$GAME_UPROJECT" \
-nop4 -build -cook -compressed -stage \
-noclient -server -serverplatform=Linux -serverconfig=Development \
-pak -archive -archivedirectory="$ARCHIVED_DIR" \
-utf8output
$UE4_ROOT/Engine/Build/BatchFiles/RunUAT.sh \
BuildCookRun -project="$GAME_UPROJECT" \
-nop4 -build -cook -compressed -stage \
-platform=Linux -clientconfig=Development \
-pak -archive -archivedirectory="$ARCHIVED_DIR" \
-utf8output