Skip to content

Commit 1f77679

Browse files
santoshsdjbw
authored andcommitted
tools/test/nvdimm: Fix out of tree build
Out of tree build using make M=tools/test/nvdimm O=/tmp/build -C /tmp/build fails with the following error make: Entering directory '/tmp/build' CC [M] tools/testing/nvdimm/test/nfit.o linux/tools/testing/nvdimm/test/nfit.c:19:10: fatal error: nd-core.h: No such file or directory 19 | #include <nd-core.h> | ^~~~~~~~~~~ compilation terminated. That is because the kbuild file uses $(src) which points to tools/testing/nvdimm, $(srctree) correctly points to root of the linux source tree. Reported-by: Aneesh Kumar K.V <[email protected]> Signed-off-by: Santosh Sivaraj <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dan Williams <[email protected]>
1 parent f84afbd commit 1f77679

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tools/testing/nvdimm/Kbuild

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ DRIVERS := ../../../drivers
2121
NVDIMM_SRC := $(DRIVERS)/nvdimm
2222
ACPI_SRC := $(DRIVERS)/acpi/nfit
2323
DAX_SRC := $(DRIVERS)/dax
24-
ccflags-y := -I$(src)/$(NVDIMM_SRC)/
25-
ccflags-y += -I$(src)/$(ACPI_SRC)/
24+
ccflags-y := -I$(srctree)/drivers/nvdimm/
25+
ccflags-y += -I$(srctree)/drivers/acpi/nfit/
2626

2727
obj-$(CONFIG_LIBNVDIMM) += libnvdimm.o
2828
obj-$(CONFIG_BLK_DEV_PMEM) += nd_pmem.o

tools/testing/nvdimm/test/Kbuild

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SPDX-License-Identifier: GPL-2.0
2-
ccflags-y := -I$(src)/../../../../drivers/nvdimm/
3-
ccflags-y += -I$(src)/../../../../drivers/acpi/nfit/
2+
ccflags-y := -I$(srctree)/drivers/nvdimm/
3+
ccflags-y += -I$(srctree)/drivers/acpi/nfit/
44

55
obj-m += nfit_test.o
66
obj-m += nfit_test_iomap.o

0 commit comments

Comments
 (0)