summaryrefslogtreecommitdiff
path: root/wrappers/swift/Makefile
diff options
context:
space:
mode:
authorStevenWdV <stevenwdv@gmail.com>2022-02-04 01:18:12 +0100
committerStevenWdV <stevenwdv@gmail.com>2022-02-04 01:18:12 +0100
commitb60ecf2fe5ddfe506e02093286b3931873187e91 (patch)
treeb3804b1b95e70e96dec98cb0c2b571e0b895ebdd /wrappers/swift/Makefile
parentbb85487e40b47d701e64085e7574cb477a431f1e (diff)
More Makefile cleanup, support building in folder with spaces
Diffstat (limited to 'wrappers/swift/Makefile')
-rw-r--r--wrappers/swift/Makefile21
1 files changed, 5 insertions, 16 deletions
diff --git a/wrappers/swift/Makefile b/wrappers/swift/Makefile
index b46a177..6dca0ef 100644
--- a/wrappers/swift/Makefile
+++ b/wrappers/swift/Makefile
@@ -1,33 +1,22 @@
.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)
+include $(EXPORTS_PATH)/common.mk
ifeq ($(OS),Windows_NT)
SWIFT = ./swift.cmd
else
SWIFT = swift
endif
-endif
build: install-header
- $(SWIFT) build --configuration release -Xlinker -L"$(LIB_DIR)"
+ $(SWIFT) build --configuration release -Xlinker -L"$(EXPORTS_LIB_SUBFOLDER_PATH)"
test: install-header
- $(SWIFT) test --parallel -Xlinker -L"$(LIB_DIR)"
+ $(SWIFT) test --parallel -Xlinker -L"$(EXPORTS_LIB_SUBFOLDER_PATH)"
-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
+install-header: .try_build_lib
+ install "$(EXPORTS_LIB_SUBFOLDER_PATH)/$(LIB_NAME).h" -Dt CEduVpnCommon/Sources/CEduVpnCommon/Headers # Copy header for modulemap
clean:
rm -rf .build/ CEduVpnCommon/Sources/CEduVpnCommon/Headers/*.h