Re: [RFC 1/3] kbuild: add support for ensuring headers are self-contained
From: Masahiro Yamada
Date: Mon Jun 03 2019 - 20:25:53 EST
Hi Sam, Jani,
On Tue, Jun 4, 2019 at 2:33 AM Sam Ravnborg <sam@xxxxxxxxxxxx> wrote:
>
> Hi Masahiro/Jani.
>
> >
> > Following the obj-y pattern,
> > I want to make header-test-y relative to $(obj).
>
> I also considered this and agree this is better.
>
> Otherwise we end up with a spaghetti of dependencies across the tree.
>
> What I made just fit the purpose I had that day,
> which is no excuse for bad design.
>
> > I prefer this:
> >
> > quiet_cmd_header_test = HDRTEST $@
> > cmd_header_test = echo "\#include \"$*.h\"" > $@
> >
> > $(obj)/%.header_test.c:
> > $(call cmd,header_test)
>
> Even better - good.
>
> We call it HDRTEST - so why not just go for that name:
>
> hdrtest-y += headerfile.h
>
> ??
>
> The current proposal with "header-test-y" hurts the eye a little with
> two '-', and all other variables uses only one '-' as is today.
> (generic-y, obj-y etc).
>
> This is bikeshedding but is was itcing me a little.
I do not have a strong opinion.
I leave it to Jani. Either is fine with me.
There are variables that contain two '-'.
'no-clean-files', 'subdir-ccflags-y', etc.
--
Best Regards
Masahiro Yamada