go-mod-clean/Makefile

40 lines
1.1 KiB
Makefile
Raw Permalink Normal View History

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
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
./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:
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:
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:
-rm -f go-mod-clean go.*
2024-12-13 16:16:18 -06:00
all: install
go-mod-clean --all --auto