summaryrefslogtreecommitdiff
path: root/wrappers/python/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'wrappers/python/Makefile')
-rw-r--r--wrappers/python/Makefile16
1 files changed, 14 insertions, 2 deletions
diff --git a/wrappers/python/Makefile b/wrappers/python/Makefile
index be4beaa..ba4cf5f 100644
--- a/wrappers/python/Makefile
+++ b/wrappers/python/Makefile
@@ -1,15 +1,27 @@
.PHONY: pack test clean
+EXPORTS_PATH ?= ../../exports
+EXPORTS_LIB_PATH ?= $(EXPORTS_PATH)/lib
+
+ifneq ($(MAKECMDGOALS),clean)
+include $(EXPORTS_PATH)/platform.mk
+endif
+
ifdef PLAT_NAME
SETUP_ARGS += --plat-name=$(PLAT_NAME)
endif
# Build for current platform only
pack:
- ./setup.py bdist_wheel $(SETUP_ARGS)
+ ./setup.py bdist_wheel $(SETUP_ARGS) --exports-lib-path="$(EXPORTS_LIB_PATH)"
test:
- $(MAKE) -C ../../exports copy-to COPY_TARGET=../wrappers/python/eduvpncommon/lib
+ifneq ($(EXPORTS_PATH),)
+ifneq ($(wildcard $(EXPORTS_PATH)/Makefile),)
+ $(MAKE) -C "$(EXPORTS_PATH)"
+endif
+endif
+ install "$(EXPORTS_LIB_PATH)/$(GOOS)/$(GOARCH)/$(LIB_FILE)" -Dt "eduvpncommon/lib"
python3 -m unittest test_discovery
rm eduvpncommon/lib/*