🔨 Install universal binary

This commit is contained in:
Ben Chatelain 2023-11-28 20:25:43 -07:00
parent a14384579e
commit 96ff7ecdae
3 changed files with 15 additions and 4 deletions

View file

@ -81,6 +81,10 @@ updateHeaders: ## Updates private headers.
build: ## Builds the project.
script/build
.PHONY: build-universal
build-universal: ## Builds a "fat" universal binary.
script/build --universal
.PHONY: test
test: build ## Runs tests.
script/test
@ -91,9 +95,13 @@ run: build
${EXECUTABLE_DIRECTORY}/${CMD_NAME} $(ARGS)
.PHONY: install
install: ## Installs the project.
install: build ## Installs the project.
script/install $(PREFIX)
.PHONY: install-universal
install-universal: build-universal ## Installs a universal binary.
script/install --universal
.PHONY: uninstall
uninstall: ## Uninstalls the project.
script/uninstall

View file

@ -9,7 +9,10 @@
# Build for the host architecture by default.
ARCH=()
if [[ "$1" == '--universal' ]]; then
ARCH=(--arch arm64 --arch x86_64)
ARCH=( \
--arch arm64 \
--arch x86_64 \
)
fi
# Disable the manifest cache on Xcode 12.5 and later.

View file

@ -18,7 +18,7 @@ PREFIX=$(brew --prefix)
while test -n "$1"; do
if [[ "$1" == '--universal' ]]; then
ARCH=universal
RELEASE=.build/release
RELEASE=.build/apple/Products/Release
else
# Override default prefix path with optional arg
PREFIX="$1"
@ -30,4 +30,4 @@ done
echo "==> 📲 Installing mas ($MAS_VERSION) for $ARCH to $PREFIX"
ditto -v \
"$RELEASE/mas" \
"$PREFIX/bin/"
"$PREFIX/bin/mas"