-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
70 lines (57 loc) · 1.37 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
ifneq "$(strip $(shell command -v go 2>/dev/null))" ""
GOOS ?= $(shell go env GOOS)
GOARCH ?= $(shell go env GOARCH)
else
ifeq ($(GOOS),)
# approximate GOOS for the platform if we don't have Go and GOOS isn't
# set. We leave GOARCH unset, so that may need to be fixed.
ifeq ($(OS),Windows_NT)
GOOS = windows
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
GOOS = linux
endif
ifeq ($(UNAME_S),Darwin)
GOOS = darwin
endif
ifeq ($(UNAME_S),FreeBSD)
GOOS = freebsd
endif
endif
else
GOOS ?= $$GOOS
GOARCH ?= $$GOARCH
endif
endif
#Replaces ":" (*nix), ";" (windows) with newline for easy parsing
GOPATHS=$(shell echo ${GOPATH} | tr ":" "\n" | tr ";" "\n")
DESTDIR ?= ./deploy
GO_BUILD_FLAGS=
all: clean conf gateway
conf:
@mkdir -p $(DESTDIR)/config
@mkdir -p $(DESTDIR)/bin
@cp config/*.yaml $(DESTDIR)/config
gateway:
@go build ${GO_BUILD_FLAGS} -o $(DESTDIR)/bin/gateway ./server/cmd/gateway
#install: ## install binaries
# @echo "$(WHALE) $@ $(BINARIES)"
# @mkdir -p $(DESTDIR)/bin
# @install $(BINARIES) $(DESTDIR)/bin
#
#uninstall: clean
# @echo "$(WHALE) $@"
# @rm -f $(addprefix $(DESTDIR)/bin/,$(notdir $(BINARIES)))
# Run tests
test: fmt vet
@go test ./... -coverprofile cover.out
# Run go fmt against code
fmt:
@go fmt ./...
# Run go vet against code
vet:
@go vet ./...
clean:
@rm -rf deploy
@rm -rf cover.out