forge/Makefile

67 lines
1.2 KiB
Makefile

VERSION = $(shell git describe --tags)
BUILDTIME = $(shell date +%Y.%m.%d)
all: goimports vet install
forge -h
vet:
@GO111MODULE=off go vet
@echo this go binary package builds okay
verbose:
GO111MODULE=off go build -v -x \
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
install:
GO111MODULE=off go install \
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
goimports:
goimports -w *.go
@# // to globally reset paths:
@# // gofmt -w -r '"go.wit.com/gui/gadgets" -> "go.wit.com/lib/gadgets"' *.go
gocui: install
forge --gui gocui
check-git-clean:
@git diff-index --quiet HEAD -- || (echo "Git repository is dirty, please commit your changes first"; exit 1)
redomod:
rm -f go.*
GO111MODULE= go mod init
GO111MODULE= go mod tidy
redomod-all:
forge --RedoGoMod
redomod-erase:
forge --RedoGoMod --erase
list: install
reset
forge --list
list-private: install
reset
forge --list --private
list-fix: install
reset
forge --list --fix
list-readonly: install
reset
forge --list --readonly
list-config: install
forge --list-conf
scan: install
reset
forge --scan
mine: install
forge --mine