aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Makefile
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-04-28 08:27:19 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-04-28 08:43:49 +0200
commit45245bde0bc81509828990ad1dfb729f32fcd8e5 (patch)
tree12e1375372adb4b33a7a041b4a599b61e9397b60 /Makefile
parentui: use normal line edit in confview (diff)
downloadwireguard-windows-45245bde0bc81509828990ad1dfb729f32fcd8e5.tar.xz
wireguard-windows-45245bde0bc81509828990ad1dfb729f32fcd8e5.zip
build: backport security attributes helper from 1.13
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 11 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 23bba17c..c287f30a 100644
--- a/Makefile
+++ b/Makefile
@@ -3,9 +3,11 @@ GOFLAGS := -ldflags="-H windowsgui -s -w" -v
WINDRES := x86_64-w64-mingw32-windres
export CGO_ENABLED := 1
export GOOS := windows
+OLD_GOROOT := $(GOROOT)
+export GOROOT := $(PWD)/.deps/goroot
rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d))
-SOURCE_FILES := $(call rwildcard,,*.go *.c *.h)
+SOURCE_FILES := $(call rwildcard,,*.go *.c *.h) .deps/prepared
RESOURCE_FILES := resources.rc manifest.xml ui/icon/icon.ico
DEPLOYMENT_HOST ?= winvm
@@ -13,6 +15,13 @@ DEPLOYMENT_PATH ?= Desktop
all: amd64/wireguard.exe x86/wireguard.exe
+.deps/prepared: export GOROOT := $(OLD_GOROOT)
+.deps/prepared: $(wildcard golang-*.patch)
+ rm -rf .deps && mkdir -p .deps
+ rsync --exclude=pkg/obj/go-build/trim.txt -aq $$(go env GOROOT)/ .deps/goroot
+ cat $^ | patch -f -N -r- -p1 -d .deps/goroot
+ touch $@
+
resources_amd64.syso: $(RESOURCE_FILES)
x86_64-w64-mingw32-windres -i $< -o $@ -O coff
@@ -34,6 +43,6 @@ deploy: amd64/wireguard.exe
scp $< $(DEPLOYMENT_HOST):$(DEPLOYMENT_PATH)
clean:
- rm -rf *.syso x86/ amd64/
+ rm -rf *.syso x86/ amd64/ .deps
.PHONY: deploy clean all