Re: [PATCH] Kbuild.include: addtree: Remove quotes before matching path

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

 



Hi Sam,


2017-04-04 5:20 GMT+09:00 Sam Ravnborg <sam@xxxxxxxxxxxx>:
> On Mon, Apr 03, 2017 at 03:25:10PM +0200, Michal Marek wrote:
>> On 2017-04-03 09:42, Masahiro Yamada wrote:
>> > Each Makefile knows it wants to see
>> > additional headers in the source tree, or objtree.
>> >
>> > I am guessing the right approach in a long run is,
>> > we require -I to specify $(srctree) or $(objtree) explicitly.
>> >
>> > ccflags-y := -I$(srctree)/foo/bar/baz
>> >
>> > or
>> >
>> > ccflags-y := -I$(objtree)/foo/bar/baz
>> >
>> >
>> > (For the latter, we can omit $(objtree)/ as it is ./)
>> >
>> >
>> > Then, delete $(call flags,_c_flags) after the conversion.
>>
>> Agreed. The addtree function is more of a hack to make things just work
>> with O=, but AFAIK there is no clean way to implement VPATH for -I
>> arguments. So it's sensible to get rid of the hack. It looks like it's
>> going to be lot of work though:
>>
>> $ git grep -e '-I' -- '*Makefile*' | wc -l
>> 732
>> $ git grep -e '-I *\$(\(src\|obj\)tree)' -- '*Makefile*' | wc -l
>> 166
>
> There was a goal long time ago that moving the kernel source should
> not trigger a rebuild.
> Any hardcoded path would violate this (like $(srctree), $(objtree))

Even if we avoid hard-coding $(srctree) in each Makefile,
"addtree" will modify the -I paths and the modified paths
will be recorded in .*.cmd files.


If we really want to achieve the goal,
my old patch seemed to have a point:
https://patchwork.kernel.org/patch/4511991/
This was rejected due to side effects, anyway.


-- 
Best Regards
Masahiro Yamada



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]