2021-11-02 23:44:28 -05:00
|
|
|
GITCOMMIT = $(shell git rev-list -1 HEAD)
|
|
|
|
GOVERSION = $(shell go version | cut -d' ' -f 3)
|
|
|
|
BUILDTIME = $(shell date -u --iso-8601=seconds)
|
|
|
|
VERSION = $(shell cat resources/VERSION)
|
|
|
|
|
|
|
|
# PATH=/usr/bin:$PATH go version
|
|
|
|
|
2024-01-05 12:13:21 -06:00
|
|
|
run: build
|
|
|
|
./wit-debian-gui
|
2021-11-02 23:44:28 -05:00
|
|
|
|
2024-01-24 18:24:38 -06:00
|
|
|
redomod:
|
|
|
|
rm -f go.*
|
|
|
|
go mod init
|
|
|
|
go mod tidy
|
|
|
|
|
2021-11-03 02:51:41 -05:00
|
|
|
new-build:
|
2024-01-05 09:58:05 -06:00
|
|
|
# go mod edit -replace go.wit.com/wit/gui=/home/jcarr/go/src/git.wit.org/wit/gui
|
|
|
|
# go mod edit -replace go.wit.com/wit/shell=/home/jcarr/go/src/git.wit.org/wit/shell
|
2021-11-03 02:51:41 -05:00
|
|
|
# to update go.mod to master:
|
|
|
|
go install -ldflags " \
|
|
|
|
-X main.GITCOMMIT=${GITCOMMIT} \
|
|
|
|
-X main.GOVERSION='${GOVERSION}' \
|
|
|
|
-X main.BUILDTIME='${BUILDTIME}' \
|
|
|
|
-X main.VERSION=${VERSION}"
|
|
|
|
|
|
|
|
# to build the old way
|
2021-11-02 23:44:28 -05:00
|
|
|
build:
|
2024-01-05 12:13:21 -06:00
|
|
|
GO111MODULE="off" go build -v -ldflags " \
|
2021-11-02 23:44:28 -05:00
|
|
|
-X main.GITCOMMIT=${GITCOMMIT} \
|
|
|
|
-X main.GOVERSION='${GOVERSION}' \
|
|
|
|
-X main.BUILDTIME='${BUILDTIME}' \
|
|
|
|
-X main.VERSION=${VERSION}"
|
|
|
|
|
2021-11-04 08:58:12 -05:00
|
|
|
goreleaser:
|
|
|
|
# go install github.com/goreleaser/goreleaser@latest
|
|
|
|
goreleaser release
|
|
|
|
|
|
|
|
|
2021-11-02 23:44:28 -05:00
|
|
|
godoc:
|
|
|
|
godoc -http=:6060
|
|
|
|
|
|
|
|
gomod-update:
|
|
|
|
wit go update
|
|
|
|
|
|
|
|
gomod-init:
|
|
|
|
go mod init
|
|
|
|
go mod tidy
|
|
|
|
|
|
|
|
gomod-clean:
|
|
|
|
rm -f go.*
|
|
|
|
|
2021-11-03 22:20:49 -05:00
|
|
|
sudo: new-build
|
2021-11-04 02:23:20 -05:00
|
|
|
sudo ~/go/bin/debian-gui
|
2021-11-02 23:44:28 -05:00
|
|
|
|
|
|
|
# https://golang.cafe/blog/golang-debugging-with-delve.html
|
|
|
|
# debug using 'delve'
|
|
|
|
debug:
|
|
|
|
dlv debug
|
|
|
|
|
|
|
|
push:
|
|
|
|
wit git push
|
|
|
|
|
|
|
|
prep:
|
|
|
|
apt install -y libgtk-3-dev
|
|
|
|
apt install -y libappindicator3-dev
|
|
|
|
apt install -y xterm
|
|
|
|
|
|
|
|
tag-version:
|
|
|
|
# git push --delete origin v0.6.15 # to delete a tag upstream
|
|
|
|
git diff --quiet
|
|
|
|
# go build # just an extra check to make sure the damn thing builds
|
|
|
|
git tag v${VERSION}
|
|
|
|
git push --tags
|
|
|
|
|
|
|
|
icon:
|
2021-11-03 05:27:01 -05:00
|
|
|
# go get -v github.com/cratonica/2goarray
|
|
|
|
# go install github.com/cratonica/2goarray
|
2021-11-02 23:44:28 -05:00
|
|
|
echo "//+build linux darwin" > icon.go
|
|
|
|
echo >> icon.go
|
2021-11-03 05:27:01 -05:00
|
|
|
cat resources/wit-logo4.png | 2goarray myIcon main >> icon.go
|
2021-11-02 23:44:28 -05:00
|
|
|
|
|
|
|
# a custom go target name
|
|
|
|
generate:
|
|
|
|
go generate
|
|
|
|
|
|
|
|
build-all:
|
|
|
|
GOOS=linux GOARCH=386 go build -o bin/linux.x32.bin
|
|
|
|
GOOS=freebsd GOARCH=386 go build -o bin/freebsd.x32.bin
|
|
|
|
GOOS=darwin GOARCH=386 go build -o bin/darwin.x32.bin
|
|
|
|
|
|
|
|
# https://www.digitalocean.com/community/tutorials/how-to-build-go-executables-for-multiple-platforms-on-ubuntu-16-04
|
|
|
|
build-darwin:
|
|
|
|
env GOOS=darwin GOARCH=amd64 go build
|
|
|
|
|
|
|
|
build-windows:
|
|
|
|
env GOOS=windows GOARCH=amd64 go build
|
|
|
|
|
|
|
|
gaper:
|
|
|
|
# 'gaper' is a simple and smart golang tool that just rebuilds every time you change a file
|
|
|
|
# go get -u github.com/maxcnunes/gaper
|
|
|
|
gaper
|
2021-11-03 16:22:40 -05:00
|
|
|
|
|
|
|
node002: new-build
|
2021-11-04 02:23:20 -05:00
|
|
|
strip ~/go/bin/debian-gui
|
|
|
|
-ssh root@node002 rm /root/debian-gui
|
|
|
|
scp ~/go/bin/debian-gui root@node002:
|
|
|
|
ssh -X root@node002 /root/debian-gui
|