-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (36 loc) · 1.14 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
VERSION="`git describe --abbrev=0 --tags`"
COMMIT="`git rev-list -1 --abbrev-commit HEAD`"
all: clean fmt test build
fmt:
@echo "Formatting..."
@goimports -l -w ./
install:
mkdir -p ~/.local/lib/spirit
mkdir -p ~/.local/bin
cp ./bin/spirit ~/.local/bin/spirit && cp ./lib/core.st ~/.local/lib/spirit
clean:
@echo "Cleaning up..."
@rm -rf ./bin
@go mod tidy -v
test: build-only
@echo "Running tests..."
@go test -cover ./...
@bin/spirit -u -p ./lib/core.st lib/core_test.st
test-verbose:
@echo "Running tests..."
@go test -v -cover ./...
benchmark:
@echo "Running benchmarks..."
@go test -benchmem -run="none" -benchmem -bench="Benchmark.*" -v ./...
build-only:
@go build -ldflags="-X main.version=${VERSION} -X main.commit=${COMMIT}" -o ./bin/spirit ./cmd/spirit/
build-small:
@go build -ldflags="-w -X main.version=${VERSION} -X main.commit=${COMMIT}" -o ./bin/spirit ./cmd/spirit/
@upx bin/spirit
build: test
@mkdir -p ./bin
@go build -ldflags="-X main.version=${VERSION} -X main.commit=${COMMIT}" -o ./bin/spirit ./cmd/spirit/
run:
@./bin/spirit -u -p ./lib/core.st ./sample/sample.st
repl:
@rlwrap bin/spirit -u -p ./lib/core.st