-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
33 lines (23 loc) · 789 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
NAME=sms-query
VERSION=$(shell git rev-parse --short HEAD)
default: build-server test
clean:
@git clean -X -f
mod-download:
@go mod download
fmt:
@gofmt -s -l -w .
bindata:
@go install github.com/go-bindata/go-bindata/...
@~/go/bin/go-bindata -o ./pkg/run/bindata.go -pkg run config/i18n/...
@$(MAKE) -s fmt
build-server:
@CGO_ENABLED=0 go build -ldflags "-X main.Version=$(VERSION)" -o $(NAME) ./cmd/$(NAME)/server.go
build-cli:
@CGO_ENABLED=0 go build -ldflags "-X main.Version=$(VERSION)" -o $(NAME)-cli ./cmd/$(NAME)/cli.go
test:
@CGO_ENABLED=0 go test -v -cover ./pkg/...
run-server: build-server
@./$(NAME) -config=config/config.yml -bind=127.0.0.1:8080
run-cli: build-cli
@./$(NAME)-cli -config=config/config.yml -from="$(from)" -query="$(query)" -send=$(send)