blob: 64c95476b7e296c3c676da6d4e3437cec494a9a6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
VERSION = $(shell git describe --tags)
BUILDTIME = $(shell date +%s)
run: install
go-mod-clean --version
vet:
@GO111MODULE=off go vet
@echo this go binary package builds okay
no-gui: build
./go-mod-clean --no-gui
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 \
-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 \
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
install: goimports
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.*
all: install
go-mod-clean --all --auto
autocomplete:
go-mod-clean --bash > ~/.local/share/bash-completion/completions/go-mod-clean
|