🔨 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. build: ## Builds the project.
script/build script/build
.PHONY: build-universal
build-universal: ## Builds a "fat" universal binary.
script/build --universal
.PHONY: test .PHONY: test
test: build ## Runs tests. test: build ## Runs tests.
script/test script/test
@ -91,9 +95,13 @@ run: build
${EXECUTABLE_DIRECTORY}/${CMD_NAME} $(ARGS) ${EXECUTABLE_DIRECTORY}/${CMD_NAME} $(ARGS)
.PHONY: install .PHONY: install
install: ## Installs the project. install: build ## Installs the project.
script/install $(PREFIX) script/install $(PREFIX)
.PHONY: install-universal
install-universal: build-universal ## Installs a universal binary.
script/install --universal
.PHONY: uninstall .PHONY: uninstall
uninstall: ## Uninstalls the project. uninstall: ## Uninstalls the project.
script/uninstall script/uninstall

View file

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

View file

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