aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ui/tests/Makefile
blob: c71af21d996c8f40bd5bc4a9f2505aa6c9be446f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
export CFLAGS := -O3 -Wall -std=gnu11
export CC := x86_64-w64-mingw32-gcc
WINDRES := x86_64-w64-mingw32-windres
export CGO_ENABLED := 1
export GOOS := windows
export GOARCH := amd64

DEPLOYMENT_HOST ?= winvm
DEPLOYMENT_PATH ?= Desktop

all: tests.exe

resources.syso: ../../resources.rc ../../manifest.xml ../icon/icon.ico
	$(WINDRES) -i $< -o $@ -O coff

rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d))
tests.exe: resources.syso $(call rwildcard,..,*.go *.c *.h)
	go build -ldflags="-s -w" -v -o $@

deploy: tests.exe
	-ssh $(DEPLOYMENT_HOST) -- 'taskkill /im tests.exe /f'
	scp tests.exe $(DEPLOYMENT_HOST):$(DEPLOYMENT_PATH)

run: tests.exe
	wine tests.exe

clean:
	rm -rf resources.syso tests.exe

.PHONY: deploy run clean all