-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
41 lines (36 loc) · 1.35 KB
/
Makefile
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
PYTHON_EXE ?= C:\Program Files\Python311\python.exe
BUILDS_DIR ?= E:\UnrealEngine\Thirdweb\PluginBuilds
BUILD_HOST_PLATFORM ?= false
UE_VERSION ?= 5.4
PLUGIN_VERSION ?= 1.3.0
# Determine the current OS in a platform-independent manner
ifeq ($(OS),Windows_NT)
SHELL := cmd.exe
TARGET_PLATFORMS ?= Win64+Android+Linux+LinuxArm64
PATH_SEP := \\
UE4CLI_CONFIG_DIR_BASE := %APPDATA%\ue4cli
else
UNAME_S := $(shell uname -s)
UE4CLI_CONFIG_DIR_BASE := ~/.config/ue4cli
PATH_SEP := /
ifeq ($(UNAME_S),Linux)
TARGET_PLATFORMS ?= Android+Linux+LinuxArm64
else ifeq ($(UNAME_S),darwin)
TARGET_PLATFORMS ?= IOS+Mac+TVOS+VisionOS
endif
endif
ifeq ($(BUILD_HOST_PLATFORM),false)
HOST_PLATFORM_FLAG := -NoHostPlatform
else
HOST_PLATFORM_FLAG :=
endif
UE4_EXE := $(PYTHON_EXE) -m ue4cli
UE4CLI_CONFIG_DIR := $(UE4CLI_CONFIG_DIR_BASE)$(PATH_SEP)$(UE_VERSION)
.PHONY: build
build:
$(UE4_EXE) setroot $(UE_ENGINE_DIR)
$(UE4_EXE) package $(HOST_PLATFORM_FLAG) -TargetPlatforms=$(TARGET_PLATFORMS) -Package=$(BUILDS_DIR)\\$(UE_VERSION)
.PHONY: compress
compress:
cd $(BUILDS_DIR)
pwsh -Command Compress-Archive -LiteralPath "$(BUILDS_DIR)\\$(UE_VERSION)\\Source", "$(BUILDS_DIR)\\$(UE_VERSION)\\Content", "$(BUILDS_DIR)\\$(UE_VERSION)\\Thirdweb.uplugin" -DestinationPath "$(BUILDS_DIR)\\ThirdwebSDK-$(PLUGIN_VERSION)-$(UE_VERSION).zip" -CompressionLevel Optimal