On Fri, 18 Aug 2023 16:33:19 +0200
Olaf Hering <o...@aepfle.de> wrote:

> Thu, 17 Aug 2023 15:21:44 -0500 Glenn Washburn <developm...@efficientek.com>:
> 
> > On Thu, 17 Aug 2023 11:00:44 +0200
> > Olaf Hering <o...@aepfle.de> wrote:
> > > It is the result of my attempt to build just the required binaries, 
> > > without docs.
> > > I came up with this:
> > >   git clean -dffx
> > >   bash bootstrap
> > >   mkdir .b
> > >   cd .b
> > >   ../configure [options]
> > >   make check
> > >   make -C grub-core install-platformDATA install-platformPROGRAMS  
> > And this avoids the compile error for startup_raw.S?
> 
> No, the other way around: this triggers it. Previously I had a simple 'make',
> followed by the install targets shown above. This builds all dependencies,
> and also the doc target. To get rid of the doc target, I was under the
> assumption that install-something already has proper dependencies, but only
> a subset is built. gnulib.a was missing, and likely others. I did not dig 
> deep.
>  
> > > But thinking further about it, and as others have noted, the real fix 
> > > would
> > > be to wade through all targets and express their dependencies properly.  
> > 
> > What version of automake are you using? I'm on 1.16.3-2 from Debian 11.
> > rs_decoder.h is ending up in BUILT_SOURCES, so it should get built
> > before anything is compiled. Can you check ,? For me
> > rs_decoder.h is included via a few levels of variable expansion, so it
> > won't be literally in the definition of BUILT_SOURCES. I'm wondering if
> > maybe you're using an older version of automake with a bug.
> 
> I have seen it with automake 1.15.1 and 1.16.5. 
> "nodist_lzma_decompress_image_SOURCES" should be part of "BUILT_SOURCES",
> via "am__append_6232". But another local build, without this change, does
> indeed fail. The 'check' target does have "BUILT_SOURCES" as dependency,
> not sure why it does not build the target.
> 
> With some debug, the content during 'make check' is just:
> BUILT_SOURCES grub_fstest_init.c grub_script.tab.c grub_script.tab.h 
> grub_script.yy.c grub_script.yy.h libgrub_a_init.c
> 
> And the real reason is an incorrect invocation of make:
> 'make check' works in the toplevel, while 'make -C grub-core 
> install-something'
> works in the given directory. So for me the fix (to avoid the docs target) is:
>   make check
>   make -C grub-core check
>   make -C grub-core install-platformDATA install-platformPROGRAMS
> 
> Sorry for the noise.

Ok, I see now the issue. "A source file listed in BUILT_SOURCES is made
when ‘make all’, ‘make check’, ‘make install’, ‘make install-exec’ (or
make dist) is run, before other targets are processed"[1]. This is why
the previous was failing and this one now works (ie. make check uses
BUILT_SOURCES while the other targets do not).

Glenn

[1] https://www.gnu.org/software/automake/manual/html_node/Sources.html

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to