-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AltServer on Linux and iSH, first working commit
- Loading branch information
Showing
36 changed files
with
5,098 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
*.o | ||
/test | ||
*.a | ||
/AltServer | ||
|
||
.vscode/** | ||
.ccls-cache/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,87 @@ | ||
libimobiledevice_src := $(wildcard libraries/libimobiledevice/src/*.c) $(wildcard libraries/libimobiledevice/common/*.c) | ||
libimobiledevice_src := $(filter-out libraries/libimobiledevice/src/idevice.c, $(libimobiledevice_src)) | ||
PROGRAM := AltServer | ||
|
||
%.c.o : %.c | ||
$(CC) $(CFLAGS) $(EXTRA_FLAGS) -o $@ -c $< | ||
|
||
%.cpp.o : %.cpp | ||
$(CXX) $(CXXFLAGS) $(EXTRA_FLAGS) -o $@ -c $< | ||
|
||
CFLAGS := -DHAVE_CONFIG_H -DDEBUG -O0 -g -mno-default | ||
CXXFLAGS = $(CFLAGS) -std=c++17 | ||
|
||
main_src := $(wildcard src/*.c) $(wildcard src/*.cpp) | ||
|
||
libimobiledevice_src := $(wildcard libraries/libimobiledevice/src/*.c) $(wildcard libraries/libimobiledevice/common/*.c) | ||
ifdef NO_USBMUXD_STUB | ||
CFLAGS += -DNO_USBMUXD_STUB | ||
libimobiledevice_src += $(wildcard libraries/libusbmuxd/src/*.c) | ||
libimobiledevice_src += $(wildcard libraries/libusbmuxd/common/*.c) | ||
else | ||
main_src += src/phone/libusbmuxd-stub.c | ||
ifdef NO_UPNP_STUB | ||
CFLAGS += -DNO_UPNP_STUB | ||
else | ||
libimobiledevice_src := $(filter-out libraries/libimobiledevice/src/idevice.c, $(libimobiledevice_src)) | ||
main_src += src/phone/idevice-stub.c | ||
endif | ||
endif | ||
|
||
libimobiledevice_include := -Ilibraries/libimobiledevice/include -Ilibraries/libimobiledevice -Ilibraries/libusbmuxd/include | ||
|
||
libplist_src := $(wildcard libraries/libplist/src/*.c) libraries/libplist/libcnary/node.c libraries/libplist/libcnary/node_list.c | ||
libplist_include := -Ilibraries/libplist/include | ||
|
||
miniupnpc_src = minissdpc.c miniwget.c minixml.c igd_desc_parse.c minisoap.c \ | ||
miniupnpc.c upnpreplyparse.c upnpcommands.c upnperrors.c \ | ||
connecthostport.c portlistingparse.c receivedata.c upnpdev.c \ | ||
addr_is_reserved.c | ||
miniupnpc.c upnpreplyparse.c upnpcommands.c upnperrors.c \ | ||
connecthostport.c portlistingparse.c receivedata.c upnpdev.c \ | ||
addr_is_reserved.c | ||
miniupnpc_src := $(miniupnpc_src:%.c=libraries/miniupnpc/%.c) | ||
miniupnpc_include := -Ilibraries/miniupnpc | ||
|
||
src := $(wildcard src/*.c) | ||
src += $(libimobiledevice_src) | ||
src += $(wildcard libraries/libplist/src/*.c) libraries/libplist/libcnary/node.c libraries/libplist/libcnary/node_list.c | ||
src += $(miniupnpc_src) | ||
INC_CFLAGS := -Ilibraries | ||
INC_CFLAGS += $(libimobiledevice_include) | ||
INC_CFLAGS += $(libplist_include) | ||
INC_CFLAGS += $(miniupnpc_include) | ||
INC_CFLAGS += -Ilibraries/AltSign | ||
|
||
obj = $(src:.c=.o) | ||
allsrc := $(main_src) | ||
allsrc += $(libimobiledevice_src) | ||
allsrc += $(libplist_src) | ||
allsrc += $(miniupnpc_src) | ||
|
||
CFLAGS := -DHAVE_CONFIG_H -DDEBUG -O0 -g | ||
CFLAGS += -Ilibraries -Ilibraries/libimobiledevice/include -Ilibraries/libimobiledevice | ||
CFLAGS += -Ilibraries/libplist/src -Ilibraries/libplist/include -Ilibraries/libplist/libcnary/include -Ilibraries/libusbmuxd/include | ||
CFLAGS += -Ilibraries/miniupnpc | ||
allobj = $(addsuffix .o, $(allsrc)) | ||
|
||
LDFLAGS = -lm -lcrypto -lpthread -lssl -lzip | ||
$(addsuffix .o, $(libimobiledevice_src)) : EXTRA_FLAGS := -Ilibraries $(libimobiledevice_include) $(libplist_include) -Ilibraries/libimobiledevice/common -Ilibraries/libusbmuxd/common | ||
libraries/libimobiledevice.a : $(addsuffix .o, $(libimobiledevice_src)) | ||
ar rcs $@ $^ | ||
|
||
test: $(obj) | ||
$(addsuffix .o, $(libplist_src)) : EXTRA_FLAGS := -Ilibraries $(libplist_include) -Ilibraries/libplist/libcnary/include -Ilibraries/libplist/src | ||
libraries/libplist.a : $(addsuffix .o, $(libplist_src)) | ||
ar rcs $@ $^ | ||
|
||
# $(miniupnpc_src:.c=.o) : $(miniupnpc_src) | ||
# $(CC) $(CFLAGS) -Ilibraries -c $< | ||
$(addsuffix .o, $(miniupnpc_src)) : EXTRA_FLAGS := -Ilibraries $(miniupnpc_include) | ||
libraries/miniupnp.a : $(addsuffix .o, $(miniupnpc_src)) | ||
ar rcs $@ $^ | ||
|
||
$(addsuffix .o, $(main_src)) : EXTRA_FLAGS := -Ilibraries $(INC_CFLAGS) | ||
|
||
#%.o : %.c | ||
# $(CC) $(CFLAGS) $(INC_CFLAGS) -c $< -o $@ | ||
|
||
lib_AltSign: | ||
$(MAKE) -C libraries/AltSign | ||
|
||
LDFLAGS = libraries/AltSign/AltSign.a -static -lssl -lcrypto -lpthread -lcorecrypto_static -lzip -lm -lz -lcpprest -lboost_system -lboost_filesystem -lstdc++ -lssl -lcrypto -luuid | ||
$(PROGRAM):: lib_AltSign | ||
|
||
$(PROGRAM):: $(addsuffix .o, $(main_src)) libraries/miniupnp.a libraries/libimobiledevice.a libraries/libplist.a | ||
$(CC) -o $@ $^ $(LDFLAGS) | ||
|
||
.PHONY: clean | ||
.PHONY: clean all lib_AltSign | ||
clean: | ||
rm -f $(obj) test | ||
rm -f $(allobj) libraries/*.a $(PROGRAM) | ||
|
||
all: $(PROGRAM) | ||
.DEFAULT_GOAL := all |
Oops, something went wrong.