-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (55 loc) · 1.61 KB
/
Makefile
File metadata and controls
65 lines (55 loc) · 1.61 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
include variables.mk
include functions.mk
.PHONY: all | env
all: clean build
@echo $(shell date)
.ONESHELL:
SHELL = /bin/bash
.PHONY: env
env:
@echo ---------------------------------------
@echo "MoLing Makefile Environment:"
@echo ---------------------------------------
@echo "SNAPSHOT_VERSION $(SNAPSHOT_VERSION)"
@echo ---------------------------------------
@echo "OS_NAME $(OS_NAME)"
@echo "OS_ARCH $(OS_ARCH)"
@echo "TARGET_OS $(TARGET_OS)"
@echo "TARGET_ARCH $(TARGET_ARCH)"
@echo "GO_VERSION $(GO_VERSION)"
@echo ---------------------------------------
@echo "CMD_GIT $(CMD_GIT)"
@echo "CMD_GO $(CMD_GO)"
@echo "CMD_INSTALL $(CMD_INSTALL)"
@echo "CMD_MD5 $(CMD_MD5)"
@echo ---------------------------------------
@echo "VERSION_NUM $(VERSION_NUM)"
@echo "LAST_GIT_TAG $(LAST_GIT_TAG)"
@echo ---------------------------------------
.PHONY: help
help:
@echo "# environment"
@echo " $$ make env # show makefile environment/variables"
@echo ""
@echo "# build"
@echo " $$ make all # build MoLing"
@echo ""
@echo "# clean"
@echo " $$ make clean # wipe ./bin/"
@echo ""
@echo "# test"
.PHONY: clean build
.PHONY: clean
clean:
$(CMD_RM) -f $(OUT_BIN)*
.PHONY: build
build:clean
$(call gobuild,$(TARGET_OS),$(TARGET_ARCH))
# Format the code
.PHONY: format
format:
@echo " -> Formatting code"
golangci-lint run --disable-all -E errcheck -E staticcheck
.PHONY: test
test:
CGO_ENABLED=1 go test -v -race ./...