From 959773884e5aacd5178e43a0de2e8015ae2f8b5e Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Thu, 28 Feb 2019 08:27:52 +0100 Subject: build: add rsrc to go module Signed-off-by: Jason A. Donenfeld --- Makefile | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'Makefile') 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 -- cgit v1.2.3-59-g8ed1b