cloud-control-panel/Makefile

68 lines
1.8 KiB
Makefile

GITCOMMIT = $(shell git rev-list -1 HEAD)
GOVERSION = $(shell go version | cut -d' ' -f 3)
BUILDTIME = $(shell date -u --iso-8601=seconds)
# try go get github.com/ahmetb/govvv
# this will add branch info & build RFC3339 date also
run:
@echo your version of go must be greater than 2.10. Your version is ${GOVERSION}
go build -ldflags "-X main.GITCOMMIT=${GITCOMMIT} -X main.GOVERSION='${GOVERSION}' -X main.BUILDTIME='${BUILDTIME}'"
./cloud-control-panel
debug:
@echo your version of go must be greater than 2.10. Your version is ${GOVERSION}
go build -ldflags "-X main.GITCOMMIT=${GITCOMMIT} -X main.GOVERSION='${GOVERSION}' -X main.BUILDTIME='${BUILDTIME}'"
./cloud-control-panel --debugging
nogui:
go build
./cloud-control-panel -nogui
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
# simple sortcut to push all git changes
push:
git pull
git add --all
-git commit -a -s
git push --all
#git tag v0.4
git push --tags
# should update every go dependancy (?)
update:
git pull
go get -v -t -u .
# make the json config file human readable
json-readable:
cat ~/.config/cloud-control-panel.json |jq -r --tab
json-restore:
cp resources/protobuf-config.json ~/.config/cloud-control-panel.json
json-test:
cp resources/test.json ~/.config/cloud-control-panel.json
json-delete:
mv ~/.config/cloud-control-panel.json /tmp
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