diff options
author | jloup <jean-loup.jamet@trainline.com> | 2018-02-14 14:19:09 +0100 |
---|---|---|
committer | jloup <jean-loup.jamet@trainline.com> | 2018-02-14 14:19:09 +0100 |
commit | 7a9e5112eaaea58d55f181d3e5296e4ff839921c (patch) | |
tree | 968ed193f42a1fad759cc89ad2f8ad5b0091291e /cmd/app/Makefile | |
download | Front-7a9e5112eaaea58d55f181d3e5296e4ff839921c.tar.gz Front-7a9e5112eaaea58d55f181d3e5296e4ff839921c.tar.zst Front-7a9e5112eaaea58d55f181d3e5296e4ff839921c.zip |
initial commit
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 | ||