aboutsummaryrefslogblamecommitdiffstatshomepage
path: root/Makefile
blob: 0fb865a91a41afb8dbad1ad4da592c8166816015 (plain) (tree)
1
2
3
4
5
6
7
8
9
10

                          


                  

                                                                                                                   
 

                                                                                            
                                                                                                                 




                          
                                           

                     
CFLAGS ?= -O3
CFLAGS += -Wall -std=gnu11

all: wireguard.exe

resources.syso: ui/icon/icon.ico ui/manifest.xml go.mod
	go run github.com/akavel/rsrc -manifest ui/manifest.xml -ico ui/icon/icon.ico -arch amd64 -o resources.syso

rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d))
wireguard.exe: resources.syso $(call rwildcard,,*.go *.c *.h)
	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

clean:
	rm -rf resources.syso wireguard.exe

.PHONY: run clean all