ABRA := ./cmd/abra
COMMIT := $(shell git rev-list -1 HEAD)
GOPATH := $(shell go env GOPATH)
LDFLAGS := "-X 'main.Commit=$(COMMIT)' -X 'main.Version=$(VERSION)'"
VERSION := $(shell cat ./version)
all: run install build clean
run:
go run -ldflags=$(LDFLAGS) $(ABRA)
install:
go install -ldflags=$(LDFLAGS) $(ABRA)
build:
go build -ldflags=$(LDFLAGS) $(ABRA)
clean:
rm '$(GOPATH)/bin/abra'