summaryrefslogtreecommitdiff
path: root/wrappers/swift/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'wrappers/swift/Makefile')
-rw-r--r--wrappers/swift/Makefile31
1 files changed, 31 insertions, 0 deletions
diff --git a/wrappers/swift/Makefile b/wrappers/swift/Makefile
new file mode 100644
index 0000000..cf117f3
--- /dev/null
+++ b/wrappers/swift/Makefile
@@ -0,0 +1,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/