add Makefile with build/install targets
This commit is contained in:
27
Makefile
Normal file
27
Makefile
Normal file
@@ -0,0 +1,27 @@
|
||||
PREFIX ?= /usr/local
|
||||
BINDIR ?= $(PREFIX)/bin
|
||||
BINARY := barnard
|
||||
|
||||
GO ?= go
|
||||
GOFLAGS ?=
|
||||
|
||||
.PHONY: build install uninstall clean fmt vet
|
||||
|
||||
build:
|
||||
$(GO) build $(GOFLAGS) -o $(BINARY) .
|
||||
|
||||
install: build
|
||||
install -d $(DESTDIR)$(BINDIR)
|
||||
install -m 755 $(BINARY) $(DESTDIR)$(BINDIR)/$(BINARY)
|
||||
|
||||
uninstall:
|
||||
rm -f $(DESTDIR)$(BINDIR)/$(BINARY)
|
||||
|
||||
clean:
|
||||
rm -f $(BINARY)
|
||||
|
||||
fmt:
|
||||
$(GO) fmt ./...
|
||||
|
||||
vet:
|
||||
$(GO) vet ./...
|
||||
Reference in New Issue
Block a user