forked from PojavLauncherTeam/PojavLauncher_iOS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
425 lines (390 loc) · 18.4 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
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
SHELL := /bin/bash
.SHELLFLAGS = -ec
# Prerequisite variables
SOURCEDIR := $(shell printf "%q\n" "$(shell pwd)")
OUTPUTDIR := $(SOURCEDIR)/artifacts
WORKINGDIR := $(SOURCEDIR)/Natives/build
DETECTPLAT := $(shell uname -s)
DETECTARCH := $(shell uname -m)
VERSION := $(shell cat $(SOURCEDIR)/DEBIAN/control.development | grep Version | cut -b 10-60)
COMMIT := $(shell git log --oneline | sed '2,10000000d' | cut -b 1-7)
IOS15PREF := private/preboot/procursus
# Release vs Debug
RELEASE ?= 0
ifeq (1,$(RELEASE))
CMAKE_BUILD_TYPE := Release
else
CMAKE_BUILD_TYPE := Debug
endif
# Distinguish iOS from macOS, and *OS from others
ifeq ($(DETECTPLAT),Darwin)
ifeq ($(shell sw_vers -productName),macOS)
IOS := 0
SDKPATH ?= $(shell xcrun --sdk iphoneos --show-sdk-path)
BOOTJDK ?= /usr/bin
ifneq (,$(findstring arm,DETECTARCH))
SYSARCH := arm
$(warning Building on an Apple-Silicon Mac.)
else ifneq (,$(findstring 86,$(DETECTARCH)))
SYSARCH := x86_64
$(warning Building on an Intel or AMD-based Mac.)
endif
ifdef DEVICE_IP
DEVICE_PORT ?= 22
endif
else
IOS := 1
SDKPATH ?= /usr/share/SDKs/iPhoneOS.sdk
BOOTJDK ?= /usr/lib/jvm/java-8-openjdk/bin
SYSARCH := arm
DEVICE_IP ?= 127.0.0.1
DEVICE_PORT ?= 22
$(warning Building on a jailbroken iOS device.)
endif
else
$(error This platform is not currently supported for building PojavLauncher.)
endif
# IPABuilder depending variables
ifeq ($(IOS),1)
POJAV_BUNDLE_DIR ?= /Applications/PojavLauncher.app
POJAV_JRE_DIR ?= /usr/lib/jvm/java-8-openjdk
else
POJAV_BUNDLE_DIR ?= $(OUTPUTDIR)/PojavLauncher.app
POJAV_JRE_DIR ?= $(SOURCEDIR)/depends/jre
endif
POJAV_BUNDLE_DYLIBS ?= $(shell cd "$(POJAV_BUNDLE_DIR)/Frameworks" && echo *.dylib)
POJAV_JRE_DYLIBS ?= $(shell cd "$(POJAV_JRE_DIR)" && find . -name "*.dylib")
# Function to use later for checking dependencies
DEPCHECK = $(shell type $(1) >/dev/null 2>&1 && echo 1)
# Function to modify Info.plist files
INFOPLIST = \
if [ '$(4)' = '0' ]; then \
plutil -replace $(1) -string $(2) $(3); \
else \
plutil -value $(2) -key $(1) $(3); \
fi
# Function to use for packaging
PACKAGING = \
mkdir -p $(OUTPUTDIR)/net.kdt.pojavlauncher.$(1)_$(VERSION)_iphoneos-arm; \
cd $(OUTPUTDIR)/net.kdt.pojavlauncher.$(1)_$(VERSION)_iphoneos-arm; \
mkdir -p {DEBIAN,Applications,usr/share/pojavlauncher/{instances/default,Library/{Application\ Support,Caches}}}; \
cd usr/share/pojavlauncher; \
ln -sf ../../instances/default Library/Application\ Support/minecraft; \
cd $(OUTPUTDIR)/net.kdt.pojavlauncher.$(1)_$(VERSION)_iphoneos-arm; \
if [ '$(NOSTDIN)' = '1' ]; then \
echo '$(SUDOPASS)' | sudo -S chown -R 501:501 usr/share/pojavlauncher; \
else \
sudo chown -R 501:501 usr/share/pojavlauncher; \
fi; \
cp -r $(OUTPUTDIR)/PojavLauncher.app Applications/PojavLauncher.app; \
cp $(SOURCEDIR)/DEBIAN/control.$(1) DEBIAN/control; \
cp $(SOURCEDIR)/DEBIAN/postinst DEBIAN/postinst; \
ldid -S$(SOURCEDIR)/entitlements.xml Applications/PojavLauncher.app; \
cd $(OUTPUTDIR); \
fakeroot dpkg-deb -b $(OUTPUTDIR)/net.kdt.pojavlauncher.$(1)_$(VERSION)_iphoneos-arm; \
mkdir -p $(OUTPUTDIR)/net.kdt.pojavlauncher.$(1)-rootless_$(VERSION)_iphoneos-arm64; \
cd $(OUTPUTDIR)/net.kdt.pojavlauncher.$(1)-rootless_$(VERSION)_iphoneos-arm64; \
mkdir -p {DEBIAN,$(IOS15PREF)/{Applications,usr/share/pojavlauncher/{instances/default,Library/{Application\ Support,Caches}}}}; \
cd $(IOS15PREF)/usr/share/pojavlauncher; \
ln -sf ../../instances/default Library/Application\ Support/minecraft; \
cd $(OUTPUTDIR)/net.kdt.pojavlauncher.$(1)-rootless_$(VERSION)_iphoneos-arm64; \
if [ '$(NOSTDIN)' = '1' ]; then \
echo '$(SUDOPASS)' | sudo -S chown -R 501:501 $(IOS15PREF)/usr/share/pojavlauncher; \
else \
sudo chown -R 501:501 $(IOS15PREF)/usr/share/pojavlauncher; \
fi; \
cp -r $(OUTPUTDIR)/PojavLauncher.app $(IOS15PREF)/Applications/PojavLauncher.app; \
cp -r $(SOURCEDIR)/DEBIAN/control.$(1)-rootless DEBIAN/control; \
cp $(SOURCEDIR)/DEBIAN/postinst DEBIAN/postinst; \
ldid -S$(SOURCEDIR)/entitlements.xml $(IOS15PREF)/Applications/PojavLauncher.app; \
cd $(OUTPUTDIR); \
fakeroot dpkg-deb -b $(OUTPUTDIR)/net.kdt.pojavlauncher.$(1)-rootless_$(VERSION)_iphoneos-arm64
# Function to check directories
DIRCHECK = \
if [ ! -d '$(1)' ]; then \
mkdir $(1); \
else \
sudo rm -rf $(1)/*; \
fi
# Function to copy + install
INSTALL = \
echo 'Please note that this may not work properly. If it doesn'\''t work for you, you can manually extract the .deb in /var/tmp/net.kdt.pojavlauncher.$(1)_$(VERSION)_$(2).deb with dpkg or Filza.'; \
if [ '$(4)' = '0' ]; then \
scp -P $(DEVICE_PORT) $(OUTPUTDIR)/net.kdt.pojavlauncher.$(1)_$(VERSION)_$(2).deb root@$(DEVICE_IP):/var/tmp/net.kdt.pojavlauncher.$(1)_$(VERSION)_$(2).deb; \
ssh root@$(DEVICE_IP) -p $(DEVICE_PORT) -t "dpkg -i /var/tmp/net.kdt.pojavlauncher.$(1)_$(VERSION)_$(2).deb; uicache -p $(3)/Applications/PojavLauncher.app"; \
else \
sudo dpkg -i $(OUTPUTDIR)/net.kdt.pojavlauncher.$(1)_$(VERSION)_$(2).deb; uicache -p $(3)/Applications/PojavLauncher.app; \
fi
# Function to copy + deploy
DEPLOY = \
ldid -S$(SOURCEDIR)/entitlements.xml $(WORKINGDIR)/PojavLauncher.app/PojavLauncher; \
if [ '$(2)' = '0' ]; then \
scp -r -P $(DEVICE_PORT) -o "StrictHostKeyChecking no" -o "UserKnownHostsFile=/dev/null" \
$(WORKINGDIR)/libOSMesaOverride.dylib.framework \
$(WORKINGDIR)/libawt_xawt.dylib \
$(WORKINGDIR)/PojavLauncher.app/PojavLauncher \
$(SOURCEDIR)/JavaApp/local_out/launcher.jar \
root@$(DEVICE_IP):/var/tmp/; \
ssh root@$(DEVICE_IP) -p $(DEVICE_PORT) -t " \
mv /var/tmp/libawt_xawt.dylib $(1)/Applications/PojavLauncher.app/Frameworks/libawt_xawt.dylib && \
mv /var/tmp/libOSMesaOverride.dylib.framework $(1)/Applications/PojavLauncher.app/Frameworks/libOSMesaOverride.dylib.framework && \
mv /var/tmp/PojavLauncher $(1)/Applications/PojavLauncher.app/PojavLauncher && \
mv /var/tmp/launcher.jar $(1)/Applications/PojavLauncher.app/libs/launcher.jar && \
cd $(1)/Applications/PojavLauncher.app/Frameworks && \
ln -sf libawt_xawt.dylib libawt_headless.dylib && \
chown -R 501:501 $(1)/Applications/PojavLauncher.app/*"; \
else \
sudo mv $(WORKINGDIR)/libawt_xawt.dylib $(1)/Applications/PojavLauncher.app/Frameworks/libawt_xawt.dylib; \
sudo mv $(WORKINGDIR)/libOSMesaOverride.dylib.framework $(1)/Applications/PojavLauncher.app/Frameworks/libOSMesaOverride.dylib.framework; \
sudo mv $(WORKINGDIR)/PojavLauncher $(1)/Applications/PojavLauncher.app/PojavLauncher; \
sudo mv $(WORKINGDIR)/launcher.jar $(1)/Applications/PojavLauncher.app/libs/launcher.jar; \
cd $(1)/Applications/PojavLauncher.app/Frameworks; \
sudo ln -sf libawt_xawt.dylib libawt_headless.dylib; \
sudo chown -R 501:501 $(1)/Applications/PojavLauncher.app/*; \
fi
# Make sure everything is already available for use. Error if they require something
ifeq ($(call HAS_COMMAND,cmake --version),1)
$(error You need to install cmake)
endif
ifeq ($(call HAS_COMMAND,$(BOOTJDK)/javac -version),1)
$(error You need to install JDK 8)
endif
ifeq ($(IOS),0)
ifeq ($(filter 1.8.0,$(shell $(BOOTJDK)/javac -version &> javaver.txt && cat javaver.txt | cut -b 7-11 && rm -rf javaver.txt)),)
$(error You need to install JDK 8)
endif
endif
ifeq ($(call HAS_COMMAND,ldid),1)
$(error You need to install ldid)
endif
ifeq ($(call HAS_COMMAND,fakeroot -v),1)
$(error You need to install fakeroot)
endif
ifeq ($(call HAS_COMMAND,dpkg-deb --version),1)
$(error You need to install dpkg-dev)
endif
ifeq ($(call HAS_COMMAND,nproc --version),1)
ifeq ($(call HAS_COMMAND,gnproc --version),1)
$(warning Unable to determine number of threads, defaulting to 2.)
JOBS ?= 2
else
JOBS ?= $(shell gnproc)
endif
else
JOBS ?= $(shell nproc)
endif
# Now for the actual Makefile recipes.
# all - runs clean, native, java, extras, and package.
# check - Makes sure that all variables are correct.
# native - Builds the Objective-C code.
# java - Builds the Java code.
# extras - Builds the Assets and Storyboard.
# deb - Builds the Debian package.
# ipa - Builds the application package.
# install - runs deb + installs to jailbroken device.
# deploy - runs native and java + installs to jailbroken device.
all: clean native java extras deb
check:
@printf '\nDumping all Makefile variables.\n'
@printf 'DETECTPLAT - $(DETECTPLAT)\n'
@printf 'DETECTARCH - $(DETECTARCH)\n'
@printf 'SDKPATH - $(SDKPATH)\n'
@printf 'BOOTJDK - $(BOOTJDK)\n'
@printf 'SOURCEDIR - $(SOURCEDIR)\n'
@printf 'WORKINGDIR - $(WORKINGDIR)\n'
@printf 'OUTPUTDIR - $(OUTPUTDIR)\n'
@printf 'JOBS - $(JOBS)\n'
@printf 'VERSION - $(VERSION)\n'
@printf 'COMMIT - $(COMMIT)\n'
@printf 'RELEASE - $(RELEASE)\n'
@printf 'IOS15PREF - $(IOS15PREF)\n'
@printf 'IOS - $(IOS)\n'
@printf 'SYSARCH - $(SYSARCH)\n'
@printf 'POJAV_BUNDLE_DIR - $(POJAV_BUNDLE_DIR)\n'
@printf 'POJAV_JRE_DIR - $(POJAV_JRE_DIR)\n'
@printf 'DEVICE_IP - $(DEVICE_IP)\n'
@printf 'DEVICE_PORT - $(DEVICE_PORT)\n'
@printf '\nVerify that all of the variables are correct.\n'
native:
@echo 'Building PojavLauncher $(VERSION) - NATIVES - Start'
@mkdir -p $(WORKINGDIR)
@cd $(WORKINGDIR) && cmake . \
-DCMAKE_BUILD_TYPE=$(CMAKE_BUILD_TYPE) \
-DCMAKE_CROSSCOMPILING=true \
-DCMAKE_SYSTEM_NAME=Darwin \
-DCMAKE_SYSTEM_PROCESSOR=aarch64 \
-DCMAKE_OSX_SYSROOT="$(SDKPATH)" \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DCMAKE_C_FLAGS="-arch arm64 -miphoneos-version-min=12.0" \
-DCONFIG_COMMIT="$(COMMIT)" \
-DCONFIG_RELEASE=$(RELEASE) \
..
@cmake --build $(WORKINGDIR) --config $(CMAKE_BUILD_TYPE) -j$(JOBS)
@# --target awt_headless awt_xawt libOSMesaOverride.dylib PojavLauncher
@rm $(WORKINGDIR)/libawt_headless.dylib
@echo 'Building PojavLauncher $(VERSION) - NATIVES - End'
java:
@echo 'Building PojavLauncher $(VERSION) - JAVA - Start'
@cd $(SOURCEDIR)/JavaApp; \
mkdir -p local_out/classes; \
$(BOOTJDK)/javac -cp "libs/*:libs_caciocavallo/*" -d local_out/classes $$(find src -type f -name "*.java" -print) -XDignore.symbol.file || exit 1; \
cd local_out/classes; \
$(BOOTJDK)/jar -cf ../launcher.jar * || exit 1
@echo 'Building PojavLauncher $(VERSION) - JAVA - End'
extras:
@echo 'Building PojavLauncher $(VERSION) - EXTRA - Start'
@if [ '$(IOS)' = '0' ]; then \
mkdir -p $(WORKINGDIR)/PojavLauncher.app/Base.lproj; \
xcrun actool $(SOURCEDIR)/Natives/Assets.xcassets --compile $(SOURCEDIR)/Natives/resources --platform iphoneos --minimum-deployment-target 12.0 --app-icon AppIcon --output-partial-info-plist /dev/null || exit 1; \
ibtool --compile $(WORKINGDIR)/PojavLauncher.app/Base.lproj/LaunchScreen.storyboardc $(SOURCEDIR)/Natives/en.lproj/LaunchScreen.storyboard || exit 1; \
elif [ '$(IOS)' = '1' ]; then \
echo 'Due to the required tools not being available, you cannot compile the extras for PojavLauncher with an iOS device.'; \
fi
@echo 'Building PojavLauncher $(VERSION) - EXTRAS - End'
deb: native java extras
@echo 'Building PojavLauncher $(VERSION) - DEB - Start'
@if [ '$(IOS)' = '1' ]; then \
mkdir -p $(WORKINGDIR)/PojavLauncher.app/{Frameworks,Base.lproj}; \
cp -R $(SOURCEDIR)/Natives/en.lproj/*.storyboardc $(WORKINGDIR)/PojavLauncher.app/Base.lproj/ || exit 1; \
cp -R $(SOURCEDIR)/Natives/Info.plist $(WORKINGDIR)/PojavLauncher.app/Info.plist || exit 1;\
cp -R $(SOURCEDIR)/Natives/PkgInfo $(WORKINGDIR)/PojavLauncher.app/PkgInfo || exit 1; \
fi
$(call DIRCHECK,$(WORKINGDIR)/PojavLauncher.app/libs)
$(call DIRCHECK,$(WORKINGDIR)/PojavLauncher.app/libs_caciocavallo)
@cp -R $(SOURCEDIR)/Natives/resources/* $(WORKINGDIR)/PojavLauncher.app/ || exit 1
@cp $(WORKINGDIR)/libawt_xawt.dylib $(WORKINGDIR)/PojavLauncher.app/Frameworks/ || exit 1
@( cd $(WORKINGDIR)/PojavLauncher.app/Frameworks; ln -sf libawt_xawt.dylib libawt_headless.dylib ) || exit 1
@cp -R $(WORKINGDIR)/libOSMesaOverride.dylib.framework $(WORKINGDIR)/PojavLauncher.app/Frameworks/ || exit 1
@cp $(SOURCEDIR)/JavaApp/local_out/launcher.jar $(WORKINGDIR)/PojavLauncher.app/libs/launcher.jar || exit 1
@cp -R $(SOURCEDIR)/JavaApp/libs/* $(WORKINGDIR)/PojavLauncher.app/libs/ || exit 1
@cp -R $(SOURCEDIR)/JavaApp/libs_caciocavallo/* $(WORKINGDIR)/PojavLauncher.app/libs_caciocavallo/ || exit 1
$(call DIRCHECK,$(OUTPUTDIR))
@cp -R $(WORKINGDIR)/PojavLauncher.app $(OUTPUTDIR)
@if [ '$(RELEASE)' = '1' ]; then \
$(call PACKAGING,release); \
else \
$(call PACKAGING,development); \
fi
@echo 'Building PojavLauncher $(VERSION) - DEB - Start'
ipa: native java extras
echo 'Building PojavLauncher $(VERSION) - IPA - Start'
cd $(OUTPUTDIR); \
$(call DIRCHECK,$(OUTPUTDIR)/Payload); \
cp -R $(POJAV_BUNDLE_DIR) $(OUTPUTDIR)/Payload; \
rm -rf $(OUTPUTDIR)/Payload/PojavLauncher.app/Frameworks/*.dylib; \
rm -rf $(OUTPUTDIR)/Payload/PojavLauncher.app/jre; \
cp -R $(POJAV_JRE_DIR) $(OUTPUTDIR)/Payload/PojavLauncher.app/jre; \
rm $(OUTPUTDIR)/Payload/PojavLauncher.app/jre/jre $(OUTPUTDIR)/Payload/PojavLauncher.app/jre/lib/src.zip $(OUTPUTDIR)/Payload/PojavLauncher.app/jre/lib/tools.jar; \
cd $(OUTPUTDIR)/Payload/PojavLauncher.app/jre; \
rm -f lib/libjsig.dylib; \
cd $(OUTPUTDIR); \
$(call DIRCHECK,$(OUTPUTDIR)/IPABuilder); \
mkdir -p $(OUTPUTDIR)/IPABuilder/{OpenJDK/{Frameworks,jre/lib/jli,jre/lib/server},PojavCore/Frameworks}; \
cd $(OUTPUTDIR)/IPABuilder/OpenJDK/Frameworks; \
touch $(OUTPUTDIR)/IPABuilder/int.txt; \
for dylib in $(POJAV_JRE_DYLIBS); do \
dylib_name=$$(basename $$dylib); \
mkdir -p $$dylib_name.framework; \
cd $$dylib_name.framework; \
cp $(SOURCEDIR)/depends/Info.plist Info.plist; \
plist=$$(pwd)/Info.plist; \
$(call INFOPLIST,CFBundleExecutable,$$dylib_name,$$plist,$(IOS)); \
$(call INFOPLIST,CFBundleName,$$dylib_name,$$plist,$(IOS)); \
$(call INFOPLIST,CFBundleIdentifier,"net.kdt.pojavlauncher.$$dylib_name",$$plist,$(IOS)); \
mv $(OUTPUTDIR)/Payload/PojavLauncher.app/jre/$$dylib $$dylib_name; \
RPATH_LIST+="-add_rpath @loader_path/../$$dylib_name.framework "; \
echo "-add_rpath @loader_path/../$$dylib_name.framework " >> $(OUTPUTDIR)/IPABuilder/int.txt; \
cd ..; \
echo "- (JRE) Finished $$dylib_name"; \
done; \
for dylib in $(POJAV_JRE_DYLIBS); do \
dylib_name=$$(basename $$dylib); \
install_name_tool $$(cat $(OUTPUTDIR)/IPABuilder/int.txt | sort | uniq) $$dylib_name.framework/$$dylib_name; \
done; \
mv $(OUTPUTDIR)/IPABuilder/OpenJDK/Frameworks/* $(OUTPUTDIR)/Payload/PojavLauncher.app/Frameworks; \
cd $(OUTPUTDIR)/IPABuilder/PojavCore/Frameworks; \
for dylib in $(POJAV_BUNDLE_DYLIBS); do \
dylib_name=$$(basename $$dylib); \
mkdir -p $$dylib_name.framework; \
cd $$dylib_name.framework; \
plist=$$(pwd)/Info.plist; \
cp $(SOURCEDIR)/depends/Info.plist Info.plist; \
$(call INFOPLIST,CFBundleExecutable,$$dylib_name,$$plist,$(IOS)); \
$(call INFOPLIST,CFBundleName,$$dylib_name,$$plist,$(IOS)); \
$(call INFOPLIST,CFBundleIdentifier,"net.kdt.pojavlauncher.$$dylib_name",$$plist,$(IOS)); \
cp $(POJAV_BUNDLE_DIR)/Frameworks/$$dylib_name $$dylib_name; \
cd ..; \
echo "- (PojavCore) Finished $$dylib_name"; \
done; \
rm -r $(OUTPUTDIR)/IPABuilder/PojavCore/Frameworks/libawt_headless.dylib.framework; \
mv $(OUTPUTDIR)/IPABuilder/PojavCore/Frameworks/* $(OUTPUTDIR)/Payload/PojavLauncher.app/Frameworks; \
ldid -S$(SOURCEDIR)/entitlements.xml $(OUTPUTDIR)/Payload/PojavLauncher.app; \
rm -f $(OUTPUTDIR)/*.ipa; \
cd $(OUTPUTDIR); \
zip --symlinks -r $(OUTPUTDIR)/net.kdt.pojavlauncher-$(VERSION).ipa Payload/*
@echo 'Building PojavLauncher $(VERSION) - IPA - End'
install: deb
@echo 'Building PojavLauncher $(VERSION) - INSTALL - Start'
@if [ '$(DEVICE_IP)' != '' ]; then \
if [ '$(RELEASE)' = '1' ]; then \
if [ '$(ROOTLESS)' = '1' ]; then \
$(call INSTALL,release-rootless,iphoneos-arm64,$(IOS15PREF)); \
else \
$(call INSTALL,release,iphoneos-arm); \
fi; \
else \
if [ '$(ROOTLESS)' = '1' ]; then \
$(call INSTALL,development-rootless,iphoneos-arm64,$(IOS15PREF)); \
else \
$(call INSTALL,development,iphoneos-arm); \
fi; \
fi; \
else \
echo 'You need to run '\''export DEVICE_IP=<your iOS device IP>'\'' to use make install.'; \
echo 'If you specified a different port for your device to listen for SSH connections, you need to run '\''export DEVICE_PORT=<your port>'\'' as well.'; \
fi
@echo 'Building PojavLauncher $(VERSION) - INSTALL - End'
deploy: deb
@echo 'Building PojavLauncher $(VERSION) - DEPLOY - Start'
@if [ '$(DEVICE_IP)' != '' ]; then \
if [ '$(ROOTLESS)' = '1' ]; then \
$(call DEPLOY,$(IOS15PREF),$(IOS)); \
else \
$(call DEPLOY,'/',$(IOS)); \
fi; \
else \
echo 'You need to run '\''export DEVICE_IP=<your iOS device IP>'\'' to use make deploy.'; \
echo 'If you specified a different port for your device to listen for SSH connections, you need to run '\''export DEVICE_PORT=<your port>'\'' as well.'; \
fi;
@echo 'Building PojavLauncher $(VERSION) - DEPLOY - End'
dsym: deb
@echo 'Building PojavLauncher $(VERSION) - DSYM - Start'
@cd $(OUTPUTDIR) && dsymutil --arch arm64 $(OUTPUTDIR)/PojavLauncher.app/PojavLauncher
@cp -r $(OUTPUTDIR)/PojavLauncher.app/PojavLauncher.dSYM $(OUTPUTDIR)/PojavLauncher.dSYM
@echo 'Building PojavLauncher $(VERSION) - DSYM - Start'
clean:
@echo 'Building PojavLauncher $(VERSION) - CLEAN - Start'
@if [ '$(NOSTDIN)' = '1' ]; then \
echo '$(SUDOPASS)' | sudo -S rm -rf $(WORKINGDIR); \
echo '$(SUDOPASS)' | sudo -S rm -rf JavaApp/build; \
echo '$(SUDOPASS)' | sudo -S rm -rf $(OUTPUTDIR); \
else \
sudo rm -rf $(WORKINGDIR); \
sudo rm -rf JavaApp/build; \
sudo rm -rf $(OUTPUTDIR); \
fi
@echo 'Building PojavLauncher $(VERSION) - CLEAN - End'
help:
@echo 'Makefile to compile PojavLauncher'
@echo ''
@echo 'Usage:'
@echo ' make Makes everything under all'
@echo ' make all Builds natives, javaapp, extras, and package'
@echo ' make native Builds the native app'
@echo ' make java Builds the Java app'
@echo ' make deb Builds deb of PojavLauncher'
# @echo ' make ipa Builds ipa of PojavLauncher'
@echo ' make install Copy package to local iDevice'
@echo ' make deploy Copy package to local iDevice'
@echo ' make clean Cleans build directories'
.PHONY: all clean native java extras deb ipa install deploy