diff --git a/Makefile b/Makefile index 2e2a122..70c2db8 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/script/build b/script/build index 8f0d1ae..5c70383 100755 --- a/script/build +++ b/script/build @@ -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. diff --git a/script/install b/script/install index 1fc0b3b..5237a7d 100755 --- a/script/install +++ b/script/install @@ -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"