2024-12-10 14:07:14 -06:00
|
|
|
VERSION = $(shell git describe --tags)
|
|
|
|
BUILDTIME = $(shell date +%Y.%m.%d_%H%M)
|
|
|
|
|
2024-12-13 16:16:18 -06:00
|
|
|
run: install
|
2024-12-12 18:59:16 -06:00
|
|
|
go-mod-clean --version
|
2024-12-10 14:07:14 -06:00
|
|
|
|
|
|
|
vet:
|
|
|
|
@GO111MODULE=off go vet
|
|
|
|
@echo this go binary package builds okay
|
|
|
|
|
|
|
|
no-gui: build
|
2024-12-12 18:59:16 -06:00
|
|
|
./go-mod-clean --no-gui
|
2024-12-10 14:07:14 -06:00
|
|
|
|
|
|
|
build: goimports
|
|
|
|
GO111MODULE=off go build -v \
|
|
|
|
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
|
|
|
|
|
|
|
|
build-darwin:
|
2024-12-12 18:59:16 -06:00
|
|
|
GOOS=darwin GOARCH=amd64 GO111MODULE=off go build -v -o go-mod-clean-darwin \
|
2024-12-10 14:07:14 -06:00
|
|
|
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
|
|
|
|
build-windows:
|
2024-12-12 18:59:16 -06:00
|
|
|
GOOS=windows GOARCH=amd64 GO111MODULE=off go build -v go-mod-clean.exe \
|
2024-12-10 14:07:14 -06:00
|
|
|
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
|
|
|
|
|
2024-12-13 16:16:18 -06:00
|
|
|
install: goimports
|
2024-12-10 14:07:14 -06:00
|
|
|
GO111MODULE=off go install \
|
|
|
|
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
|
|
|
|
|
|
|
|
goimports:
|
|
|
|
reset
|
|
|
|
goimports -w *.go
|
|
|
|
# // to globally reset paths:
|
|
|
|
# // gofmt -w -r "go.wit.com/gui -> go.wit.com/gui/gui" .
|
|
|
|
|
|
|
|
clean:
|
2024-12-12 18:59:16 -06:00
|
|
|
-rm -f go-mod-clean go.*
|
2024-12-13 16:16:18 -06:00
|
|
|
|
|
|
|
all: install
|
|
|
|
go-mod-clean --all --auto
|