From 04924b78c30dec85e6981abf2fd63044f9075588 Mon Sep 17 00:00:00 2001 From: christian-glattfelder-at-ethz Date: Wed, 3 Dec 2025 10:18:43 +0100 Subject: [PATCH] Update Makefile to build x86,arm and universal binary Thanks for a very useful utility. Since rosetta is going to be deprecated eventually, and the utility works great when compiled as arm, i propose extending the makefile to prepare for that - by building platform binaries, and then joining them into a universal binary. --- Makefile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 3cb17c9..8de3975 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,15 @@ TARGET = devreset -all: $(TARGET) +all: universal -$(TARGET): devreset.c - gcc devreset.c -framework IOKit -framework CoreFoundation -o devreset +$(TARGET)_x86: $(TARGET).c + gcc $(TARGET).c -framework IOKit -framework CoreFoundation -o $(TARGET)_x86 -target x86_64-apple-macos10.12 + +$(TARGET)_arm: $(TARGET).c + gcc $(TARGET).c -framework IOKit -framework CoreFoundation -o $(TARGET)_arm -target arm64-apple-macos11 + +universal: $(TARGET)_x86 $(TARGET)_arm + lipo -create -output $(TARGET) $(TARGET)_x86 $(TARGET)_arm clean: - $(RM) $(TARGET) \ No newline at end of file + $(RM) $(TARGET) $(TARGET)_x86 $(TARGET)_arm