aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-02-28 08:27:52 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-02-28 08:52:29 +0100
commit1f9623ab276af819ae634b43a447e826a37f27d2 (patch)
treedfcfaaab108b2bde6dd43b3789b8d22811886f18
parentui: move walk to go module replace operation (diff)
downloadwireguard-windows-1f9623ab276af819ae634b43a447e826a37f27d2.tar.xz
wireguard-windows-1f9623ab276af819ae634b43a447e826a37f27d2.zip
build: add rsrc to go module
-rw-r--r--Makefile12
-rw-r--r--README.md2
-rw-r--r--go.mod1
3 files changed, 4 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 48885e5a..ec369b65 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,5 @@
CFLAGS ?= -O3
CFLAGS += -Wall -std=gnu11
-export CGO_ENABLED := 1
-export CGO_CFLAGS := $(CFLAGS)
-export CC := x86_64-w64-mingw32-gcc
-export GOOS := windows
-export GOARCH := amd64
-export PATH := $(PATH):$(GOPATH)/bin
all: wireguard.exe
@@ -28,11 +22,11 @@ $(foreach FILE,$(DOWNSTREAM_FILES),$(eval $(call copy-src-to-build,,$(FILE))))
$(BUILDDIR)/.prepared:
touch "$@"
-$(BUILDDIR)/resources.syso: ui/icon/icon.ico ui/manifest.xml
- rsrc -manifest ui/manifest.xml -ico ui/icon/icon.ico -arch amd64 -o $@
+$(BUILDDIR)/resources.syso: ui/icon/icon.ico ui/manifest.xml $(BUILDDIR)/go.mod
+ cd "$(BUILDDIR)" && go run github.com/akavel/rsrc -manifest ../ui/manifest.xml -ico ../ui/icon/icon.ico -arch amd64 -o resources.syso
wireguard.exe: $(BUILDDIR)/.prepared $(BUILDDIR)/resources.syso
- cd "$(BUILDDIR)" && go build -ldflags="-H windowsgui" -o ../$@ -v
+ cd "$(BUILDDIR)" && CC=x86_64-w64-mingw32-gcc CGO_ENABLED=1 GOOS=windows GOARCH=amd64 go build -ldflags="-H windowsgui" -o ../$@
run: wireguard.exe
wine wireguard.exe
diff --git a/README.md b/README.md
index 5cd655fc..949e05e0 100644
--- a/README.md
+++ b/README.md
@@ -5,10 +5,8 @@ Nothing to see here yet. Come back later.
### Requirements
- [Go ≥1.12](https://www.golang.org)
- - [rsrc tool](https://github.com/akavel/rsrc)
- [Wintun](https://git.zx2c4.com/wintun)
-
### Clone
This has a few submodules at the moment, so you'll need to clone recursively. While building (below) uses WSL, it's recommended that you still clone into Windows per usual.
diff --git a/go.mod b/go.mod
index 40f0aff4..795f9e93 100644
--- a/go.mod
+++ b/go.mod
@@ -10,6 +10,7 @@ require (
)
replace (
+ github.com/akavel/rsrc => golang.zx2c4.com/wireguard/windows pkg/rsrc
github.com/lxn/walk => golang.zx2c4.com/wireguard/windows pkg/walk
github.com/lxn/win => golang.zx2c4.com/wireguard/windows pkg/walk-win
)