From e544c6fa9e15e7277da79e2464243e90b2706b8c Mon Sep 17 00:00:00 2001 From: StevenWdV Date: Mon, 24 Jan 2022 14:59:25 +0100 Subject: Cleanup Added variables to Makefiles to specify custom exports/ directory; Split exception classes in Java & C#; Added more comments; Renamed library and Go package; Removed real (pure) tests; Added generate_lib.ps1 to generate import .lib for Windows (Swift); Moved built Go libraries to exports/lib/; Switch to hopefully faster Swift GitHub Action. --- wrappers/swift/Makefile | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'wrappers/swift/Makefile') diff --git a/wrappers/swift/Makefile b/wrappers/swift/Makefile index 84b3cc1..b46a177 100644 --- a/wrappers/swift/Makefile +++ b/wrappers/swift/Makefile @@ -1,24 +1,33 @@ -.PHONY: build test clean +.PHONY: build test install-header clean -ifneq (clean,$(MAKECMDGOALS)) -include ../../exports/platform.mk +EXPORTS_PATH ?= ../../exports +EXPORTS_LIB_PATH ?= $(EXPORTS_PATH)/lib -ifeq (Windows_NT,$(OS)) +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: .build_lib - $(SWIFT) build --configuration release -Xlinker -L"../../exports/$(GOOS)/$(GOARCH)" +build: install-header + $(SWIFT) build --configuration release -Xlinker -L"$(LIB_DIR)" + +test: install-header + $(SWIFT) test --parallel -Xlinker -L"$(LIB_DIR)" -test: .build_lib - $(SWIFT) test --parallel -Xlinker -L"../../exports/$(GOOS)/$(GOARCH)" +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 - -.build_lib: - $(MAKE) -C ../../exports - install "../../exports/$(GOOS)/$(GOARCH)/eduvpn_verify.h" -Dt CEduVpnCommon/Sources/CEduVpnCommon/Headers -- cgit v1.2.3