forge/Makefile

58 lines
1.5 KiB
Makefile

VERSION = $(shell git describe --tags)
BUILDTIME = $(shell date +%Y.%m.%d_%H%M)
# make build # go build using your git cloned repos (GO111MODULE=off)
# make install # go install using your git cloned repos (GO111MODULE=off)
# make gocui # try the ncurses gui plugin
# make andlabs # try the andlabs gui plugin (uses GTK)
default: install
forge dirty --verbose
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}"
build: goimports vet plugin
GO111MODULE=off go build \
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
install: goimports vet plugin
GO111MODULE=off go install \
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
install-raw: goimports vet plugin
go install \
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
plugin:
rm -f resources/*.so
cp ../../toolkits/gocui/gocui.so resources/
andlabs: install
forge --gui andlabs
gocui: install
forge --gui gocui --gui-verbose >/tmp/forge.log 2>&1
goimports:
reset
goimports -w *.go
@# // to globally reset paths:
@# // gofmt -w -r '"go.wit.com/gui/gadgets" -> "go.wit.com/lib/gadgets"' *.go
clean:
-rm -f forge go.*
# -rm -f ~/go/src/repos.pb
go-mod-clean --purge
identify-protobuf:
autogenpb --identify ~/go/src/repos.pb
devel:
forge clean devel --force --verbose