aboutsummaryrefslogtreecommitdiff
path: root/cmd/app/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/app/Makefile')
-rw-r--r--cmd/app/Makefile30
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
2GOCMD=go
3GOBUILD=$(GOCMD) build
4GOCLEAN=$(GOCMD) clean
5GOTEST=$(GOCMD) test
6BINARY_NAME=cryptoportfolio-app
7LINUX_ARCHES=amd64 386
8DIST_DIR ?= dist
9
10build:
11 $(GOBUILD) -o $(BINARY_NAME) -v
12
13test:
14 $(GOTEST) -v ./...
15
16clean:
17 $(GOCLEAN)
18 rm -f $(BINARY_NAME)
19 rm -rf dist
20
21run: 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
28release: $(addprefix $(DIST_DIR)/linux_, $(LINUX_ARCHES))
29
30.PHONY: clean release