Re: [PATCH liburing 2/2] src/Makefile: Add header files as dependency

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/9/22 5:40 AM, Alviro Iskandar Setiawan wrote:
When the header files are modified, the compiled object are not going
to be recompiled because the header files are not marked as dependency
for the objects. Add those header files as dependency so it is safe
not to do "make clean" after changing those files.

Signed-off-by: Alviro Iskandar Setiawan <alviro.iskandar@xxxxxxxxxxx>
---
  src/Makefile | 15 ++++++++++-----
  1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/Makefile b/src/Makefile
index f19d45e..b9428b7 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -46,9 +46,16 @@ endif
  liburing_objs := $(patsubst %.c,%.ol,$(liburing_srcs))
  liburing_sobjs := $(patsubst %.c,%.os,$(liburing_srcs))
-$(liburing_srcs): syscall.h lib.h
-
-$(liburing_objs) $(liburing_sobjs): include/liburing/io_uring.h
+$(liburing_objs) $(liburing_sobjs): \
+	syscall.h \
+	lib.h \
+	arch/syscall-defs.h \
+	arch/x86/syscall.h \
+	arch/x86/lib.h \
+	arch/aarch64/syscall.h \
+	arch/generic/syscall.h \
+	arch/generic/lib.h \
+	include/liburing/io_uring.h

This is ugly, it blindly adds all of them to the dependency while
they're actually not dependencies for all the C files here. For
example, when compiling for x86, we don't touch aarch64 files.

It is not a problem for liburing at the moment, because we don't
have many files in the src directory now. But I think we better
provide a long term solution on this.

For the headers files, I think we should rely on the compilers to
generate the dependency list with something like:

   "-MT ... -MMD -MP -MF"

Then include the generated dependency list to the Makefile.

What do you think?

--
Ammar Faizi




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux