xref: /spdk/test/unit/lib/blob/Makefile (revision 5d1fa2993239a43d6d5c924d0555b3987aae6b8e)
1#  SPDX-License-Identifier: BSD-3-Clause
2#  Copyright (C) 2015 Intel Corporation.
3#  All rights reserved.
4#  Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
5#
6
7SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../..)
8include $(SPDK_ROOT_DIR)/mk/spdk.common.mk
9
10#  Make targets are based on the current value of $(CUNIT_VERSION),
11#  rather than on configuration values. All sub-directories are
12#  added to $(DIRS-y) so that they are included in 'make clean'.
13#  $(ALL_DIRS) contains the list of sub-directories to compile.
14DIRS-y = blob.c blob_bdev.c
15ALL_DIRS = blob_bdev.c
16
17HASH = \#
18CUNIT_VERSION = $(shell echo "$(HASH)include <CUnit/CUnit.h>" | $(CC) $(CFLAGS) -E -dM - | sed -n -e 's/\#define CU_VERSION "\([0-9\.\-]*\).*/\1/p')
19ifeq ($(CUNIT_VERSION),2.1-3)
20ALL_DIRS += blob.c
21else
22$(warning "blob_ut.c compilation skipped, only CUnit version 2.1-3 is supported")
23endif
24
25.PHONY: all clean $(DIRS-y)
26
27all: $(ALL_DIRS)
28clean: $(DIRS-y)
29
30include $(SPDK_ROOT_DIR)/mk/spdk.subdirs.mk
31