This repository has been archived by the owner on Jul 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨Makefile and setting version by tag (#11)
* ignoring binary * makefile to aid in install/uninstall, and to set the version in cli.go at build time * install instructions using make * oopsed the destination directory in the Makefile
- Loading branch information
Showing
4 changed files
with
85 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ | |
*.dll | ||
*.so | ||
*.dylib | ||
pwcli | ||
|
||
# Test binary, built with `go test -c` | ||
*.test | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
PREFIX?=/usr/local | ||
BINDIR?=$(PREFIX)/bin | ||
VERSION?=$(shell git tag | grep ^v | sort -V | tail -n 1) | ||
GOFLAGS?=-ldflags '-X main.VERSION=${VERSION}' | ||
|
||
pwcli: cli.go go.mod go.sum | ||
@echo | ||
@echo Building pwcli. This may take a minute or two. | ||
@echo | ||
go build $(GOFLAGS) -o $@ | ||
@echo | ||
@echo ...Done\! | ||
|
||
.PHONY: clean | ||
clean: | ||
@echo | ||
@echo Cleaning... | ||
@echo | ||
go clean | ||
@echo | ||
@echo ...Done\! | ||
|
||
.PHONY: update | ||
update: | ||
@echo | ||
@echo Updating from upstream repository... | ||
@echo | ||
git pull --rebase origin master | ||
@echo | ||
@echo ...Done\! | ||
|
||
.PHONY: install | ||
install: | ||
@echo | ||
@echo Installing pwcli... | ||
@echo | ||
install -m755 pwcli $(BINDIR) | ||
@echo | ||
@echo ...Done\! | ||
|
||
.PHONY: uninstall | ||
uninstall: | ||
@echo | ||
@echo Uninstalling pwcli... | ||
@echo | ||
rm -f $(BINDIR)/pwcli | ||
@echo | ||
@echo ...Done\! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters