add Makefile

This commit is contained in:
Andrea Franz 2019-03-18 19:49:59 +01:00
parent 5ba1397f33
commit 7081eccf5c
No known key found for this signature in database
GPG Key ID: 4F0D2F2D9DE7F29D

21
Makefile Normal file
View File

@ -0,0 +1,21 @@
.PHONY: test build
GOBIN = $(dir $(realpath $(firstword $(MAKEFILE_LIST))))build/bin
PROJECT_NAME=keycard-cli
GO_PROJECT_PATH=github.com/status-im/$(PROJECT_NAME)
BIN_NAME=keycard
DOCKER_IMAGE_NAME=keycard
build:
go build -i -o $(GOBIN)/$(BIN_NAME) -v .
@echo "Compilation done."
@echo "Run \"./build/bin/$(BIN_NAME) -h\" to view available commands."
test:
go test -v ./...
build-docker-image:
docker build -t $(DOCKER_IMAGE_NAME) -f _assets/Dockerfile .
build-platforms:
xgo -image $(DOCKER_IMAGE_NAME) --dest $(GOBIN) --targets=linux/amd64,windows/amd64 ./cmd/$(BIN_NAME)