Skip to content

Commit

Permalink
common: simplification of OS_DIMM flag handling
Browse files Browse the repository at this point in the history
Signed-off-by: Tomasz Gromadzki <tomasz.gromadzki@intel.com>
  • Loading branch information
grom72 committed Nov 27, 2023
1 parent 85b10e5 commit eaa3fb6
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 89 deletions.
14 changes: 3 additions & 11 deletions src/common/pmemcommon.inc
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@ SOURCE +=\
$(PMEM2)/deep_flush_linux.c\
$(PMEM2)/extent_linux.c\
$(PMEM2)/pmem2_utils_linux.c\
$(PMEM2)/pmem2_utils_$(OS_DIMM).c

ifeq ($(OS_DIMM),ndctl)
SOURCE +=\
$(PMEM2)/region_namespace_ndctl.c\
$(PMEM2)/numa_ndctl.c
else
SOURCE +=\
$(PMEM2)/region_namespace_none.c\
$(PMEM2)/numa_none.c
endif
$(PMEM2)/pmem2_utils_$(OS_DIMM).c\
$(PMEM2)/region_namespace_$(OS_DIMM).c\
$(PMEM2)/numa_$(OS_DIMM).c
14 changes: 3 additions & 11 deletions src/libpmem/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,9 @@ SOURCE =\
$(PMEM2)/pmem2_utils_linux.c\
$(PMEM2)/pmem2_utils_$(OS_DIMM).c\
$(PMEM2)/auto_flush_linux.c\
$(PMEM2)/deep_flush_linux.c

ifeq ($(OS_DIMM),ndctl)
SOURCE +=\
region_namespace_ndctl.c\
numa_ndctl.c
else
SOURCE +=\
region_namespace_none.c\
numa_none.c
endif
$(PMEM2)/deep_flush_linux.c\
$(PMEM2)/region_namespace_$(OS_DIMM).c\
$(PMEM2)/numa_$(OS_DIMM).c

INCS += -I$(TOP)/src/libpmem2

Expand Down
14 changes: 3 additions & 11 deletions src/libpmem2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,9 @@ SOURCE =\
deep_flush_linux.c\
extent_linux.c\
pmem2_utils_linux.c\
pmem2_utils_$(OS_DIMM).c

ifeq ($(OS_DIMM),ndctl)
SOURCE +=\
region_namespace_ndctl.c\
numa_ndctl.c
else
SOURCE +=\
region_namespace_none.c\
numa_none.c
endif
pmem2_utils_$(OS_DIMM).c\
region_namespace_$(OS_DIMM).c\
numa_$(OS_DIMM).c

include $(ARCH)/sources.inc

Expand Down
56 changes: 12 additions & 44 deletions src/test/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -162,17 +162,9 @@ OBJS +=\
$(TOP)/src/debug/libpmem2/auto_flush_linux.o\
$(TOP)/src/debug/libpmem2/deep_flush_linux.o\
$(TOP)/src/debug/libpmem2/extent_linux.o\
$(TOP)/src/debug/libpmem2/pmem2_utils_linux.o

ifeq ($(OS_DIMM),ndctl)
OBJS +=\
$(TOP)/src/debug/libpmem2/region_namespace_ndctl.o\
$(TOP)/src/debug/libpmem2/numa_ndctl.o
else
OBJS +=\
$(TOP)/src/debug/libpmem2/region_namespace_none.o\
$(TOP)/src/debug/libpmem2/numa_none.o
endif
$(TOP)/src/debug/libpmem2/pmem2_utils_linux.o\
$(TOP)/src/debug/libpmem2/region_namespace_$(OS_DIMM).o\
$(TOP)/src/debug/libpmem2/numa_$(OS_DIMM).o

include $(TOP)/src/libpmem2/$(ARCH)/sources.inc
OBJS_MEM = $(LIBPMEM2_ARCH_SOURCE:.c=.o)
Expand Down Expand Up @@ -208,17 +200,9 @@ OBJS +=\
$(TOP)/src/nondebug/libpmem2/auto_flush_linux.o\
$(TOP)/src/nondebug/libpmem2/deep_flush_linuc.o\
$(TOP)/src/nondebug/libpmem2/extent_linux.o\
$(TOP)/src/nondebug/libpmem2/pmem2_utils_linux.o

ifeq ($(OS_DIMM),ndctl)
OBJS +=\
$(TOP)/src/nondebug/libpmem2/region_namespace_ndctl.o\
$(TOP)/src/nondebug/libpmem2/numa_ndctl.o
else
OBJS +=\
$(TOP)/src/nondebug/libpmem2/region_namespace_none.o\
$(TOP)/src/nondebug/libpmem2/numa_none.o
endif
$(TOP)/src/nondebug/libpmem2/pmem2_utils_linux.o\
$(TOP)/src/nondebug/libpmem2/region_namespace_$(OS_DIMM).o\
$(TOP)/src/nondebug/libpmem2/numa_$(OS_DIMM).o

include $(TOP)/src/libpmem2/$(ARCH)/sources.inc
OBJS_MEM = $(LIBPMEM2_ARCH_SOURCE:.c=.o)
Expand Down Expand Up @@ -276,17 +260,9 @@ OBJS +=\
$(TOP)/src/nondebug/libpmem2/auto_flush_linux.o\
$(TOP)/src/nondebug/libpmem2/deep_flush_linux.o\
$(TOP)/src/nondebug/libpmem2/extent_linux.o\
$(TOP)/src/nondebug/libpmem2/pmem2_utils_linux.o

ifeq ($(OS_DIMM),ndctl)
OBJS +=\
$(TOP)/src/nondebug/libpmem2/region_namespace_ndctl.o\
$(TOP)/src/nondebug/libpmem2/numa_ndctl.o
else
OBJS +=\
$(TOP)/src/nondebug/libpmem2/region_namespace_none.o\
$(TOP)/src/nondebug/libpmem2/numa_none.o
endif
$(TOP)/src/nondebug/libpmem2/pmem2_utils_linux.o\
$(TOP)/src/nondebug/libpmem2/region_namespace_$(OS_DIMM).o\
$(TOP)/src/nondebug/libpmem2/numa_$(OS_DIMM).o

INCS += -I$(TOP)/src/common
endif
Expand Down Expand Up @@ -323,17 +299,9 @@ OBJS +=\
$(TOP)/src/debug/libpmem2/auto_flush_linux.o\
$(TOP)/src/debug/libpmem2/deep_flush_linux.o\
$(TOP)/src/debug/libpmem2/extent_linux.o\
$(TOP)/src/debug/libpmem2/pmem2_utils_linux.o

ifeq ($(OS_DIMM),ndctl)
OBJS +=\
$(TOP)/src/debug/libpmem2/region_namespace_ndctl.o\
$(TOP)/src/debug/libpmem2/numa_ndctl.o
else
OBJS +=\
$(TOP)/src/debug/libpmem2/region_namespace_none.o\
$(TOP)/src/debug/libpmem2/numa_none.o
endif
$(TOP)/src/debug/libpmem2/pmem2_utils_linux.o\
$(TOP)/src/debug/libpmem2/region_namespace_$(OS_DIMM).o\
$(TOP)/src/debug/libpmem2/numa_$(OS_DIMM).o

INCS += -I$(TOP)/src/common
endif
Expand Down
8 changes: 3 additions & 5 deletions src/test/pmem2_persist/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright 2019-2020, Intel Corporation
# Copyright 2019-2023, Intel Corporation

#
# src/test/pmem2_persist/Makefile -- build pmem2_persist unit test
Expand All @@ -18,13 +18,11 @@ OBJS += pmem2_persist.o\
persist.o\
memops_generic.o\
deep_flush_linux.o\
pmem2_utils_linux.o
pmem2_utils_linux.o\
region_namespace_$(OS_DIMM).o

ifeq ($(OS_DIMM),ndctl)
LINK_NDCTL=y
OBJS += region_namespace_ndctl.o
else
OBJS += region_namespace_none.o
endif

include ../Makefile.inc
9 changes: 2 additions & 7 deletions src/test/tools/extents/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,8 @@ vpath %.c $(TOP)/src/libpmem2
TARGET = extents
OBJS = extents.o\
pmem2_utils_linux.o\
pmem2_utils.o

ifeq ($(OS_DIMM),ndctl)
OBJS += region_namespace_ndctl.o
else
OBJS += region_namespace_none.o
endif
pmem2_utils.o\
region_namespace_$(OS_DIMM).o

OBJS += extent_linux.o

Expand Down

0 comments on commit eaa3fb6

Please sign in to comment.