summaryrefslogtreecommitdiffstats
path: root/src/pmdk/utils/docker/test_package/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'src/pmdk/utils/docker/test_package/Makefile')
-rw-r--r--src/pmdk/utils/docker/test_package/Makefile21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/pmdk/utils/docker/test_package/Makefile b/src/pmdk/utils/docker/test_package/Makefile
new file mode 100644
index 000000000..f5970aac3
--- /dev/null
+++ b/src/pmdk/utils/docker/test_package/Makefile
@@ -0,0 +1,21 @@
+# SPDX-License-Identifier: BSD-3-Clause
+# Copyright 2018, Intel Corporation
+
+check_package = $(shell pkg-config $(1) && echo y || echo n)
+
+HAS_LIBPMEMOBJ := $(call check_package, libpmemobj --atleast-version $(LIBPMEMOBJ_MIN_VERSION) --print-errors)
+
+LIBS += $(shell pkg-config --libs libpmemobj)
+CFLAGS += $(shell pkg-config --cflags libpmemobj)
+
+ifeq ($(HAS_LIBPMEMOBJ),n)
+$(error libpmemobj(version >= $(LIBPMEMOBJ_MIN_VERSION)) is missing)
+endif
+
+test_package: test_package.c
+ $(CC) test_package.c $(LIBS) $(CFLAGS) -o $@
+
+clean:
+ rm -f test_package
+
+.PHONY: clean