From 6396388a446e26464b40190361c5ad68d2b8075a Mon Sep 17 00:00:00 2001 From: tihmstar Date: Fri, 16 Sep 2016 01:08:45 +0200 Subject: [PATCH] added Makefile --- Makefile | 58 +++++++++++++++++++++++++++++++++++++++++ external/idevicerestore | 1 + external/img4tool | 1 + external/tsschecker | 1 + futurerestore/config.h | 3 ++- 5 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 Makefile create mode 160000 external/idevicerestore create mode 160000 external/img4tool create mode 160000 external/tsschecker diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..536eee71 --- /dev/null +++ b/Makefile @@ -0,0 +1,58 @@ +TARGET = futurerestore_tool +INSTALLTARGET = futurerestore +CXX = g++ +CC = gcc +INCLUDE += -I futurerestore -I /opt/local/include -I external/idevicerestore/src -I external/tsschecker/tsschecker -I external/img4tool/img4tool +CFLAGS += $(INCLUDE) -Wall -std=c11 -D HAVE_CONFIG_H=1 +CXXFLAGS += $(INCLUDE) -Wall -std=c++11 + +LDFLAGS += -lirecovery -limobiledevice -lcrypto -lcurl -lplist -lc -lc++ -lzip -lpartialzip-1.0 -lz + +OBJECTS += futurerestore.o +SRC_DIR = futurerestore +OBJECTS_COMBINED = $(OBJECTS:%.o=$(SRC_DIR)/%.o) + +DEPOBJECTS_TSSCHECKER += tsschecker.o jsmn.o download.o tss.o +DEPOBJECTS_IMG4TOOL += img4tool.o img4.o +DEPOBJECTS_IDEVICERESTORE += common.o img3.o img4.o download.o asr.o fdr.o fls.o dfu.o ipsw.o limera1n.o locking.o mbn.o normal.o recovery.o restore.o socket.o thread.o + +PATH_TSSCHECKER = external/tsschecker/tsschecker +PATH_IMG4TOOL = external/img4tool/img4tool +PATH_IDEVICERESTORE = external/idevicerestore/src + +DEPOBJECTS_TSSCHECKER_COMBINED = $(DEPOBJECTS_TSSCHECKER:%.o=$(PATH_TSSCHECKER)/%.o) +DEPOBJECTS_IMG4TOOL_COMBINED = $(DEPOBJECTS_IMG4TOOL:%.o=$(PATH_IMG4TOOL)/%.o) +DEPOBJECTS_IDEVICERESTORE_COMBINED = $(DEPOBJECTS_IDEVICERESTORE:%.o=$(PATH_IDEVICERESTORE)/%.o) + + +all : $(TARGET) + + +ALLDEPS = $(DEPOBJECTS_TSSCHECKER_COMBINED) $(DEPOBJECTS_IMG4TOOL_COMBINED) $(DEPOBJECTS_IDEVICERESTORE_COMBINED) $(PATH_IDEVICERESTORE)/idevicerestore.o $(OBJECTS_COMBINED) +$(TARGET) : $(ALLDEPS) + $(CXX) $(CXXFLAGS) $(LDFLAGS) $(ALLDEPS) $(SRC_DIR)/main.cpp -o $(TARGET) + @echo "Successfully built $(TARGET)" + +$(OBJECTS_COMBINED) : $(OBJECTS_COMBINED:%.o=%.cpp) + $(CXX) $(CXXFLAGS) $< -c -o $@ + +$(DEPOBJECTS_TSSCHECKER_COMBINED) : + CFLAGS='-D HAVE_CONFIG_H=1 -I ../../futurerestore' make -C external/tsschecker $(DEPOBJECTS_TSSCHECKER:%.o=tsschecker/%.o) + +$(DEPOBJECTS_IDEVICERESTORE_COMBINED) : $(DEPOBJECTS_IDEVICERESTORE_COMBINED:%.o=%.c) + $(CC) $(CFLAGS) $(@:%.o=%.c) -c -o $@ + +$(PATH_IDEVICERESTORE)/idevicerestore.o : $(PATH_IDEVICERESTORE)/idevicerestore.c + $(CC) $(CFLAGS) -c $(PATH_IDEVICERESTORE)/idevicerestore.c -o $(PATH_IDEVICERESTORE)/idevicerestore.o + +$(PATH_IMG4TOOL)/img4tool.o : + CFLAGS='-D HAVE_CONFIG_H=1 -I ../../futurerestore' make -C external/img4tool objects + +install : + cp $(TARGET) /usr/local/bin/$(INSTALLTARGET) + @echo "Installed $(INSTALLTARGET)" +clean : + make -C external/tsschecker clean + make -C external/img4tool clean + rm -rf external/idevicerestore/src/*.o + rm -rf futurerestore/*.o $(TARGET) diff --git a/external/idevicerestore b/external/idevicerestore new file mode 160000 index 00000000..9a05d20f --- /dev/null +++ b/external/idevicerestore @@ -0,0 +1 @@ +Subproject commit 9a05d20f67afedf0ee5e09283a5646e60e5b85a1 diff --git a/external/img4tool b/external/img4tool new file mode 160000 index 00000000..2e041953 --- /dev/null +++ b/external/img4tool @@ -0,0 +1 @@ +Subproject commit 2e0419536713d64eeb24c78e47282a178037b908 diff --git a/external/tsschecker b/external/tsschecker new file mode 160000 index 00000000..56c21604 --- /dev/null +++ b/external/tsschecker @@ -0,0 +1 @@ +Subproject commit 56c21604300b795f1c5084e8b27f6a83a528258d diff --git a/futurerestore/config.h b/futurerestore/config.h index 35ee0b4d..d640b3e6 100644 --- a/futurerestore/config.h +++ b/futurerestore/config.h @@ -10,7 +10,8 @@ #define config_h #define IMG4TOOL_NOMAIN - +#define NO_DEBUG_PLIST +#define NO_GENERATE_GUID //idevicerestore config #define IDEVICERESTORE_NOMAIN