2023-01-16 16:17:41 +08:00
|
|
|
all: palera1n
|
|
|
|
|
|
2023-01-25 21:22:42 +08:00
|
|
|
OBJECTS = main.o dfuhelper.o devhelper.o lockdown_helper.o exec_checkra1n.o
|
2023-01-29 13:08:48 +08:00
|
|
|
OBJECTS += pongo_usb.o optparse.o override_file.o pongo_helper.o log.o
|
2023-01-28 16:24:22 +08:00
|
|
|
OBJECTS += xxd-checkra1n.o xxd-checkra1n-kpf-pongo.o xxd-ramdisk.dmg.o
|
2023-01-30 21:41:15 +08:00
|
|
|
OBJECTS += xxd-binpack.dmg.o lock_vars.o
|
2023-01-29 13:16:12 +08:00
|
|
|
ifeq ($(DEV_BUILD),1)
|
|
|
|
|
OBJECTS += tui_screen_enter_recovery.o tui_screen_enter_dfu.o tui_main.o
|
|
|
|
|
OBJECTS += tui_screen_jailbreak.o tui_screen_main.o tui_screen_options.o
|
|
|
|
|
endif
|
2023-01-28 16:24:22 +08:00
|
|
|
|
2023-01-21 16:30:22 +08:00
|
|
|
CHECKRA1N_VERSION ?= 0.1337.1
|
2023-01-16 17:53:38 +08:00
|
|
|
LIPO = lipo
|
2023-01-24 15:46:50 +08:00
|
|
|
LDID = ldid
|
2023-01-16 16:17:41 +08:00
|
|
|
|
2023-01-21 16:19:33 +08:00
|
|
|
checkra1n-%:
|
2023-01-21 16:30:22 +08:00
|
|
|
curl -LO https://assets.checkra.in/downloads/preview/$(CHECKRA1N_VERSION)/$@
|
2023-01-21 16:19:33 +08:00
|
|
|
chmod 755 $@
|
|
|
|
|
|
2023-01-24 15:46:50 +08:00
|
|
|
checkra1n: checkra1n-macos usb.xml
|
2023-01-21 18:27:07 +08:00
|
|
|
ifeq ($(TARGET_OS),Darwin)
|
2023-01-16 17:53:38 +08:00
|
|
|
ifneq (,$(findstring arm64, $(CFLAGS)))
|
|
|
|
|
$(LIPO) -thin arm64 -output checkra1n checkra1n-macos
|
2023-01-17 19:26:37 +08:00
|
|
|
else ifneq (,$(findstring x86_64, $(CFLAGS)))
|
2023-01-16 17:53:38 +08:00
|
|
|
$(LIPO) -thin x86_64 -output checkra1n checkra1n-macos
|
2023-01-17 19:26:37 +08:00
|
|
|
else
|
|
|
|
|
$(LIPO) -thin $(shell arch) -output checkra1n checkra1n-macos
|
2023-01-16 17:53:38 +08:00
|
|
|
endif
|
2023-01-24 15:46:50 +08:00
|
|
|
ifeq (,$(findstring macosx, $(CFLAGS)))
|
|
|
|
|
ifneq (,$(findstring version-min=, $(CFLAGS)))
|
2023-01-24 19:22:34 +08:00
|
|
|
vtool -remove-build-version 1 -replace -output checkra1n checkra1n
|
|
|
|
|
vtool -set-build-version $(FAKE_PLATFORM) $(FAKE_MINOS) $(FAKE_SDK) -replace -output checkra1n checkra1n
|
|
|
|
|
install_name_tool -change /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit /System/Library/Frameworks/IOKit.framework/IOKit checkra1n
|
|
|
|
|
install_name_tool -change /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation checkra1n
|
2023-01-24 15:46:50 +08:00
|
|
|
$(LDID) -Susb.xml checkra1n
|
|
|
|
|
endif
|
|
|
|
|
endif
|
2023-01-21 18:27:07 +08:00
|
|
|
else
|
|
|
|
|
cp checkra1n-$(CHECKRA1N_NAME) checkra1n
|
|
|
|
|
endif
|
2023-01-16 16:17:41 +08:00
|
|
|
|
2023-01-28 16:24:22 +08:00
|
|
|
xxd-%.c: %
|
|
|
|
|
xxd -iC $< > $@
|
2023-01-16 17:33:12 +08:00
|
|
|
|
2023-02-05 02:42:12 +08:00
|
|
|
%.o: %.c $(wildcard ../include/*.h)
|
2023-01-16 17:53:38 +08:00
|
|
|
$(CC) -c $(CFLAGS) $<
|
|
|
|
|
|
2023-01-16 16:17:41 +08:00
|
|
|
palera1n: $(OBJECTS)
|
2023-01-21 21:00:41 +08:00
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJECTS) $(LIBS) -o palera1n
|
2023-01-24 15:46:50 +08:00
|
|
|
ifeq (,$(findstring macosx, $(CFLAGS)))
|
|
|
|
|
ifneq (,$(findstring version-min=, $(CFLAGS)))
|
|
|
|
|
$(LDID) -Susb.xml palera1n
|
|
|
|
|
endif
|
|
|
|
|
endif
|
2023-01-16 16:17:41 +08:00
|
|
|
|
2023-01-30 22:33:02 +08:00
|
|
|
checkra1n-kpf-pongo:
|
|
|
|
|
curl -LO https://github.com/guacaplushy/checkp4le/raw/main/binaries/checkra1n-kpf-pongo
|
|
|
|
|
|
|
|
|
|
ramdisk.dmg:
|
|
|
|
|
curl -LO https://cdn.nickchan.lol/palera1n/c-rewrite/deps/ramdisk.dmg
|
|
|
|
|
|
|
|
|
|
binpack.dmg:
|
|
|
|
|
curl -LO https://cdn.nickchan.lol/palera1n/c-rewrite/deps/binpack.dmg
|
|
|
|
|
|
2023-01-16 16:17:41 +08:00
|
|
|
clean:
|
2023-01-18 22:02:25 +08:00
|
|
|
rm -rf *.o palera1n checkra1n checkra1n.c palera1n.dSYM
|
2023-01-16 16:17:41 +08:00
|
|
|
|
2023-01-16 18:06:23 +08:00
|
|
|
.PHONY: all clean
|