diff --git a/Makefile b/Makefile index a9a23f3541..440306ee9f 100644 --- a/Makefile +++ b/Makefile @@ -1,14 +1,16 @@ -SWIFT_BUILD_FLAGS=-Xswiftc "-target" -Xswiftc "x86_64-apple-macosx10.12" +BUILD_FLAGS=-Xswiftc "-target" -Xswiftc "x86_64-apple-macosx10.12" +RELEASE_BUILD_FLAGS=$(BUILD_FLAGS) -c release -Xswiftc -static-stdlib --disable-sandbox +RELEASE_EXECUTABLE=$(shell swift build $(RELEASE_BUILD_FLAGS) --show-bin-path)/periphery .PHONY: all $(MAKECMDGOALS) all: build build: - @swift build $(SWIFT_BUILD_FLAGS) + @swift build $(BUILD_FLAGS) -release: - @swift build -c release -Xswiftc -static-stdlib $(SWIFT_BUILD_FLAGS) +build_release: + @swift build $(RELEASE_BUILD_FLAGS) proj: build @rm -rf Periphery.xcodeproj @@ -20,4 +22,8 @@ lint: @swiftlint lint --quiet test: - @set -o pipefail && swift test $(SWIFT_BUILD_FLAGS) 2>&1 | bundle exec xcpretty -tc + @set -o pipefail && swift test $(BUILD_FLAGS) 2>&1 | bundle exec xcpretty -tc + +install: build_release + install -d "$(PREFIX)/bin/" + install "$(RELEASE_EXECUTABLE)" "$(PREFIX)/bin/" diff --git a/scripts/release b/scripts/release index 7db9683ef6..b8c2da15fd 100755 --- a/scripts/release +++ b/scripts/release @@ -37,7 +37,7 @@ git push origin master git push origin ${version} rm -rf .build/release/periphery -make release +make build_release rm -rf .release mkdir .release cp .build/release/periphery .release/