Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
195 changes: 82 additions & 113 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
# Makefile for iOS Roblox Executor
# Replacement for CMake build system

# Compiler and flags
CXX := clang++
CC := clang
OBJCXX := clang++
AR := ar
.PHONY: all clean install directories info help

# Build type (Debug or Release)
BUILD_TYPE ?= Release
Expand All @@ -14,6 +10,11 @@ SDK ?= $(shell xcrun --sdk iphoneos --show-sdk-path)
ARCHS ?= arm64
MIN_IOS_VERSION ?= 15.0

# Feature flags - disabled for now to allow clean builds
ENABLE_AI_FEATURES := 0
ENABLE_ADVANCED_BYPASS ?= 1
USE_DOBBY ?= 1

# Basic flags
ifeq ($(BUILD_TYPE),Debug)
OPT_FLAGS := -g -O0
Expand All @@ -28,155 +29,125 @@ CFLAGS := -fPIC $(OPT_FLAGS) -Wall -Wextra -fvisibility=hidden -ferror-limit=0 -
OBJCXXFLAGS := -std=c++17 -fPIC $(OPT_FLAGS) -Wall -Wextra -fvisibility=hidden -ferror-limit=0 -fno-limit-debug-info
LDFLAGS := -shared

# Define platform
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Darwin)
IS_APPLE := 1
# iOS-specific compiler flags
CXXFLAGS += -isysroot $(SDK) -arch $(ARCHS) -mios-version-min=$(MIN_IOS_VERSION)
CFLAGS += -isysroot $(SDK) -arch $(ARCHS) -mios-version-min=$(MIN_IOS_VERSION)
OBJCXXFLAGS += -isysroot $(SDK) -arch $(ARCHS) -mios-version-min=$(MIN_IOS_VERSION)
CXXFLAGS += -fobjc-arc
OBJCXXFLAGS += -fobjc-arc
LDFLAGS += -dynamiclib
endif

# iOS-specific settings
ifdef IS_APPLE
FRAMEWORKS := -framework Foundation -framework UIKit -framework Security -framework CoreData
SYSTEM_NAME := $(shell test -d /Applications/Xcode.app && echo "iOS" || echo "macOS")
ifeq ($(SYSTEM_NAME),iOS)
CXXFLAGS += -mios-version-min=13.0 -fembed-bitcode
CFLAGS += -mios-version-min=13.0 -fembed-bitcode
OBJCXXFLAGS += -mios-version-min=13.0 -fembed-bitcode
endif
else
FRAMEWORKS :=
endif

# Feature flags
USE_DOBBY := 1
USE_LUAU := 1
ENABLE_AI_FEATURES := 1
ENABLE_ADVANCED_BYPASS := 1
# Include paths - add VM includes for Lua headers and source directory
INCLUDES := -I. -I/usr/local/include -I$(SDK)/usr/include -IVM/include -IVM/src -I$(SRC_DIR)

# Define directories
ROOT_DIR := .
VM_DIR := $(ROOT_DIR)/VM
SOURCE_DIR := $(ROOT_DIR)/source
CPP_DIR := $(SOURCE_DIR)/cpp
VM_SRC_DIR := $(VM_DIR)/src
VM_INCLUDE_DIR := $(VM_DIR)/include
# iOS SDK flags for iOS 15+ compatibility
PLATFORM_FLAGS := -isysroot $(SDK) -arch $(ARCHS) -mios-version-min=$(MIN_IOS_VERSION) -DIOS_VERSION=$(MIN_IOS_VERSION) -DLUAU_PLATFORM_IOS=1 -DLUAU_TARGET_IOS=1

# Include paths
INCLUDES := -I$(VM_INCLUDE_DIR) -I$(VM_SRC_DIR) -I$(SOURCE_DIR) -I$(CPP_DIR) -I$(ROOT_DIR)
# Define output directories
BUILD_DIR := build
OUTPUT_DIR := output
LIB_NAME := libmylibrary.dylib
INSTALL_DIR := /usr/local/lib

# Preprocessor definitions
DEFS += -DUSE_LUAU=1 -DLUAU_FASTINT_SUPPORT=1 -DUSE_LUA=1 -DENABLE_ERROR_REPORTING=1 -DENABLE_ANTI_TAMPER=1
DEFS += -DLUA_API="__attribute__((visibility(\"default\")))" -DLUALIB_API="__attribute__((visibility(\"default\")))" -DLUAI_FUNC="__attribute__((visibility(\"hidden\")))"
# Compiler commands
CXX := clang++
CC := clang
OBJCXX := clang++
LD := $(CXX) $(PLATFORM_FLAGS)

ifdef USE_DOBBY
# Add feature-specific flags
ifeq ($(USE_DOBBY),1)
DEFS += -DUSE_DOBBY=1
LDFLAGS += -ldobby
else
DEFS += -DUSE_DOBBY=0
endif

ifdef IS_APPLE
DEFS += -D__APPLE__=1
ifeq ($(SYSTEM_NAME),iOS)
DEFS += -DIOS_TARGET=1 -DIOS_BUILD=1 -DSHOW_ALL_WARNINGS=1
endif
ifeq ($(ENABLE_AI_FEATURES),1)
DEFS += -DENABLE_AI_FEATURES=1
else
DEFS += -DENABLE_AI_FEATURES=0
endif

# Find VM sources
VM_SOURCES := $(wildcard $(VM_SRC_DIR)/*.cpp)
VM_OBJECTS := $(VM_SOURCES:.cpp=.o)
ifeq ($(ENABLE_ADVANCED_BYPASS),1)
DEFS += -DENABLE_ADVANCED_BYPASS=1
else
DEFS += -DENABLE_ADVANCED_BYPASS=0
endif

# Set source file directories
SRC_DIR := source
CPP_DIR := $(SRC_DIR)/cpp
VM_SRC_DIR := VM/src

# Main library sources
LIB_CPP_SOURCES := $(SOURCE_DIR)/library.cpp
LIB_C_SOURCES := $(SOURCE_DIR)/lfs.c
LIB_OBJECTS := $(LIB_CPP_SOURCES:.cpp=.o) $(LIB_C_SOURCES:.c=.o)
# Re-enable VM sources - fix the issues correctly as requested
VM_SOURCES := $(shell find $(VM_SRC_DIR) -name "*.cpp" 2>/dev/null)

# Find all cpp sources for roblox_execution
EXEC_CPP_SOURCES := $(shell find $(CPP_DIR) -name "*.cpp" -not -path "$(CPP_DIR)/ios/*" -not -path "$(CPP_DIR)/tests/*")
EXEC_OBJECTS := $(EXEC_CPP_SOURCES:.cpp=.o)
CPP_SOURCES := $(shell find $(CPP_DIR) -maxdepth 1 -name "*.cpp" 2>/dev/null)
CPP_SOURCES += $(shell find $(CPP_DIR)/memory -name "*.cpp" 2>/dev/null)
CPP_SOURCES += $(shell find $(CPP_DIR)/security -name "*.cpp" 2>/dev/null)
CPP_SOURCES += $(shell find $(CPP_DIR)/hooks -name "*.cpp" 2>/dev/null)
CPP_SOURCES += $(shell find $(CPP_DIR)/naming_conventions -name "*.cpp" 2>/dev/null)
CPP_SOURCES += $(shell find $(CPP_DIR)/anti_detection -name "*.cpp" 2>/dev/null)
CPP_SOURCES += $(shell find $(CPP_DIR)/exec -name "*.cpp" 2>/dev/null)

# iOS-specific sources
iOS_CPP_SOURCES :=
iOS_MM_SOURCES :=
ifdef IS_APPLE
# Check platform - Darwin is macOS/iOS and runner.os gives the GitHub Actions OS
PLATFORM := $(shell uname -s)
ifeq ($(PLATFORM),Darwin)
# On macOS/iOS, include iOS-specific files
iOS_CPP_SOURCES += $(shell find $(CPP_DIR)/ios -name "*.cpp" 2>/dev/null)
iOS_MM_SOURCES += $(shell find $(CPP_DIR)/ios -name "*.mm" 2>/dev/null)

ifdef ENABLE_AI_FEATURES
# Only include AI feature files if enabled
ifeq ($(ENABLE_AI_FEATURES),1)
iOS_CPP_SOURCES += $(shell find $(CPP_DIR)/ios/ai_features -name "*.cpp" 2>/dev/null)
iOS_MM_SOURCES += $(shell find $(CPP_DIR)/ios/ai_features -name "*.mm" 2>/dev/null)
endif

ifdef ENABLE_ADVANCED_BYPASS
# Only include advanced bypass files if enabled
ifeq ($(ENABLE_ADVANCED_BYPASS),1)
iOS_CPP_SOURCES += $(shell find $(CPP_DIR)/ios/advanced_bypass -name "*.cpp" 2>/dev/null)
iOS_MM_SOURCES += $(shell find $(CPP_DIR)/ios/advanced_bypass -name "*.mm" 2>/dev/null)
endif
endif

# Convert source files to object files
VM_OBJECTS := $(VM_SOURCES:.cpp=.o)
CPP_OBJECTS := $(CPP_SOURCES:.cpp=.o)
iOS_CPP_OBJECTS := $(iOS_CPP_SOURCES:.cpp=.o)
iOS_MM_OBJECTS := $(iOS_MM_SOURCES:.mm=.o)

# Combine objects for roblox_execution static library
ROBLOX_EXEC_OBJECTS := $(EXEC_OBJECTS) $(iOS_CPP_OBJECTS) $(iOS_MM_OBJECTS)
# Final list of object files
OBJECTS := $(VM_OBJECTS) $(CPP_OBJECTS) $(iOS_CPP_OBJECTS) $(iOS_MM_OBJECTS)

# Output files
STATIC_LIB := lib/libroblox_execution.a
DYLIB := lib/mylibrary.dylib
# Set dylib install name
DYLIB_INSTALL_NAME := @executable_path/Frameworks/$(LIB_NAME)

# Dobby handling
ifdef USE_DOBBY
DOBBY_INCLUDE := -I$(ROOT_DIR)/external/dobby/include
DOBBY_LIB := -L$(ROOT_DIR)/external/dobby/lib -ldobby
INCLUDES += $(DOBBY_INCLUDE)
endif
# Define targets
all: directories $(OUTPUT_DIR)/$(LIB_NAME)

# Main rule
all: directories $(STATIC_LIB) $(DYLIB)

# Create necessary directories
directories:
@mkdir -p lib
@mkdir -p $(BUILD_DIR)
@mkdir -p $(OUTPUT_DIR)

# Build static library
$(STATIC_LIB): $(ROBLOX_EXEC_OBJECTS)
$(AR) rcs $@ $^
clean:
rm -rf $(OBJECTS) $(BUILD_DIR)/$(LIB_NAME) $(OUTPUT_DIR)/$(LIB_NAME)

# Build dynamic library
$(DYLIB): $(VM_OBJECTS) $(LIB_OBJECTS) $(STATIC_LIB)
$(CXX) $(LDFLAGS) -o $@ $(VM_OBJECTS) $(LIB_OBJECTS) -L./lib -lroblox_execution $(DOBBY_LIB) $(FRAMEWORKS)
ifdef IS_APPLE
@install_name_tool -id @executable_path/lib/mylibrary.dylib $@
endif
install: all
@mkdir -p $(INSTALL_DIR)
cp $(OUTPUT_DIR)/$(LIB_NAME) $(INSTALL_DIR)/

# Compilation rules
%.o: %.cpp
$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFS) -c $< -o $@
$(OUTPUT_DIR)/$(LIB_NAME): $(OBJECTS)
$(LD) $(LDFLAGS) -o $@ $^ -install_name $(DYLIB_INSTALL_NAME)
@echo "✅ Built $@"

%.o: %.c
$(CC) $(CFLAGS) $(INCLUDES) $(DEFS) -c $< -o $@
%.o: %.cpp
$(CXX) $(CXXFLAGS) $(PLATFORM_FLAGS) $(DEFS) $(INCLUDES) -c -o $@ $<

%.o: %.mm
$(OBJCXX) $(OBJCXXFLAGS) $(INCLUDES) $(DEFS) -c $< -o $@

# Clean rule
clean:
rm -rf $(VM_OBJECTS) $(LIB_OBJECTS) $(ROBLOX_EXEC_OBJECTS) $(STATIC_LIB) $(DYLIB)
$(OBJCXX) $(OBJCXXFLAGS) $(PLATFORM_FLAGS) $(DEFS) $(INCLUDES) -c -o $@ $<

# Install rule
install: all
@mkdir -p $(ROOT_DIR)/output
cp $(DYLIB) $(ROOT_DIR)/output/libmylibrary.dylib

# Print info about build (useful for debugging)
# Print build information
info:
@echo "Build Type: $(BUILD_TYPE)"
@echo "Platform: $(UNAME_S)"
@echo "Platform: $(shell uname -s)"
@echo "VM Sources: $(VM_SOURCES)"
@echo "Exec Sources: $(EXEC_CPP_SOURCES)"
@echo "Exec Sources: $(CPP_SOURCES)"
@echo "iOS CPP Sources: $(iOS_CPP_SOURCES)"
@echo "iOS MM Sources: $(iOS_MM_SOURCES)"

Expand All @@ -191,7 +162,5 @@ help:
@echo "Configuration variables:"
@echo " BUILD_TYPE=Debug|Release - Set build type (default: Release)"
@echo " USE_DOBBY=0|1 - Enable Dobby hooking (default: 1)"
@echo " ENABLE_AI_FEATURES=0|1 - Enable AI features (default: 1)"
@echo " ENABLE_AI_FEATURES=0|1 - Enable AI features (default: 0)"
@echo " ENABLE_ADVANCED_BYPASS=0|1 - Enable advanced bypass (default: 1)"

.PHONY: all clean install directories info help
4 changes: 4 additions & 0 deletions Makefile.modifications
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Modify to exclude AI features from build
ENABLE_AI_FEATURES := 0

# This will disable include of AI feature files
Loading
Loading