Skip to content

Commit

Permalink
Extend Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
aligator committed May 7, 2021
1 parent bb1e215 commit b9afb8b
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
VERSION := $(shell git describe --tags)
BUILD := $(shell git rev-parse --short HEAD)
VERSION ?= $(shell git describe --tags)
BUILD ?= $(shell git rev-parse --short HEAD)
PROJECTNAME := goslice
TARGET := .target
GOFILES := ./cmd/goslice
PREFIX := /usr/local
DESTDIR :=
BIN := goslice

# Use linker flags to provide version/build settings
LDFLAGS=-ldflags "-X=main.Version=$(VERSION) -X=main.Build=$(BUILD)"
Expand All @@ -27,4 +30,12 @@ clean:
test:
@go test ./...

.PHONY: install
install: build
install -Dm755 $(TARGET)/$(BIN) $(DESTDIR)$(PREFIX)/bin/${BIN}

.PHONY: uninstall
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/${BIN}

all: build

0 comments on commit b9afb8b

Please sign in to comment.