-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
34 lines (28 loc) · 987 Bytes
/
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
BUILD=go build -ldflags="-s -w" -buildmode=pie -trimpath
GENERATE=go generate
OUT_LINUX=xc
OUT_WINDOWS=xc.exe
SRC=xc.go
LINUX_COMPRESS=upx xc -o xcc; rm xc && mv xcc xc
WINDOWS_EVADE=python3 gen.py
XC_POSTGEN=cp xc.bak xc.go; rm xc.bak
XC_WIN_POSTGEN=cp client/client_windows.bak client/client_windows.go; rm client/client_windows.bak
all: clean generate linux64 windows64 postgen
generate:
${GENERATE}
postgen:
${XC_POSTGEN}
${XC_WIN_POSTGEN}
linux64:
GOOS=linux GOARCH=amd64 ${BUILD} -o ${OUT_LINUX} ${SRC}
${LINUX_COMPRESS}
windows64:
GOOS=windows GOARCH=amd64 ${BUILD} -o ${OUT_WINDOWS} ${SRC}
${WINDOWS_EVADE}
clean:
rmdir --ignore-fail-on-non-empty files/keys
mkdir -p files/keys
yes 'y' | ssh-keygen -t ed25519 -f files/keys/key -q -N ""
yes 'y' | ssh-keygen -f host_dsa -N '' -t dsa -f files/keys/host_dsa -q -N ""
yes 'y' | ssh-keygen -f host_rsa -N '' -t rsa -f files/keys/host_rsa -q -N ""
rm -f ${OUT_LINUX} ${OUT_WINDOWS} shell/keys.go meter/sc.go