-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathMakefile
More file actions
129 lines (116 loc) · 4.96 KB
/
Copy pathMakefile
File metadata and controls
129 lines (116 loc) · 4.96 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
ARCHS := arm64
TARGET := iphone:clang:latest:15.0
FINALPACKAGE = 1
GO_EASY_ON_ME := 1
PACKAGE_FORMAT ?= ipa
STRIP = 0
# Signing happens after framework embedding and, for Mac tests, after vtool.
TARGET_CODESIGN =
include module-cache.mk
include version.mk
include $(THEOS)/makefiles/common.mk
# The rootless package transform happens inside Theos' deb recipe, after the
# normal before-package hooks. Package a private clean copy at that final
# boundary so Finder cannot recreate .DS_Store files in the visible staging
# directory while dm.pl is enumerating it.
ifeq ($(_THEOS_PACKAGE_FORMAT),deb)
_THEOS_PLATFORM_DPKG_DEB := $(CURDIR)/Scripts/dm-clean.sh
endif
APPLICATION_NAME = LiveExec32
LiveExec32_FILES = App/main.c
ifeq ($(_THEOS_PACKAGE_FORMAT),deb)
LiveExec32_CFLAGS = -DLC32_JAILBREAK_PACKAGE=1
endif
# LoadFrameworkFromSearchPaths appends <name>.framework/<name> to these
# framework roots. LoadFramework falls back to the libroot-resolved path for
# jailbreak prefixes other than the common /var/jb layout.
LiveExec32_LDFLAGS = \
-Wl,-rpath,@executable_path/Frameworks \
-Wl,-rpath,@loader_path/Frameworks \
-Wl,-rpath,@loader_path/.jbroot/Applications/LiveExec32.app/Frameworks \
-Wl,-rpath,/var/jb/Applications/LiveExec32.app/Frameworks \
-Wl,-rpath,/var/jb/usr/lib
LiveExec32_RESOURCE_DIRS = Resources
SHARED_FRAMEWORK_BUILD := \
$(CURDIR)/HostFrameworks/LC32/.theos/obj/LiveExec32Shared.framework
HELP_FRAMEWORK_BUILD := \
$(CURDIR)/HostFrameworks/LC32HelpUI/.theos/obj/LC32HelpUI.framework
# Keep the embedded-only frameworks in independent Theos projects. If they
# were FRAMEWORK_NAME instances here, `make package` would copy them into the
# developer's global $(THEOS_LIBRARY_PATH), even with INSTALL=0.
before-LiveExec32-all::
$(MAKE) -C HostFrameworks/LC32 all \
THEOS_PROJECT_DIR="$(CURDIR)/HostFrameworks/LC32" \
THEOS_CURRENT_INSTANCE= _THEOS_CURRENT_TYPE= \
_THEOS_CURRENT_OPERATION= THEOS_CURRENT_ARCH=
$(MAKE) -C HostFrameworks/LC32HelpUI all \
THEOS_PROJECT_DIR="$(CURDIR)/HostFrameworks/LC32HelpUI" \
THEOS_CURRENT_INSTANCE= _THEOS_CURRENT_TYPE= \
_THEOS_CURRENT_OPERATION= THEOS_CURRENT_ARCH=
# The executable discovers these bundles dynamically, so HelpUI launches do
# not initialize Dynarmic or install the runtime's process-wide hooks. vtool
# only touches aggregate copies; restoring the launcher from its architecture
# product also makes Catalyst -> iOS mode switches incremental.
after-LiveExec32-all::
$(call lc32_stamp_version,$(THEOS_OBJ_DIR)/LiveExec32.app/Info.plist)
@set -e; \
frameworks="$(THEOS_OBJ_DIR)/LiveExec32.app/Frameworks"; \
mkdir -p "$$frameworks/LiveExec32Shared.framework" \
"$$frameworks/LC32HelpUI.framework"; \
rsync -a --delete "$(SHARED_FRAMEWORK_BUILD)/" \
"$$frameworks/LiveExec32Shared.framework/"; \
rsync -a --delete "$(HELP_FRAMEWORK_BUILD)/" \
"$$frameworks/LC32HelpUI.framework/"; \
cp -a "$(THEOS_OBJ_DIR)/$(firstword $(ARCHS))/LiveExec32.app/LiveExec32" \
"$(THEOS_OBJ_DIR)/LiveExec32.app/LiveExec32"; \
rm -f "$$frameworks/libdynarmic.dylib"
ifeq ($(LC32_BUILD_CATALYST),1)
@set -e; \
frameworks="$(THEOS_OBJ_DIR)/LiveExec32.app/Frameworks"; \
for binary in \
"$(THEOS_OBJ_DIR)/LiveExec32.app/LiveExec32" \
"$$frameworks/LiveExec32Shared.framework/LiveExec32Shared" \
"$$frameworks/LC32HelpUI.framework/LC32HelpUI"; do \
output="$$binary.lc32-vtool"; \
rm -f "$$output"; \
vtool -arch arm64 -set-build-version 6 11.0 11.0 \
-replace -output "$$output" "$$binary"; \
mv "$$output" "$$binary"; \
done
endif
@set -e; \
frameworks="$(THEOS_OBJ_DIR)/LiveExec32.app/Frameworks"; \
ldid -S "$$frameworks/LiveExec32Shared.framework"; \
ldid -S "$$frameworks/LC32HelpUI.framework"; \
if [ "$(LC32_BUILD_CATALYST)" = 1 ]; then \
ldid -S "$(THEOS_OBJ_DIR)/LiveExec32.app"; \
else \
ldid -Sentitlements.plist \
"$(THEOS_OBJ_DIR)/LiveExec32.app"; \
fi
internal-clean::
$(MAKE) -C HostFrameworks/LC32 clean \
THEOS_PROJECT_DIR="$(CURDIR)/HostFrameworks/LC32" \
THEOS_CURRENT_INSTANCE= _THEOS_CURRENT_TYPE= \
_THEOS_CURRENT_OPERATION= THEOS_CURRENT_ARCH=
$(MAKE) -C HostFrameworks/LC32HelpUI clean \
THEOS_PROJECT_DIR="$(CURDIR)/HostFrameworks/LC32HelpUI" \
THEOS_CURRENT_INSTANCE= _THEOS_CURRENT_TYPE= \
_THEOS_CURRENT_OPERATION= THEOS_CURRENT_ARCH=
include $(THEOS_MAKE_PATH)/application.mk
# Theos updates an existing IPA with `zip -u`, which retains entries removed
# from the staging tree. Recreate the archive so dependency transitions cannot
# leave obsolete binaries (such as the former libdynarmic.dylib) packaged.
ifeq ($(_THEOS_PACKAGE_FORMAT),ipa)
before-package::
@rm -f "$(_THEOS_IPA_PACKAGE_FILENAME)"
endif
# Finder can recreate these inside Theos' staging tree between clean/stage and
# package; never ship host metadata in either archive format.
before-package::
@find "$(THEOS_STAGING_DIR)" -type f -name .DS_Store -delete
# The injector is shipped only in jailbreak packages, never in the IPA.
ifeq ($(_THEOS_PACKAGE_FORMAT),deb)
SUBPROJECTS += Tweak
endif
include $(THEOS_MAKE_PATH)/aggregate.mk