-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (31 loc) · 844 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
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOCOVER=$(GOCMD) tool cover
GOGET=$(GOCMD) get
GOFMT=gofmt
BINARY_NAME=dyndns-pdns
GOFILES=$(shell find . -type f -name '*.go' -not -path "./vendor/*")
.DEFAULT_GOAL := all
.PHONY: all build build-linux-amd64 test coverage check-fmt fmt clean run
all: check-fmt test coverage build
build:
$(GOBUILD) -o $(BINARY_NAME) -v ./cmd/dyndns-pdns
build-linux-amd64:
GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(BINARY_NAME)_linux_amd64 -v ./cmd/dyndns-pdns
test:
$(GOTEST) -v ./... -covermode=count -coverprofile=coverage.out
coverage:
$(GOCOVER) -func=coverage.out
check-fmt:
$(GOFMT) -d ${GOFILES}
fmt:
$(GOFMT) -w ${GOFILES}
clean:
$(GOCLEAN)
rm -f $(BINARY_NAME)
rm -f $(BINARY_NAME)_linux_amd64
run:
$(GOBUILD) -o $(BINARY_NAME) -v ./...
./$(BINARY_NAME)