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 7:23 AM, Alviro Iskandar Setiawan wrote:
On Wed, Mar 9, 2022 at 6:06 AM Alviro Iskandar Setiawan wrote:
On Wed, Mar 9, 2022 at 5:52 AM Ammar Faizi wrote:
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?

Yes, I think it's better to do that. I'll fix this in v2.
thx

Sir, I am a bit confused with the include dependency files to the Makefile.

I use like this:

    -MT <object_filename> -MMD -MP -MF <dependency_file>

the dependency file is generated, but how to include them dynamically?
I think it shouldn't be included one by one.

So after this

    [...] -MT "setup.os" -MMD -MP -MF ".deps/setup.os.d" [...]
    [...] -MT "queue.os" -MMD -MP -MF ".deps/queue.os.d" [...]
    [...] -MT "register.os" -MMD -MP -MF ".deps/register.os.d" [...]
    [...] -MT "syscall.os" -MMD -MP -MF ".deps/syscall.os.d" [...]

files .deps/{setup,queue,registers,syscall}.os.d are generated, but I
have to include them to Makefile right? How to include them all at
once?

Untested, but I think you can do something like:

  -include $(liburing_objs:%=.deps/%.d)

where liburing_objs is the variable that contains:
{setup,queue,registers,syscall}.os.

--
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