-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
31 lines (25 loc) · 857 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
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_NAME=lockout
BINARY_UNIX=$(BINARY_NAME)_unix
all: test build package
test:
$(GOTEST) ./...
build:
env GOOS=linux GARCH=amd64 $(GOBUILD) -o $(BINARY_NAME) -ldflags "-linkmode external -extldflags -static" ./cmd/main.go
buildtiny:
env GOOS=linux GARCH=amd64 $(GOBUILD) -o $(BINARY_NAME) -ldflags "-s -w -installsuffix nocgo -linkmode external -extldflags -static" ./cmd/main.go
upx --lzma lockout
package:
# Gonna copy this cert, cause I can't get the mmdb otherwise...
cp /etc/ssl/certs/ca-certificates.crt .
docker build -t awildtyphlosion/lockout .
# Lets not let it linger.
rm ca-certificates.crt
# Shouldn't need to redo the protofile, but might as well support it.
proto:
protoc -I . --go_out=plugins=grpc:. pb/*.proto