add basic tray functionality

enable with `make TRAY=on ...`. Cross compilation apparently should work
from linux to linux & windows.
This commit is contained in:
Harvey Tindall
2021-05-16 16:23:28 +01:00
parent 6bf1920160
commit 8cf9b1f905
6 changed files with 155 additions and 7 deletions

View File

@@ -27,6 +27,18 @@ else
TAGS := -tags external
endif
TRAY ?= off
ifeq ($(INTERNAL)$(TRAY), offon)
TAGS := $(TAGS) tray
else ifeq ($(INTERNAL)$(TRAY), onon)
TAGS := -tags tray
endif
OS := $(shell go env GOOS)
ifeq ($(TRAY)$(OS), onwindows)
LDFLAGS := $(LDFLAGS) -H=windowsgui
endif
DEBUG ?= off
ifeq ($(DEBUG), on)
SOURCEMAP := --sourcemap
@@ -79,7 +91,7 @@ compile:
$(GOBINARY) mod download
$(info Building)
mkdir -p build
CGO_ENABLED=0 $(GOBINARY) build -ldflags="$(LDFLAGS)" $(TAGS) -o build/jfa-go
$(GOBINARY) build -ldflags="$(LDFLAGS)" $(TAGS) -o build/jfa-go
compress:
upx --lzma build/jfa-go