Skip to content

Commit

Permalink
build for windows and Linux ( yes it works on Windows ), hope i didn'…
Browse files Browse the repository at this point in the history
…t break macOS
  • Loading branch information
Mineek committed Jul 11, 2023
1 parent e3cf8ee commit 4595a53
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.vscode
include/payloads
openra1n
.DS_Store
.DS_Store
openra1n.exe
15 changes: 11 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
CC = xcrun -sdk macosx gcc
CFLAGS = -I./include -Wall -Wno-pointer-sign
CFLAGS += -Os -arch x86_64 -arch arm64
LDFLAGS = -framework IOKit -framework CoreFoundation
CFLAGS += -Os
BIN = openra1n
SOURCE = openra1n.c lz4/lz4.c lz4/lz4hc.c
ifeq ($(LIBUSB),1)
CC = gcc
CFLAGS += -DHAVE_LIBUSB
LDFLAGS += -lusb-1.0
else
CC = xcrun -sdk macosx gcc
CFLAGS += -arch x86_64 -arch arm64
LDFLAGS += -framework IOKit -framework CoreFoundation
endif

.PHONY: all clean payloads openra1n

Expand All @@ -18,7 +25,7 @@ payloads:

openra1n: payloads
@echo " CC $(BIN)"
@$(CC) $(CFLAGS) $(LDFLAGS) $(SOURCE) -o $(BIN)
@$(CC) $(CFLAGS) $(SOURCE) $(LDFLAGS) -o $(BIN)
strip $(BIN)

clean:
Expand Down
4 changes: 2 additions & 2 deletions openra1n.c
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ static void checkm8_boot_pongo(usb_handle_t *handle) {
if(transfer_ret.sz != size || transfer_ret.ret != USB_TRANSFER_OK)
{
LOG_DEBUG("retrying at len = %zu", len);
usleep(1000);
sleep_ms(100);
goto retry;
}
len += size;
Expand Down Expand Up @@ -1057,7 +1057,7 @@ int main(int argc, char **argv) {
usb_abort_timeout_min = 0;
LOG_INFO("Waiting for DFU mode device");
gaster_checkm8(&handle);
sleep(3);
sleep_ms(3000);
checkm8_boot_pongo(&handle);
return ret;
}

0 comments on commit 4595a53

Please sign in to comment.