2023-01-16 16:17:41 +08:00
|
|
|
all: palera1n
|
|
|
|
|
|
2023-02-10 22:34:29 +08:00
|
|
|
OBJECTS = main.o dfuhelper.o devhelper.o lockdown_helper.o
|
2023-02-11 19:23:57 +08:00
|
|
|
OBJECTS += optparse.o override_file.o log.o lock_vars.o credits.o
|
2023-07-16 10:39:42 -04:00
|
|
|
OBJECTS += fake_embedded.o checkm8.o pongo_helper.o
|
2023-03-08 16:49:02 +08:00
|
|
|
OBJECTS += boyermoore_memmem.o
|
2023-02-10 22:34:29 +08:00
|
|
|
|
2023-02-20 20:00:24 +08:00
|
|
|
ifeq (,$(findstring macosx, $(CFLAGS)))
|
|
|
|
|
ifneq (,$(findstring version-min=, $(CFLAGS)))
|
|
|
|
|
OBJECTS += xxd-libcheckra1nhelper.dylib.o
|
|
|
|
|
endif
|
|
|
|
|
endif
|
|
|
|
|
|
2023-02-20 20:40:04 +08:00
|
|
|
ifeq ($(FORCE_HELPER),1)
|
2023-02-20 20:00:24 +08:00
|
|
|
OBJECTS += xxd-libcheckra1nhelper.dylib.o
|
2023-02-20 20:40:04 +08:00
|
|
|
CFLAGS += -DFORCE_HELPER
|
2023-03-29 12:22:58 +08:00
|
|
|
BUILD_OPTIONS += FORCE_HELPER
|
2023-02-20 20:00:24 +08:00
|
|
|
endif
|
2023-02-11 19:23:57 +08:00
|
|
|
|
2023-02-10 22:34:29 +08:00
|
|
|
ifneq ($(NO_RAMDISK),1)
|
|
|
|
|
OBJECTS += xxd-ramdisk.dmg.o
|
|
|
|
|
else
|
|
|
|
|
CFLAGS += -DNO_RAMDISK
|
2023-03-29 12:22:58 +08:00
|
|
|
BUILD_OPTIONS += NO_RAMDISK
|
2023-02-10 22:34:29 +08:00
|
|
|
endif
|
|
|
|
|
ifneq ($(NO_KPF),1)
|
|
|
|
|
OBJECTS += xxd-checkra1n-kpf-pongo.o
|
|
|
|
|
else
|
|
|
|
|
CFLAGS += -DNO_KPF
|
2023-03-29 12:22:58 +08:00
|
|
|
BUILD_OPTIONS += NO_KPF
|
2023-02-10 22:34:29 +08:00
|
|
|
endif
|
2023-03-28 23:17:29 +08:00
|
|
|
ifneq ($(NO_OVERLAY),1)
|
2023-02-10 22:34:29 +08:00
|
|
|
OBJECTS += xxd-binpack.dmg.o
|
|
|
|
|
else
|
2023-03-28 23:17:29 +08:00
|
|
|
CFLAGS += -DNO_OVERLAY
|
2023-03-29 12:22:58 +08:00
|
|
|
BUILD_OPTIONS += NO_OVERLAY
|
2023-02-10 22:34:29 +08:00
|
|
|
endif
|
2023-03-28 12:43:46 +08:00
|
|
|
|
2023-03-29 18:46:01 +08:00
|
|
|
ifeq ($(TUI),1)
|
2023-01-29 13:16:12 +08:00
|
|
|
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
|
2023-03-29 18:46:01 +08:00
|
|
|
BUILD_OPTIONS += TUI
|
|
|
|
|
CFLAGS += -DTUI
|
2023-01-29 13:16:12 +08:00
|
|
|
endif
|
2023-01-28 16:24:22 +08:00
|
|
|
|
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-02-08 16:47:04 +08:00
|
|
|
ifeq ($(TARGET_OS),Darwin)
|
|
|
|
|
ifneq ($(USE_LIBUSB),1)
|
|
|
|
|
OBJECTS += usb_iokit.o
|
2023-02-15 12:50:04 +08:00
|
|
|
else
|
|
|
|
|
LIBS += -framework SystemConfiguration -framework Security
|
2023-03-29 12:22:58 +08:00
|
|
|
BUILD_OPTIONS += USE_LIBUSB
|
2023-02-08 16:47:04 +08:00
|
|
|
endif
|
2023-03-23 23:13:21 +09:00
|
|
|
# add lto and debug symbols for lto
|
|
|
|
|
CFLAGS += -flto=full -g
|
|
|
|
|
LDFLAGS += -Wl,-object_path_lto,lto.o
|
2023-02-08 16:47:04 +08:00
|
|
|
else
|
|
|
|
|
USE_LIBUSB = 1
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
ifeq ($(USE_LIBUSB),1)
|
|
|
|
|
OBJECTS += usb_libusb.o
|
2023-07-16 10:39:42 -04:00
|
|
|
CFLAGS += -DHAVE_LIBUSB -DUSE_LIBUSB=1
|
2023-02-08 16:47:04 +08:00
|
|
|
LIBS += $(DEP)/lib/libusb-1.0.a
|
|
|
|
|
endif
|
|
|
|
|
|
2023-07-02 03:47:00 +08:00
|
|
|
ifeq ($(ROOTFUL),1)
|
2023-03-29 12:22:58 +08:00
|
|
|
CFLAGS += -DROOTFUL=1
|
|
|
|
|
BUILD_OPTIONS += ROOTFUL
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
ifeq ($(BUILD_OPTIONS),)
|
|
|
|
|
BUILD_OPTIONS = (none)
|
|
|
|
|
endif
|
|
|
|
|
|
2023-07-16 10:39:42 -04:00
|
|
|
LIBS += lz4/lz4.c lz4/lz4hc.c
|
2023-07-16 11:56:41 -04:00
|
|
|
CFLAGS += -DBUILD_OPTIONS=\""$(BUILD_OPTIONS)"\" -Wno-pointer-sign -Wno-pointer-arith -Wno-pedantic
|
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-02-20 20:00:24 +08:00
|
|
|
libcheckra1nhelper.dylib: chkstk.S
|
|
|
|
|
$(CC) $(CFLAGS) $(LDFLAGS) -shared chkstk.S -o libcheckra1nhelper.dylib
|
|
|
|
|
|
2023-01-30 22:33:02 +08:00
|
|
|
checkra1n-kpf-pongo:
|
2023-02-12 14:01:40 -05:00
|
|
|
curl -LO https://cdn.nickchan.lol/palera1n/artifacts/kpf/checkra1n-kpf-pongo
|
2023-01-30 22:33:02 +08:00
|
|
|
|
|
|
|
|
ramdisk.dmg:
|
2023-05-17 23:49:23 -05:00
|
|
|
curl -LO https://cdn.nickchan.lol/palera1n/c-rewrite/deps/ramdisk.dmg
|
2023-01-30 22:33:02 +08:00
|
|
|
|
|
|
|
|
binpack.dmg:
|
|
|
|
|
curl -LO https://cdn.nickchan.lol/palera1n/c-rewrite/deps/binpack.dmg
|
|
|
|
|
|
2023-01-16 16:17:41 +08:00
|
|
|
clean:
|
2023-02-20 20:00:24 +08:00
|
|
|
rm -rf *.o palera1n checkra1n checkra1n.c palera1n.dSYM libcheckra1nhelper.dylib
|
2023-01-16 16:17:41 +08:00
|
|
|
|
2023-01-16 18:06:23 +08:00
|
|
|
.PHONY: all clean
|