From 07169da20e295525d6aec90040d534575947fc7d Mon Sep 17 00:00:00 2001 From: Nick Chan Date: Sat, 28 Jan 2023 16:24:22 +0800 Subject: [PATCH] speed up build --- .gitignore | 3 ++- src/Makefile | 12 ++++++------ src/common.h | 2 +- src/exec_checkra1n.c | 2 +- src/main.c | 2 +- checkra1n.h => xxd-embedded.h | 4 ++-- 6 files changed, 13 insertions(+), 12 deletions(-) rename checkra1n.h => xxd-embedded.h (87%) diff --git a/.gitignore b/.gitignore index 8f4453d..1b85761 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,8 @@ checkra1n* payload.c src/palera1n palera1n* -!checkra1n.h +!xxd-embedded.h src/binpack.dmg src/ramdisk.dmg +src/xxd-*.c .DS_Store diff --git a/src/Makefile b/src/Makefile index 3748cf8..eac2f9b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,7 +1,10 @@ all: palera1n OBJECTS = main.o dfuhelper.o devhelper.o lockdown_helper.o exec_checkra1n.o -OBJECTS += pongo_usb.o checkra1n.o optparse.o override_file.o pongo_helper.o log.o +OBJECTS += pongo_usb.o optparse.o override_file.o pongo_helper.o log.o +OBJECTS += xxd-checkra1n.o xxd-checkra1n-kpf-pongo.o xxd-ramdisk.dmg.o +OBJECTS += xxd-binpack.dmg.o + CHECKRA1N_VERSION ?= 0.1337.1 LIPO = lipo LDID = ldid @@ -32,11 +35,8 @@ else cp checkra1n-$(CHECKRA1N_NAME) checkra1n endif -checkra1n.c: checkra1n checkra1n-kpf-pongo ramdisk.dmg binpack.dmg - xxd -iC checkra1n > checkra1n.c - xxd -iC checkra1n-kpf-pongo >> checkra1n.c - xxd -iC ramdisk.dmg >> checkra1n.c - xxd -iC binpack.dmg >> checkra1n.c +xxd-%.c: % + xxd -iC $< > $@ %.o: %.c $(CC) -c $(CFLAGS) $< diff --git a/src/common.h b/src/common.h index 6a912a3..224f2c8 100644 --- a/src/common.h +++ b/src/common.h @@ -2,7 +2,7 @@ #define COMMON_H #include "lockdown_helper.h" -#include "checkra1n.h" +#include "xxd-embedded.h" #include "kerninfo.h" #include #include diff --git a/src/exec_checkra1n.c b/src/exec_checkra1n.c index 47f807b..1c43ae7 100644 --- a/src/exec_checkra1n.c +++ b/src/exec_checkra1n.c @@ -18,7 +18,7 @@ extern char **environ; #include "common.h" -#include "checkra1n.h" +#include "xxd-embedded.h" char* pongo_path = NULL; void exec_checkra1n() { diff --git a/src/main.c b/src/main.c index 4ced458..5b95782 100644 --- a/src/main.c +++ b/src/main.c @@ -26,7 +26,7 @@ #include "ANSI-color-codes.h" #include "common.h" -#include "checkra1n.h" +#include "xxd-embedded.h" #include "kerninfo.h" #define CMD_LEN_MAX 512 diff --git a/checkra1n.h b/xxd-embedded.h similarity index 87% rename from checkra1n.h rename to xxd-embedded.h index 22a8122..f976100 100644 --- a/checkra1n.h +++ b/xxd-embedded.h @@ -1,5 +1,5 @@ -#ifndef CHECKRAIN_H -#define CHECKRAIN_H +#ifndef XXD_EMBEDDED_H +#define XXD_EMBEDDED_H extern unsigned char checkra1n[]; extern unsigned int checkra1n_len;