-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
44 lines (35 loc) · 834 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
35
36
37
38
39
40
41
42
43
44
go build: rpg
all: clean dependencies build
linux: clean dependencies build-linux
clean:
@echo "Cleanning..."
-rm -f $(BINARY_NAME)
-rm -f $(BINARY_UNIX)
-find . -type d -name -exec rm -rf \{} +
-$(GOCLEAN) -i
@echo "Done cleanning."
dependencies:
@echo "Getting dependencies..."
@echo "Dns Servers : "
@cat /etc/resolv.conf | grep nameserver
$(GOMOD) tidy
$(GOMOD) download
$(GOMOD) vendor
@echo "Done getting dependencies."
rpg:
@echo "Building RPG"
@echo "Building..."
$(GOBUILD) ./...
$(GOBUILD) -o $(BINARY_NAME) -v
build-linux:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(BINARY_UNIX) -v
lint:
@echo "running go-lint ..."
golangci-lint run
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOMOD=GO111MODULE=on $(GOCMD) mod
BINARY_NAME=rpg
BINARY_UNIX=$(BINARY_NAME)
BINARY_linux=