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 13:57:59 -05:00
|
|
|
cd example-ui-show-hide; go install # toggle hide, show
|
2021-09-01 12:57:18 -05:00
|
|
|
|
2021-09-01 21:05:06 -05:00
|
|
|
# wit/gui things
|
|
|
|
cd example-gui; go install # an example using the wit/gui wrapper
|
|
|
|
|
2021-09-01 13:46:08 -05:00
|
|
|
# misc
|
|
|
|
cd example-lookupAAAA; go install # nslookup
|
2021-09-01 13:57:59 -05:00
|
|
|
cd example-json-decode; go install # raw golang byte handling
|
2021-09-01 14:34:07 -05:00
|
|
|
cd example-ssh; go install # scp example
|
2021-09-03 11:37:50 -05:00
|
|
|
cd example-packr; go install # pack a directory into a go binary
|
2021-09-01 13:46:08 -05:00
|
|
|
|
2021-09-01 13:24:53 -05:00
|
|
|
# golang things
|
2021-09-01 14:55:34 -05:00
|
|
|
cd example-flag; go install # process argv
|
2021-09-01 13:24:53 -05:00
|
|
|
cd example-pprof; go install # dump out go process internals
|
2021-09-01 21:05:06 -05:00
|
|
|
cd example-protobuf; go install # convert json into golang protobuf struct
|
2021-09-01 14:45:20 -05:00
|
|
|
cd example-bench-fast-timer; go install # time golang channels
|
2021-09-01 21:05:06 -05:00
|
|
|
cd example-bench-readWriteOps; go install # uses channels to time select
|
2021-09-01 13:24:53 -05:00
|
|
|
|
2021-09-01 20:07:52 -05:00
|
|
|
# witgoget='-v -t' make prep
|
|
|
|
# witgoget='-v -t -u' make prep # to update
|
2021-09-01 13:46:08 -05:00
|
|
|
prep:
|
2021-09-03 11:37:50 -05:00
|
|
|
witgoget='-v -t' make base
|
|
|
|
|
|
|
|
update:
|
|
|
|
witgoget='-v -t -u' make base
|
|
|
|
|
|
|
|
base:
|
2021-09-01 13:46:08 -05:00
|
|
|
make -C example-nohup prep
|
2021-09-01 20:07:52 -05:00
|
|
|
make -C example-expect prep
|
|
|
|
make -C example-shell prep
|
|
|
|
make -C example-gocui-mouse prep
|
|
|
|
make -C example-systray prep
|
|
|
|
make -C example-lookupAAAA prep
|
2021-09-03 11:37:50 -05:00
|
|
|
make -C example-gui prep
|
|
|
|
|
|
|
|
init:
|
|
|
|
sudo make -C example-systray init
|
2021-09-01 13:46:08 -05:00
|
|
|
|
|
|
|
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
|