-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (41 loc) · 1.15 KB
/
Makefile
File metadata and controls
50 lines (41 loc) · 1.15 KB
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
PROJECT_DIR = "./"
CLI_DIR = "$(PROJECT_DIR)/cmd/installer"
BIN = "$(PROJECT_DIR)/bin/serverless-installer"
GO ?= go
GOLINT ?= $(GO)lint
RICHGO ?= rich$(GO)
RESET = \033[0m
make_std_color = \033[3$1m # defined for 1 through 7
make_color = \033[38;5;$1m # defined for 1 through 255
BLUE = $(strip $(call make_color,44))
PINK = $(strip $(call make_color,210))
RED = $(strip $(call make_color,206))
GREEN = $(strip $(call make_color,120))
DGREEN = $(strip $(call make_color,106))
GRAY = $(strip $(call make_color,224))
.PHONY: default
default: binary
.PHONY: builddeps
builddeps:
@$(GO) get github.com/kyoh86/richgo
@$(GO) get golang.org/x/lint/golint
.PHONY: clean
clean: builddeps
@echo " $(GRAY)🛁 Cleaning$(RESET)"
@rm -fv $(BIN)
.PHONY: check
check: builddeps
@echo " $(PINK)🛂 Checking$(RESET)"
$(GOLINT) -set_exit_status ./...
.PHONY: test
test: check
@echo " $(GREEN)✔️ Testing$(RESET)"
$(RICHGO) test -cover ./...
.PHONY: binary
binary: test
@echo " $(BLUE)🔨 Building$(RESET)"
$(RICHGO) build -o $(BIN) $(CLI_DIR)
.PHONY: run
run: binary
@echo " $(RED)🏃 Running$(RESET)"
$(BIN) $(args)