summaryrefslogtreecommitdiffstats
path: root/tests/deckard/Makefile
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 00:55:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 00:55:53 +0000
commit3d0386f27ca66379acf50199e1d1298386eeeeb8 (patch)
treef87bd4a126b3a843858eb447e8fd5893c3ee3882 /tests/deckard/Makefile
parentInitial commit. (diff)
downloadknot-resolver-upstream.tar.xz
knot-resolver-upstream.zip
Adding upstream version 3.2.1.upstream/3.2.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/deckard/Makefile')
-rw-r--r--tests/deckard/Makefile58
1 files changed, 58 insertions, 0 deletions
diff --git a/tests/deckard/Makefile b/tests/deckard/Makefile
new file mode 100644
index 0000000..675aa42
--- /dev/null
+++ b/tests/deckard/Makefile
@@ -0,0 +1,58 @@
+# Defaults
+PYTHON ?= python3
+LIBEXT := .so
+PLATFORM := $(shell uname -s)
+ifeq ($(PLATFORM),Darwin)
+ LIBEXT := .dylib
+endif
+
+# Dependencies
+include platform.mk
+libcwrap_DIR := contrib/libswrap
+libcwrap_cmake_DIR := $(libcwrap_DIR)/obj
+libcwrap=$(abspath $(libcwrap_cmake_DIR))/src/libsocket_wrapper$(LIBEXT).0
+ifeq ($(PLATFORM),Darwin)
+ libcwrap=$(abspath $(libcwrap_cmake_DIR))/src/libsocket_wrapper.0$(LIBEXT)
+endif
+libfaketime_DIR := contrib/libfaketime
+libfaketime := $(abspath $(libfaketime_DIR))/src/libfaketime$(LIBEXT).1
+
+# Platform-specific targets
+ifeq ($(PLATFORM),Darwin)
+ libfaketime := $(abspath $(libfaketime_DIR))/src/libfaketime.1$(LIBEXT)
+ preload_syms := DYLD_LIBRARY_PATH=$(DYLD_LIBRARY_PATH) DYLD_FORCE_FLAT_NAMESPACE=1 DYLD_INSERT_LIBRARIES="$(libfaketime):$(libcwrap)"
+else
+ preload_syms := LD_PRELOAD="$(libfaketime):$(libcwrap)"
+endif
+
+
+# Targets
+all:
+ @echo "Deckard is now run using *run.sh scripts in its root directory."
+ @echo "To build the dependencies (libfaketime and libcwrap) run 'make depend'."
+ exit 1
+depend: $(libfaketime) $(libcwrap)
+ @echo "export DONT_FAKE_MONOTONIC=1" > env.sh
+ @echo "export $(preload_syms)" >> env.sh
+
+# Synchronize submodules
+submodules: .gitmodules
+ @git submodule update --init
+# indirection through submodules target is necessary
+# to prevent make from running "git submodule" commands in parallel
+$(libfaketime_DIR)/Makefile $(libcwrap_DIR)/CMakeLists.txt: submodules
+$(libfaketime): $(libfaketime_DIR)/Makefile
+ @CFLAGS="-O0 -g" $(MAKE) -s -C $(libfaketime_DIR)
+$(libcwrap_cmake_DIR):$(libcwrap_DIR)/CMakeLists.txt
+ @mkdir -p $(libcwrap_cmake_DIR)
+$(libcwrap_cmake_DIR)/Makefile: $(libcwrap_cmake_DIR)
+ @cd $(libcwrap_cmake_DIR); cmake ..
+$(libcwrap): $(libcwrap_cmake_DIR)/Makefile
+ @CFLAGS="-O0 -g" $(MAKE) -s -C $(libcwrap_cmake_DIR)
+
+
+.PHONY: submodules depend all
+
+check:
+ @echo Running unittests using pytest
+ ${PYTHON} -m pytest