-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
49 lines (34 loc) · 2.3 KB
/
Makefile
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
43
44
45
46
47
48
49
# makefile for crossing building on macOS
# supported os: windows, macOS
# make sure fyne is installed before packaging (see: https://developer.fyne.io/started/packaging).
PHONY: clean all package
PACKAGE=github.com/genshen/wssocks-plugin-ustb/client-ui
FLAGS=--trimpath
appID=wssocks-ustb-client-ui.genshen.github.com
appName="wssocks-ustb client"
APP_VERSION=0.7.0
PACKAGE_FLAG=-icon app-512.png -appID ${appID} --appVersion ${APP_VERSION} -release -appBuild 5
all: wssocks-ustb-ui-macOS-amd64 wssocks-ustb-ui-macOS-arm64 wssocks-ustb-ui-windows-amd64.exe # wssocks-ustb-ui-linux-amd64
wssocks-ustb-ui-macOS-amd64:
CC=clang CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build ${FLAGS} -o wssocks-ustb-ui-macOS-amd64 ${PACKAGE}
wssocks-ustb-ui-macOS-arm64:
CC=clang CGO_ENABLED=1 GOOS=darwin GOARCH=arm64 go build ${FLAGS} -o wssocks-ustb-ui-macOS-arm64 ${PACKAGE}
wssocks-ustb-ui-windows-amd64.exe:
CC=x86_64-w64-mingw32-gcc CGO_ENABLED=1 GOOS=windows GOARCH=amd64 go build ${FLAGS} -ldflags -H=windowsgui -o wssocks-ustb-ui-windows-amd64.exe ${PACKAGE}
wssocks-ustb-ui-macOS-universal: wssocks-ustb-ui-macOS-amd64 wssocks-ustb-ui-macOS-arm64
lipo wssocks-ustb-ui-macOS-amd64 wssocks-ustb-ui-macOS-arm64 -create -output wssocks-ustb-ui-macOS-universal
# wssocks-ustb-ui-linux-amd64:
# CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o wssocks-ustb-ui-linux-amd64 ${PACKAGE}
# packaging
package: client-ui-macOS-universal.app client-ui-windows-amd64.exe # client-ui-linux-amd64
client-ui-macOS-universal.app: wssocks-ustb-ui-macOS-universal
CC=clang CGO_ENABLED=1 GOOS=darwin fyne package -os darwin ${PACKAGE_FLAG} -executable wssocks-ustb-ui-macOS-universal -name ${appName}
rm -rf client-ui-macOS-universal.app; mv ${appName}.app client-ui-macOS-universal.app
client-ui-windows-amd64.exe: wssocks-ustb-ui-windows-amd64.exe
CC=x86_64-w64-mingw32-gcc CGO_ENABLED=1 GOOS=windows GOARCH=amd64 fyne package -os windows ${PACKAGE_FLAG} -executable wssocks-ustb-ui-windows-amd64.exe -name ${appName}.exe
mv ${appName}.exe client-ui-windows-amd64.exe
# export CGO_CFLAGS='-D _POSIX'
# client-ui-linux-amd64:
clean:
rm -rf wssocks-ustb-ui-macOS-amd64 wssocks-ustb-ui-macOS-arm64 wssocks-ustb-ui-macOS-universal wssocks-ustb-ui-windows-amd64.exe client-ui-macOS-universal.app client-ui-windows-amd64.exe
rm -rf wssocks-ustb-client fyne.syso