blob: 628910f60a0327324fb83d5e7df495065749bb12 (
plain) (
tree)
|
|
# 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
|