Skip to content

Commit 27ea0b6

Browse files
author
Ash Cripps
committed
build: update Makefile to support fat binary
build a binary that is both x86_64 and arm64 on macos
1 parent cda60c5 commit 27ea0b6

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

Makefile

+13-1
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,19 @@ $(PKG): release-only
987987
--tag=$(TAG) \
988988
--release-urlbase=$(RELEASE_URLBASE) \
989989
$(CONFIG_FLAGS) $(BUILD_RELEASE_FLAGS)
990-
$(MAKE) install V=$(V) DESTDIR=$(MACOSOUTDIR)/dist/node
990+
arch -x86_64 $(MAKE) install V=$(V) DESTDIR=$(MACOSOUTDIR)/dist/x64/node
991+
SIGN="$(CODESIGN_CERT)" PKGDIR="$(MACOSOUTDIR)/dist/node/usr/local" sh \
992+
tools/osx-codesign.sh
993+
$(PYTHON) ./configure \
994+
--dest-cpu=arm64 \
995+
--tag=$(TAG) \
996+
--release-urlbase=$(RELEASE_URLBASE) \
997+
$(CONFIG_FLAGS) $(BUILD_RELEASE_FLAGS)
998+
$(MAKE) install V=$(V) DESTDIR=$(MACOSOUTDIR)/dist/arm64/node
999+
lipo $(MACOSOUTDIR)/dist/x64/node \
1000+
$(MACOSOUTDIR)/dist/arm64/node \
1001+
-output $(MACOSOUTDIR)/dist/node \
1002+
-create
9911003
SIGN="$(CODESIGN_CERT)" PKGDIR="$(MACOSOUTDIR)/dist/node/usr/local" sh \
9921004
tools/osx-codesign.sh
9931005
mkdir -p $(MACOSOUTDIR)/dist/npm/usr/local/lib/node_modules

0 commit comments

Comments
 (0)