Files
sshproxytray/Makefile
2021-07-07 12:51:28 +02:00

46 lines
990 B
Makefile

define INFO_PLIST
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LSUIElement</key>
<string>1</string>
<key>CFBundleExecutable</key>
<string>sshproxytray</string>
</dict>
</plist>
endef
export INFO_PLIST
ifeq ($(OS),Windows_NT)
OS = win
else
UNAME := $(shell uname -s)
ifeq ($(UNAME),Darwin)
OS = mac
else ifeq ($(UNAME),Linux)
OS = linux
else
$(error OS not supported by this Makefile)
endif
endif
build: build-$(OS)
install: install-$(OS)
build-mac:
mkdir -p dist/SshProxyTray.app/Contents/{MacOS,Resources}
echo $$INFO_PLIST > dist/SshProxyTray.app/Contents/Info.plist
go build -o dist/SshProxyTray.app/Contents/MacOS/sshproxytray main.go
install-mac:
cp -r dist/SshProxyTray.app /Applications
build-linux:
mkdir dist
go build -o dist/sshproxytray main.go
install-linux:
mv dist/sshproxytray /usr/local/bin/sshproxytray