2019-06-13 19:53:47 -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)
|
|
|
|
|
2021-09-01 13:05:30 -05:00
|
|
|
# GO111MODULE=on
|
2019-06-13 19:53:47 -05:00
|
|
|
|
|
|
|
# try go get github.com/ahmetb/govvv
|
|
|
|
# this will add branch info & build RFC3339 date also
|
|
|
|
|
2021-09-01 12:57:18 -05:00
|
|
|
build:
|
|
|
|
# shell things
|
2021-09-01 13:46:08 -05:00
|
|
|
cd example-nohup; go install # minimum golang 'cmd'
|
2021-09-01 12:57:18 -05:00
|
|
|
cd example-expect; go install # traditional 'expect' shell automation
|
|
|
|
cd example-shell; go install # a tty wrapper
|
2021-09-01 13:05:30 -05:00
|
|
|
cd example-gocui-mouse; go install # mouse interaction
|
|
|
|
cd example-gocui-active; go install # ytalk
|
|
|
|
cd example-gocui-colorstrue; go install # shell colors
|
|
|
|
cd example-gocui-dynamic; go install # interactive movement
|
2021-09-01 12:57:18 -05:00
|
|
|
|
|
|
|
# GUI things
|
|
|
|
cd example-systray; go install # an example systray menu (cross platform)
|
2021-09-01 13:18:33 -05:00
|
|
|
cd example-ui-splash; go install # an example GUI with drop down menus, etc
|
|
|
|
cd example-ui-controlgallery; go install # an example GUI with drop down menus, etc
|
|
|
|
cd example-ui-radiobutton; go install # slidebars, lists, radio buttons
|
|
|
|
cd example-ui-table; go install # spreadsheet
|
2021-09-01 12:57:18 -05:00
|
|
|
|
2021-09-01 13:46:08 -05:00
|
|
|
# misc
|
|
|
|
cd example-lookupAAAA; go install # nslookup
|
|
|
|
|
2021-09-01 13:24:53 -05:00
|
|
|
# golang things
|
|
|
|
cd example-pprof; go install # dump out go process internals
|
|
|
|
|
2021-09-01 13:46:08 -05:00
|
|
|
prep:
|
|
|
|
make -C example-nohup prep
|
|
|
|
|
|
|
|
sub-make:
|
|
|
|
# shell things
|
|
|
|
make -C example-expect # traditional 'expect' shell automation
|
|
|
|
make -C example-shell # a tty wrapper
|
|
|
|
make -C example-gocui-mouse # mouse interaction
|
|
|
|
|
2019-06-13 19:53:47 -05:00
|
|
|
debug:
|
|
|
|
go build -ldflags "-X main.GITCOMMIT=${GITCOMMIT} -X main.GOVERSION='${GOVERSION}' -X main.BUILDTIME='${BUILDTIME}' -X main.VERSION=${VERSION}"
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
#### NEVER DO THIS. THIS APPEARS TO INDUCE INSTABILITY IN GTK
|
|
|
|
bad-run:
|
|
|
|
#### NEVER DO THIS. THIS APPEARS TO INDUCE INSTABILITY IN GTK
|
|
|
|
# go run *.go
|
|
|
|
|
|
|
|
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
|
|
|
|
cp .git/refs/tags/v${VERSION} resources/tags/
|
|
|
|
scp resources/VERSION root@mirrors.wit.com:/data/mirrors/cloud/control-panel/
|
|
|
|
scp resources/VERSION root@mirrors.wit.com:/data/mirrors/cloud/control-panel/linux/
|
|
|
|
|
|
|
|
# should update every go dependancy (?)
|
|
|
|
update:
|
|
|
|
git pull
|
|
|
|
go get -v -t -u .
|
|
|
|
|
|
|
|
diff:
|
|
|
|
git diff
|
|
|
|
|
|
|
|
# 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
|