public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Cao jin <caoj.fnst@cn.fujitsu.com>,
	Michal Marek <mmarek@suse.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>
Subject: Re: special handle of scripts/kconfig/zconf.tab.o
Date: Sat, 19 Aug 2017 16:54:41 +0200	[thread overview]
Message-ID: <20170819145441.GA5940@ravnborg.org> (raw)
In-Reply-To: <CAK7LNATGwrMBsaps1oVOi_21R8jzTadeWSwaK1dA8nMaJs7KpQ@mail.gmail.com>

Hi Masahiro

On Sat, Aug 19, 2017 at 09:42:40PM +0900, Masahiro Yamada wrote:
> Hi.
> (+CC Sam)
> 
> 2017-08-15 20:02 GMT+09:00 Cao jin <caoj.fnst@cn.fujitsu.com>:
> > Masahiro-san,
> >
> > I have a question about make *config. In scripts/kconfig/Makefile, there
> > is following statement:
> >
> > $(obj)/zconf.tab.o: $(obj)/zconf.lex.c $(obj)/zconf.hash.c
> >
> > and the $(obj)/zconf.{tab,hash,lex}.c match the rule in Makefile.lib:
> >
> > $(obj)/%: $(src)/%_shipped
> >         $(call cmd,shipped)
> >
> > and cmd_shipped just transform the _shipped file to .c via `cat`.
> >
> > And zconf.tab.c includes several *other* .c files which make the whole
> > process a little obscure, because there are not corresponding .o files
> > for the *other* .c files.
> >
> > My questions is: Does this special handling has other meanings that I
> > may miss? Or just legacy.
> 
> 
> This convention had existed before I joined the kernel development,
> so I am not sure about the historical background.
> 
> The following is my understanding.
> (I hope Sam and Michal will correct me if I am wrong.)
> 
> 
> The difference between with/without _shipped is,
> zconf.{tab,hash,lex}.c_shipped reside under $(srctree),
> whereas zconf.{tab,hash,lex}.c under $(objtree).

The whole idea behind the *_shipped file was to have less dependencies
on the host system buildign the kernel.
So we did not rely on users having all of flex, bison, gperf
installed in the right versions.

So this is all about less dependencies on the build host,
and we did not back then consider so much $(srctree) versus $(objtree).
I think that support for _shipped predates when we added support for
"make O=..." - but I may be wrong - did not check the history.

I recall we have had to updated support for _shipped a few times
due to some smaller issues, and maybe we never got around to actually
document this in Documentation/kbuild/

	Sam

  reply	other threads:[~2017-08-19 14:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-15 11:02 special handle of scripts/kconfig/zconf.tab.o Cao jin
2017-08-19 12:42 ` Masahiro Yamada
2017-08-19 14:54   ` Sam Ravnborg [this message]
2017-08-19 15:01     ` Sam Ravnborg
2017-08-21  3:36   ` Cao jin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170819145441.GA5940@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=caoj.fnst@cn.fujitsu.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.com \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox