51 lines
1.1 KiB
Makefile
51 lines
1.1 KiB
Makefile
VERSION = $(shell git describe --tags)
|
|
BUILDTIME = $(shell date +%Y.%m.%d)
|
|
|
|
all: build
|
|
./gadgetwindow
|
|
|
|
build:
|
|
GO111MODULE=off go build \
|
|
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
|
|
|
|
verbose:
|
|
GO111MODULE=off go build -v -x \
|
|
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
|
|
|
|
install:
|
|
GO111MODULE=off go install \
|
|
-ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
|
|
|
|
clean:
|
|
-rm -f gadgetwindow
|
|
-rm resources/*.so
|
|
touch resources/blank.so
|
|
|
|
# embed the toolkit plugins in the binary
|
|
embed:
|
|
-rm resources/*.so
|
|
touch resources/blank.so
|
|
cp -a ~/go/src/go.wit.com/toolkits/*.so resources/
|
|
|
|
nocui: build
|
|
reset
|
|
./gadgetwindow --gui nocui
|
|
|
|
gocui: build
|
|
reset
|
|
echo "redirecting STDOUT & STDERR to /tmp/gadgetwindow.out"
|
|
./gadgetwindow --gui gocui
|
|
|
|
debugger: build
|
|
reset
|
|
./gadgetwindow --debugger
|
|
|
|
goimports:
|
|
goimports -w *.go
|
|
|
|
redomod:
|
|
rm -f go.*
|
|
goimports -w *.go
|
|
GO111MODULE= go mod init
|
|
GO111MODULE= go mod tidy
|