summaryrefslogtreecommitdiff
path: root/wrappers/swift/Makefile
blob: b46a177dfd23de43adb6981db3e223b8fae49dc3 (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
32
33
.PHONY: build test install-header clean

EXPORTS_PATH ?= ../../exports
EXPORTS_LIB_PATH ?= $(EXPORTS_PATH)/lib

ifneq ($(MAKECMDGOALS),clean)
include $(EXPORTS_PATH)/platform.mk

LIB_DIR = $(EXPORTS_LIB_PATH)/$(GOOS)/$(GOARCH)

ifeq ($(OS),Windows_NT)
SWIFT = ./swift.cmd
else
SWIFT = swift
endif
endif

build: install-header
	$(SWIFT) build --configuration release -Xlinker -L"$(LIB_DIR)"

test: install-header
	$(SWIFT) test --parallel -Xlinker -L"$(LIB_DIR)"

install-header:
ifneq ($(EXPORTS_PATH),)
ifneq ($(wildcard $(EXPORTS_PATH)/Makefile),)
	$(MAKE) -C "$(EXPORTS_PATH)"
endif
endif
	install "$(LIB_DIR)/$(LIB_NAME).h" -Dt CEduVpnCommon/Sources/CEduVpnCommon/Headers  # Copy header for modulemap

clean:
	rm -rf .build/ CEduVpnCommon/Sources/CEduVpnCommon/Headers/*.h