blob: 628910f60a0327324fb83d5e7df495065749bb12 (
plain) (
blame)
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
|
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
BINARY_NAME=cryptoportfolio-app
LINUX_ARCHES=amd64 386
DIST_DIR ?= dist
build:
$(GOBUILD) -o $(BINARY_NAME) -v
test:
$(GOTEST) -v ./...
clean:
$(GOCLEAN)
rm -f $(BINARY_NAME)
rm -rf dist
run: build
./$(BINARY_NAME)
$(addprefix $(DIST_DIR)/linux_, $(LINUX_ARCHES)):
mkdir -p $(@)
CGO_ENABLED=0 GOOS=linux GOARCH=$(subst linux_,,$(notdir $@)) $(GOBUILD) -o $@/$(BINARY_NAME) -v
release: $(addprefix $(DIST_DIR)/linux_, $(LINUX_ARCHES))
.PHONY: clean release
|