-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (25 loc) · 943 Bytes
/
Copy pathMakefile
File metadata and controls
31 lines (25 loc) · 943 Bytes
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
# Build runtime_bridge.so -- the LD_PRELOAD library.
#
# The bridge is a shared object with C-linkage exports. It is designed to be
# preloaded into an IL2CPP-hosted process; on startup it locates GameAssembly.so
# in /proc/self/maps, dlopens it with RTLD_NOLOAD, and resolves the il2cpp_*
# runtime exports via dlsym.
#
# Usage from a target host:
# LD_PRELOAD=./runtime_bridge.so ./target_binary
#
# The default target module name is "GameAssembly.so" (standard Unity Linux
# output). Override via the BRIDGE_TARGET_MODULE env var if the process uses
# a different name.
CXX ?= g++
CXXFLAGS ?= -std=c++17 -O2 -Wall -Wextra -fPIC -fvisibility=hidden
LDFLAGS ?= -shared -ldl -lpthread
TARGET := runtime_bridge.so
SRC := src/runtime_bridge.cpp
INC := -Iinclude
.PHONY: all clean
all: $(TARGET)
$(TARGET): $(SRC) include/runtime_bridge_api.h
$(CXX) $(CXXFLAGS) $(INC) $(SRC) -o $@ $(LDFLAGS)
clean:
rm -f $(TARGET)