summaryrefslogtreecommitdiff
path: root/cgit-clone/Makefile
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-27 14:22:41 -0500
committerJeff Carr <[email protected]>2025-09-27 16:33:47 -0500
commit61b648c04fc3f5afa760b8840583e1335cd76229 (patch)
tree6c47626a7aabf5a6c9cb5cc47714887f69cc7021 /cgit-clone/Makefile
parent7a6a5a2582f2926a1a9f806b113bc4a54d4a34f5 (diff)
Diffstat (limited to 'cgit-clone/Makefile')
-rw-r--r--cgit-clone/Makefile80
1 files changed, 80 insertions, 0 deletions
diff --git a/cgit-clone/Makefile b/cgit-clone/Makefile
new file mode 100644
index 0000000..117e8c4
--- /dev/null
+++ b/cgit-clone/Makefile
@@ -0,0 +1,80 @@
+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-verbose
+ cgit-clone
+
+vet:
+ @GO111MODULE=off go vet
+ @echo this go binary package builds okay
+
+build: goimports vet
+ GO111MODULE=off go build \
+ -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
+
+install: goimports
+ 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-verbose: goimports vet
+ GO111MODULE=off go install -v -x \
+ -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
+
+install-raw: goimports vet
+ go install \
+ -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
+
+GTK: clean install
+ forge --gui andlabs
+
+GTK-verbose: clean install
+ forge --gui andlabs --gui-verbose
+
+CUI: install
+ forge --gui gocui
+
+CUI-verbose: 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 cgit-clone 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_URL="https://forge.grid.wit.com/" forge pull check
+
+# 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"
+
+commit:
+ FORGE_URL="https://forge.grid.wit.com/" forge commit --all
+
+check: install
+ FORGE_URL="https://forge.grid.wit.com/" forge patch check
+
+doc:
+ echo "/*" > doc.go
+ forge -h >> doc.go
+ echo "*/" >> doc.go
+ echo "package main" >> doc.go