2023-04-12 12:21:23 -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)
|
|
|
|
|
2024-01-03 22:09:15 -06:00
|
|
|
# export GO111MODULE="off"
|
2023-04-12 12:21:23 -05:00
|
|
|
|
|
|
|
build:
|
2024-02-15 03:28:16 -06:00
|
|
|
-mkdir plugins
|
|
|
|
-cp ~/go/src/go.wit.com/toolkits/*.so plugins/
|
2024-01-01 01:18:17 -06:00
|
|
|
go build -v
|
2024-02-15 03:28:16 -06:00
|
|
|
./wit-new-machine
|
2023-04-28 07:26:55 -05:00
|
|
|
|
2024-01-24 22:02:08 -06:00
|
|
|
goimports:
|
|
|
|
goimports -w *.go
|
|
|
|
|
|
|
|
redomod:
|
|
|
|
rm -f go.*
|
2024-01-24 22:07:03 -06:00
|
|
|
GO111MODULE= go mod init
|
|
|
|
GO111MODULE= go mod tidy
|
2024-01-24 22:02:08 -06:00
|
|
|
|
2023-04-28 07:26:55 -05:00
|
|
|
nocui:
|
|
|
|
./wit-new-machine --gui-toolkit nocui
|
2023-04-12 12:21:23 -05:00
|
|
|
|
|
|
|
release:
|
|
|
|
wit go update
|
|
|
|
go install -ldflags " \
|
|
|
|
-X main.GITCOMMIT=${GITCOMMIT} \
|
|
|
|
-X main.GOVERSION='${GOVERSION}' \
|
|
|
|
-X main.BUILDTIME='${BUILDTIME}' \
|
|
|
|
-X main.VERSION=${VERSION}"
|
|
|
|
~/go/bin/wit-new-machine
|
|
|
|
|
|
|
|
static:
|
|
|
|
# CGO_ENABLED=0 GO111MODULE="off" go build
|
|
|
|
# GO111MODULE="off" go build -v -x -ldflags="-d"
|
|
|
|
# GO111MODULE="off" go build -v -x -ldflags="-extldflags='-static -L /usr/lib/x86_64-linux-gnu/ -l /usr/lib/x86_64-linux-gnu/libayatana-appindicator3.so'"
|
|
|
|
GO111MODULE="off" go build -v -x -ldflags="-extldflags='-static'"
|
|
|
|
GO111MODULE="off" go build -v -x -ldflags="-extldflags=-static"
|
|
|
|
|
|
|
|
gomod-update:
|
|
|
|
wit go update
|
|
|
|
|
|
|
|
gomod-init:
|
|
|
|
-go mod init
|
|
|
|
go mod tidy -v
|
|
|
|
|
|
|
|
gomod-clean:
|
|
|
|
rm -f go.*
|
|
|
|
|
|
|
|
# https://golang.cafe/blog/golang-debugging-with-delve.html
|
|
|
|
# debug using 'delve'
|
|
|
|
debug:
|
|
|
|
dlv debug
|
|
|
|
|
|
|
|
push:
|
|
|
|
wit git push
|
|
|
|
|
|
|
|
tag-check:
|
|
|
|
wget https://proxy.golang.org/git.wit.org/wit/gui/@v/list
|
|
|
|
cat list
|
|
|
|
rm -f list
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
# a custom go target name
|
|
|
|
generate:
|
|
|
|
go generate
|
|
|
|
|
|
|
|
build-all: build-darwin build-windows
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
build-linux:
|
|
|
|
env GOOS=linux 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
|
|
|
|
|
|
|
|
build-1-18:
|
|
|
|
PATH=/usr/lib/go-1.18/bin/:${PATH} make
|
|
|
|
|
|
|
|
deb:
|
|
|
|
cd debian && make
|
|
|
|
-wit mirrors
|
|
|
|
|
2023-04-23 19:27:42 -05:00
|
|
|
init:
|
|
|
|
git config pull.rebase false
|
2023-04-23 21:19:09 -05:00
|
|
|
-mkdir -p ~/go/src/git.wit.org/jcarr/
|
2023-04-23 19:27:42 -05:00
|
|
|
cd ~/go/src/git.wit.org/jcarr/ && git clone https://git.wit.org/jcarr/wit-new-machine.git
|
2023-04-23 19:36:39 -05:00
|
|
|
-cd ~/go/src/git.wit.org/jcarr/wit-new-machine/ && git checkout jcarr
|
2023-04-23 19:33:57 -05:00
|
|
|
cd ~/go/src/git.wit.org/jcarr/wit-new-machine/ && GO111MODULE="off" go get -v -x
|
2023-04-23 19:36:39 -05:00
|
|
|
-cd ~/go/src/git.wit.org/wit/gui/ && git checkout jcarr
|
2023-04-23 21:17:55 -05:00
|
|
|
-cd ~/go/src/git.wit.org/wit/gui/ && make goget
|
2023-04-23 19:36:39 -05:00
|
|
|
-cd ~/go/src/git.wit.org/wit/gui/ && make
|
2023-04-23 19:27:42 -05:00
|
|
|
|
2023-04-12 12:21:23 -05:00
|
|
|
# From: https://github.com/liweiyi88/gosnakego # Sept 11 2022
|
|
|
|
#
|
|
|
|
# .PHONY: install release
|
|
|
|
#
|
|
|
|
# ARTIFACTS_DIR=artifacts/${VERSION}
|
|
|
|
# GITHUB_USERNAME=liweiyi88
|
|
|
|
#
|
|
|
|
# install:
|
|
|
|
# echo version=${VERSION}
|
|
|
|
# go install
|
|
|
|
#
|
|
|
|
# release:
|
|
|
|
# GOOS=windows GOARCH=amd64 go build -o $(ARTIFACTS_DIR)/gosnakego_windows_amd64.exe
|
|
|
|
# GOOS=darwin GOARCH=amd64 go build -o $(ARTIFACTS_DIR)/gosnakego_darwin_amd64
|
|
|
|
# GOOS=linux GOARCH=amd64 go build -o $(ARTIFACTS_DIR)/gosnakego_linux_amd64
|
|
|
|
# This uploads to github releases:
|
|
|
|
# ghr -u $(GITHUB_USERNAME) --replace ${VERSION} $(ARTIFACTS_DIR)
|