diff --git a/test/unit/lib/blob/Makefile b/test/unit/lib/blob/Makefile index 516a8f758..6a47d4372 100644 --- a/test/unit/lib/blob/Makefile +++ b/test/unit/lib/blob/Makefile @@ -34,17 +34,24 @@ SPDK_ROOT_DIR := $(abspath $(CURDIR)/../../../..) include $(SPDK_ROOT_DIR)/mk/spdk.common.mk -HASH = \# -CUNIT_VERSION = $(shell echo "$(HASH)include " | $(CC) -E -dM - | sed -n -e 's/\#define CU_VERSION "\([0-9\.\-]*\).*/\1/p') -ifeq ($(CUNIT_VERSION),2.1-3) +# Make targets are based on the current value of $(CUNIT_VERSION), +# rather than on configuration values. All sub-directories are +# added to $(DIRS-y) so that they are included in 'make clean'. +# $(ALL_DIRS) contains the list of sub-directories to compile. DIRS-y = blob.c +ALL_DIRS = + +HASH = \# +CUNIT_VERSION = $(shell echo "$(HASH)include " | $(CC) $(CFLAGS) -E -dM - | sed -n -e 's/\#define CU_VERSION "\([0-9\.\-]*\).*/\1/p') +ifeq ($(CUNIT_VERSION),2.1-3) +ALL_DIRS = blob.c else $(warning "blob_ut.c compilation skipped, only CUnit version 2.1-3 is supported") endif .PHONY: all clean $(DIRS-y) -all: $(DIRS-y) +all: $(ALL_DIRS) clean: $(DIRS-y) include $(SPDK_ROOT_DIR)/mk/spdk.subdirs.mk