diff options
Diffstat (limited to 'cmd/app/Makefile')
-rw-r--r-- | cmd/app/Makefile | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/cmd/app/Makefile b/cmd/app/Makefile new file mode 100644 index 0000000..628910f --- /dev/null +++ b/cmd/app/Makefile | |||
@@ -0,0 +1,30 @@ | |||
1 | # Go parameters | ||
2 | GOCMD=go | ||
3 | GOBUILD=$(GOCMD) build | ||
4 | GOCLEAN=$(GOCMD) clean | ||
5 | GOTEST=$(GOCMD) test | ||
6 | BINARY_NAME=cryptoportfolio-app | ||
7 | LINUX_ARCHES=amd64 386 | ||
8 | DIST_DIR ?= dist | ||
9 | |||
10 | build: | ||
11 | $(GOBUILD) -o $(BINARY_NAME) -v | ||
12 | |||
13 | test: | ||
14 | $(GOTEST) -v ./... | ||
15 | |||
16 | clean: | ||
17 | $(GOCLEAN) | ||
18 | rm -f $(BINARY_NAME) | ||
19 | rm -rf dist | ||
20 | |||
21 | run: build | ||
22 | ./$(BINARY_NAME) | ||
23 | |||
24 | $(addprefix $(DIST_DIR)/linux_, $(LINUX_ARCHES)): | ||
25 | mkdir -p $(@) | ||
26 | CGO_ENABLED=0 GOOS=linux GOARCH=$(subst linux_,,$(notdir $@)) $(GOBUILD) -o $@/$(BINARY_NAME) -v | ||
27 | |||
28 | release: $(addprefix $(DIST_DIR)/linux_, $(LINUX_ARCHES)) | ||
29 | |||
30 | .PHONY: clean release | ||