]> Git Repo - linux.git/commitdiff
tools/test/nvdimm: Fix out of tree build
authorSantosh Sivaraj <[email protected]>
Tue, 14 Jan 2020 05:40:51 +0000 (11:10 +0530)
committerDan Williams <[email protected]>
Tue, 31 Mar 2020 21:12:32 +0000 (14:12 -0700)
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]>
tools/testing/nvdimm/Kbuild
tools/testing/nvdimm/test/Kbuild

index dbebf05f5931337adcdfdfe25bd31c261ed14b07..47f9cc9dcd94b560e7f520d0f56f1284840c535c 100644 (file)
@@ -21,8 +21,8 @@ DRIVERS := ../../../drivers
 NVDIMM_SRC := $(DRIVERS)/nvdimm
 ACPI_SRC := $(DRIVERS)/acpi/nfit
 DAX_SRC := $(DRIVERS)/dax
-ccflags-y := -I$(src)/$(NVDIMM_SRC)/
-ccflags-y += -I$(src)/$(ACPI_SRC)/
+ccflags-y := -I$(srctree)/drivers/nvdimm/
+ccflags-y += -I$(srctree)/drivers/acpi/nfit/
 
 obj-$(CONFIG_LIBNVDIMM) += libnvdimm.o
 obj-$(CONFIG_BLK_DEV_PMEM) += nd_pmem.o
index fb3c3d7cdb9bd19723885c3fc5f882f49524a298..75baebf8f4ba17c2aa3f34f9742668b174116d53 100644 (file)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
-ccflags-y := -I$(src)/../../../../drivers/nvdimm/
-ccflags-y += -I$(src)/../../../../drivers/acpi/nfit/
+ccflags-y := -I$(srctree)/drivers/nvdimm/
+ccflags-y += -I$(srctree)/drivers/acpi/nfit/
 
 obj-m += nfit_test.o
 obj-m += nfit_test_iomap.o
This page took 0.058784 seconds and 4 git commands to generate.