summaryrefslogtreecommitdiff
path: root/wrappers/swift/Makefile
blob: cf117f38d60eea93f5deaf188aca9aa66e8d737d (plain)
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
31
.PHONY: build test clean

ifneq (clean,$(MAKECMDGOALS))
GOOS      != go env GOHOSTOS
GOARCH    != go env GOHOSTARCH

ifeq (Windows_NT,$(OS))
export PATH := $(PATH):$(abspath ../../exports/$(GOOS)/$(GOARCH))
else
export LD_LIBRARY_PATH := $(LD_LIBRARY_PATH):$(abspath ../../exports/$(GOOS)/$(GOARCH))
endif
endif

build:
	$(MAKE) -C ../../exports
ifeq (Windows_NT,$(OS))
	"$(COMSPEC)" /c "\".\\fix-path.cmd & swift build --configuration release -Xlinker -L^\"../../exports/$(GOOS)/$(GOARCH)^\"\""
else
	swift build --configuration release -Xlinker -L"../../exports/$(GOOS)/$(GOARCH)"
endif

test:
	$(MAKE) -C ../../exports
ifeq (Windows_NT,$(OS))
	"$(COMSPEC)" /c "\".\\fix-path.cmd & swift test --parallel -Xlinker -L^\"../../exports/$(GOOS)/$(GOARCH)^\"\""
else
	swift test --parallel -Xlinker -L"../../exports/$(GOOS)/$(GOARCH)"
endif

clean:
	rm -rf .build/