forked from palera1n/loader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (59 loc) · 1.82 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
TARGET_CODESIGN = $(shell which ldid)
GIT_REV=$(shell git rev-parse --short HEAD)
ifeq ($(IOS),1)
PLATFORM = iphoneos
NAME = palera1nLoader
VOLNAME = loader
RELEASE = Release-iphoneos
ARG = ios=1
else ifeq ($(TVOS),1)
PLATFORM = appletvos
NAME = palera1nTVLoader
VOLNAME = tvloader
RELEASE = Release-tvos
ARG = tv=1
else
$(error Please specify either IOS=1 or TVOS=1)
endif
ifeq ($(DEV),1)
CONFIGURATION = Debug
else
CONFIGURATION = Release
endif
P1_TMP = $(TMPDIR)/$(NAME)
P1_STAGE_DIR = $(P1_TMP)/stage
P1_APP_DIR = $(P1_TMP)/Build/Products/$(RELEASE)/$(NAME).app
package:
/usr/libexec/PlistBuddy -c "Set :REVISION ${GIT_REV}" "loader/palera1nLoader/Info.plist"
@set -o pipefail; \
xcodebuild -jobs $(shell sysctl -n hw.ncpu) -project '$(VOLNAME)/palera1nLoader.xcodeproj' -scheme palera1nLoader -configuration $(CONFIGURATION) -arch arm64 -sdk $(PLATFORM) -derivedDataPath $(P1_TMP) \
CODE_SIGNING_ALLOWED=NO DSTROOT=$(P1_TMP)/install ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO
@rm -rf Payload
@rm -rf $(P1_STAGE_DIR)/
@mkdir -p $(P1_STAGE_DIR)/Payload
@mv $(P1_APP_DIR) $(P1_STAGE_DIR)/Payload/$(NAME).app
@echo $(P1_TMP)
@echo $(P1_STAGE_DIR)
@$(TARGET_CODESIGN) -Sentitlements.xml $(P1_STAGE_DIR)/Payload/$(NAME).app/
@rm -rf $(P1_STAGE_DIR)/Payload/$(NAME).app/_CodeSignature
@ln -sf $(P1_STAGE_DIR)/Payload Payload
@rm -rf packages
@mkdir -p packages
ifeq ($(TIPA),1)
@zip -r9 packages/$(NAME).tipa Payload
else
@zip -r9 packages/$(NAME).ipa Payload
endif
ifneq ($(NO_DMG),1)
@hdiutil create out.dmg -volname "$(VOLNAME)" -fs HFS+ -srcfolder Payload
@hdiutil convert out.dmg -format UDZO -imagekey zlib-level=9 -o packages/$(VOLNAME).dmg
@rm -rf out.dmg
endif
@rm -rf Payload
@rm -rf $(P1_TMP)
clean:
@rm -rf $(P1_STAGE_DIR)
@rm -rf packages
@rm -rf out.dmg
@rm -rf Payload
@rm -rf $(P1_TMP)