Skip to contentSkip to conversation

ocfs2: Improve ocfs2 Makefile

PATCH New Larry Chen 1 participant 1 message Nov 8, 2018 OCFS2

lore
Share & tools
lore

Larry Chen

author
#0 lore raw

PATCH 1/1 ocfs2: Improve ocfs2 Makefile

Included file path was fixed in ocfs2 makefile, which might causes some confusion when compiling ocfs2 as an external module.

Say if we compile ocfs2 module as following.
cp -r /kernel/tree/fs/ocfs2 /other/dir/ocfs2
cd /other/dir/ocfs2
make -C /path/to/kernel_source M=pwd modules

Acutally, the compiler wil try to find included file in /kernel/tree/fs/ocfs2, rather than the directory /other/dir/ocfs2.

To fix this little bug, we introduce the var $(src) provided by kbuild. $(src) means the absolute path of the running kbuild file.

---
 fs/ocfs2/Makefile       | 2 +-
 fs/ocfs2/dlm/Makefile   | 2 +-
 fs/ocfs2/dlmfs/Makefile | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
fs/ocfs2/Makefile +1 -1
index 99ee093182cb..cc9b32b9db7c 100644
@@ -1,5 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
-ccflags-y := -Ifs/ocfs2
+ccflags-y := -I$(src)
 
 obj-$(CONFIG_OCFS2_FS) += 	\
 	ocfs2.o			\
fs/ocfs2/dlm/Makefile +1 -1
index bd1aab1f49a4..ef2854422a6e 100644
@@ -1,4 +1,4 @@
-ccflags-y := -Ifs/ocfs2
+ccflags-y := -I$(src)/..
 
 obj-$(CONFIG_OCFS2_FS_O2CB) += ocfs2_dlm.o
 
fs/ocfs2/dlmfs/Makefile +1 -1
index eed3db8c5b49..33431a0296a3 100644
@@ -1,4 +1,4 @@
-ccflags-y := -Ifs/ocfs2
+ccflags-y := -I$(src)/..
 
 obj-$(CONFIG_OCFS2_FS) += ocfs2_dlmfs.o
 
Signature · 1 line
2.16.4