forge/Makefile

77 lines
2.4 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: verbose install
# forge clean
forge
vet:
@GO111MODULE=off go vet
@echo this go binary package builds okay
verbose: goimports vet plugin
GO111MODULE=off go install -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}"
cp -f ~/go/bin/forge ~/go/bin/last.forge # this is a hack so that go-deb can build a .deb file for forge # TODO: remove this
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: clean install
forge --gui gocui --gui-verbose --gui-file ../../toolkits/andlabs/andlabs.so
gocui: install
forge --gui gocui --gui-verbose --gui-file ../../toolkits/gocui/gocui.so >/tmp/forge.log 2>&1
# forge --gui gocui --gui-verbose --debugger
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
pull: install
# forge pull dirty
# FORGE_URL="https://forge.grid.wit.com/" forge pull dirty
# FORGE_URL="https://forge.grid.wit.com/" forge pull patches
FORGE_URL="https://forge.grid.wit.com/" forge pull check
# forge pull patches
# cloudflare blocks POST due to captcha checks / human detection?
# POST must be direct socket. probably for the best anyway
submit:
FORGE_URL="https://forge.grid.wit.com/" forge patch --submit "forge auto commit"
# forge patch --submit "forge auto commit"
commit:
FORGE_URL="https://forge.grid.wit.com/" forge commit --all