Skip to content

Commit e421d35

Browse files
committed
updating makefile
1 parent 4e4bd06 commit e421d35

File tree

1 file changed

+21
-4
lines changed

1 file changed

+21
-4
lines changed

Makefile

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,31 @@
1+
TOOL_NAME = stringray
2+
VERSION = 0.1.0
3+
4+
REPO = https://github.com/g-Off/$(TOOL_NAME)
5+
RELEASE_TAR = $(REPO)/archive/$(VERSION).tar.gz
6+
SHA = $(shell curl -L -s $(RELEASE_TAR) | shasum -a 256 | sed 's/ .*//')
7+
8+
PREFIX = /usr/local
9+
INSTALL_PATH = $(PREFIX)/bin/$(TOOL_NAME)
10+
BUILD_PATH = $(shell swift build --show-bin-path -c $(CONFIGURATION))/$(TOOL_NAME)
11+
112
SWIFTC_FLAGS = -Xswiftc "-target" -Xswiftc "x86_64-apple-macosx10.13"
13+
214
CONFIGURATION = debug
315

416
debug: build
517

6-
release: CONFIGURATION = release
7-
release: SWIFTC_FLAGS += --static-swift-stdlib
8-
release: clean build
18+
release:
19+
@echo $(SHA)
920

1021
build:
1122
swift build --configuration $(CONFIGURATION) $(SWIFTC_FLAGS)
23+
24+
install: CONFIGURATION = release
25+
install: SWIFTC_FLAGS += --static-swift-stdlib --disable-sandbox
26+
install: clean build
27+
mkdir -p $(PREFIX)/bin
28+
cp -f $(BUILD_PATH) $(INSTALL_PATH)
1229

1330
test:
1431
swift test $(SWIFTC_FLAGS)
@@ -19,4 +36,4 @@ xcode:
1936
clean:
2037
swift package clean
2138

22-
.PHONY: debug release build test xcode clean
39+
.PHONY: debug release build test xcode clean install

0 commit comments

Comments
 (0)