-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
34 lines (27 loc) · 919 Bytes
/
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
GO := go
NAME := scv
VERSION := 1.0.0
DIST := $(NAME)-$(VERSION)
all: test build
setup:
git submodule update --init
test: setup
$(GO) test -covermode=count -coverprofile=coverage.out $$(go list ./...)
define __create_dist
mkdir -p dist/$(1)_$(2)/$(DIST)
rm -rf dist/$(1)_$(2)/$(DIST)/docs
GOOS=$1 GOARCH=$2 go build -o dist/$(1)_$(2)/$(DIST)/$(NAME)$(3) main.go args.go printer.go input.go
cp -r README.md LICENSE completions dist/$(1)_$(2)/$(DIST)
cp -r docs/public dist/$(1)_$(2)/$(DIST)/docs
tar cfz dist/$(DIST)_$(1)_$(2).tar.gz -C dist/$(1)_$(2) $(DIST)
echo "Done $(1)_$(2)"
endef
dist: all
@$(call __create_dist,darwin,amd64,)
@$(call __create_dist,darwin,arm64,)
@$(call __create_dist,windows,amd64,.exe)
@$(call __create_dist,linux,amd64,)
build: main.go args.go printer.go input.go vector
go build -o $(NAME) -v main.go args.go printer.go input.go
clean:
@rm -f scv *~