diff options
-rw-r--r-- | Makefile | 12 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | go.mod | 1 |
3 files changed, 4 insertions, 11 deletions
@@ -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 @@ -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. @@ -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 ) |