Skip to content

Commit 17942bc

Browse files
committed
Simplify macOS release builds
1 parent dd7b5c0 commit 17942bc

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

Makefile

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ PREFIX ?= /usr/local
55
VERSION := $(shell if [ -d .git ] && which git 2>&1 > /dev/null; then git describe --always | tail -c +2; else echo $$STANDALONE_VERSION; fi)
66
CFLAGS += -Wall -g -DNMRPFLASH_VERSION=\"$(VERSION)\"
77
SUFFIX ?=
8-
MACOS_SDK ?= macosx15.0
98
NPCAP_SDK = 1.13
109
ARCH := $(shell uname -m)
1110
LINUXDEPLOY = ./linuxdeploy-$(ARCH).AppImage
@@ -43,15 +42,16 @@ else
4342
LDFLAGS += -lpcap
4443
ifeq ($(shell uname -s),Darwin)
4544
AFL=afl-clang
46-
SYSROOT ?= $(shell xcrun --sdk $(MACOS_SDK) --show-sdk-path)
47-
LDFLAGS += -framework CoreFoundation
45+
TARGETS ?= -arch x86_64 -arch arm64
46+
CFLAGS += $(TARGETS)
47+
LDFLAGS += -framework CoreFoundation $(TARGETS)
4848
endif
4949
endif
5050

5151
.PHONY: clean install release release/macos release/linux release/win32
5252

5353
nmrpflash$(SUFFIX): $(nmrpflash_OBJ)
54-
$(CC) $(CFLAGS) -o nmrpflash$(SUFFIX) $(nmrpflash_OBJ) $(LDFLAGS)
54+
$(CC) $(LDFLAGS) $^ -o $@
5555

5656
tftptest:
5757
CFLAGS=-DNMRPFLASH_TFTP_TEST make clean nmrpflash
@@ -93,12 +93,8 @@ nmrpflash-$(ARCH).AppImage: $(LINUXDEPLOY) release
9393
mkdir -p $(APPDIR)
9494
$(LINUXDEPLOY) --appdir $(APPDIR) -e nmrpflash -i nmrpflash.svg -o appimage --create-desktop-file
9595

96-
release/macos:
97-
CFLAGS="-isysroot $(SYSROOT) -target arm64-apple-macos11" SUFFIX=".arm64" make release
98-
CFLAGS="-isysroot $(SYSROOT) -target x86_64-apple-macos10.8" SUFFIX=".x86_64" make release
99-
lipo -create -output nmrpflash nmrpflash.x86_64 nmrpflash.arm64
96+
release/macos: release
10097
zip nmrpflash-$(VERSION)-macos.zip nmrpflash
101-
rm -f nmrpflash.x86_64 nmrpflash.arm64
10298

10399
release/linux: release
104100
zip nmrpflash-$(VERSION)-linux.zip nmrpflash

0 commit comments

Comments
 (0)