A recursive make is inovked if in-source build is used but $(MAKE) is
the same as the one used in the original make invocaton.
Some platforms have preference to use gmake, or a make passed as an
option to "configure". Honor the choice.
Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
---
configure | 2 ++
1 file changed, 2 insertions(+)
diff --git a/configure b/configure
index 4e5fe33211..9e0d505067 100755
--- a/configure
+++ b/configure
@@ -38,6 +38,8 @@ then
# This file is auto-generated by configure to support in-source tree
# 'make' command invocation
+include build/config-host.mak
+
ifeq ($(MAKECMDGOALS),)
recurse: all
endif
--
2.28.0
On Sun, Aug 23, 2020 at 12:21:26AM +0300, Roman Bolshakov wrote: > A recursive make is inovked if in-source build is used but $(MAKE) is > the same as the one used in the original make invocaton. > > Some platforms have preference to use gmake, or a make passed as an > option to "configure". Honor the choice. > > Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com> > --- > configure | 2 ++ > 1 file changed, 2 insertions(+) Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Regards, Daniel -- |: https://berrange.com -o- https://www.flickr.com/photos/dberrange :| |: https://libvirt.org -o- https://fstop138.berrange.com :| |: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
On 8/22/20 4:21 PM, Roman Bolshakov wrote: > A recursive make is inovked if in-source build is used but $(MAKE) is > the same as the one used in the original make invocaton. > > Some platforms have preference to use gmake, or a make passed as an > option to "configure". Honor the choice. > > Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com> > --- > configure | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/configure b/configure > index 4e5fe33211..9e0d505067 100755 > --- a/configure > +++ b/configure > @@ -38,6 +38,8 @@ then > # This file is auto-generated by configure to support in-source tree > # 'make' command invocation > > +include build/config-host.mak Should this use '-include' (also spelled 'sinclude'), to avoid halting the build if build/config-host.mak doesn't exist for whatever reason? > + > ifeq ($(MAKECMDGOALS),) > recurse: all > endif > -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
On Mon, Aug 24, 2020 at 09:37:07AM -0500, Eric Blake wrote: > On 8/22/20 4:21 PM, Roman Bolshakov wrote: > > @@ -38,6 +38,8 @@ then > > # This file is auto-generated by configure to support in-source tree > > # 'make' command invocation > > +include build/config-host.mak > > Should this use '-include' (also spelled 'sinclude'), to avoid halting the > build if build/config-host.mak doesn't exist for whatever reason? > Sure I can do (and thanks for the noticed typos) but I tested that if the build is interrupted too early (before Makefile is symlinked to build directory but after GNUmakefile is created) it would fail even if -include is used: $ make changing dir to build for /Library/Developer/CommandLineTools/usr/bin/make ""... make[1]: Makefile: No such file or directory make[1]: *** No rule to make target `Makefile'. Stop. changing dir to build for /Library/Developer/CommandLineTools/usr/bin/make ""... make[1]: Makefile: No such file or directory make[1]: *** No rule to make target `Makefile'. Stop. make: *** [all] Error 2 I'm also curious why the switch happens twice... According to the debug trace, it tries to remake build/config-host.mak using the implicit force rule: GNUmakefile:12: update target 'build/config-host.mak' due to: force Then there should be an explicit empty rule for build/config-host.mak. I will send a fix for that in v2. Then it would fail like this: $ make changing dir to build for /Library/Developer/CommandLineTools/usr/bin/make ""... make[1]: Makefile: No such file or directory make[1]: *** No rule to make target `Makefile'. Stop. make: *** [all] Error 2 Regards, Roman > > + > > ifeq ($(MAKECMDGOALS),) > > recurse: all > > endif > > >
On Tue, Aug 25, 2020 at 01:07:55AM +0300, Roman Bolshakov wrote: > On Mon, Aug 24, 2020 at 09:37:07AM -0500, Eric Blake wrote: > > On 8/22/20 4:21 PM, Roman Bolshakov wrote: > > > @@ -38,6 +38,8 @@ then > > > # This file is auto-generated by configure to support in-source tree > > > # 'make' command invocation > > > +include build/config-host.mak > > > > Should this use '-include' (also spelled 'sinclude'), to avoid halting the > > build if build/config-host.mak doesn't exist for whatever reason? > > > > Sure I can do (and thanks for the noticed typos) but I tested that if > the build is interrupted too early (before Makefile is symlinked to > build directory but after GNUmakefile is created) it would fail even if > -include is used: > > $ make > changing dir to build for /Library/Developer/CommandLineTools/usr/bin/make ""... > make[1]: Makefile: No such file or directory > make[1]: *** No rule to make target `Makefile'. Stop. > changing dir to build for /Library/Developer/CommandLineTools/usr/bin/make ""... > make[1]: Makefile: No such file or directory > make[1]: *** No rule to make target `Makefile'. Stop. > make: *** [all] Error 2 > > I'm also curious why the switch happens twice... According to the debug > trace, it tries to remake build/config-host.mak using the implicit force > rule: > > GNUmakefile:12: update target 'build/config-host.mak' due to: force > > Then there should be an explicit empty rule for build/config-host.mak. I > will send a fix for that in v2. Then it would fail like this: > > $ make > changing dir to build for /Library/Developer/CommandLineTools/usr/bin/make ""... > make[1]: Makefile: No such file or directory > make[1]: *** No rule to make target `Makefile'. Stop. > make: *** [all] Error 2 > > > > + > > > ifeq ($(MAKECMDGOALS),) > > > recurse: all > > > endif > > > > > Hi Eric, What if we just print an error if build/config-host.mak can't be found? ifeq ($(wildcard build/config-host.mak),) $(error "Incomplete configuration. Please run ./configure") endif IMO this is more sane approach than proceeding with partially-configured not working build without a Makefile in proper place. Regards, Roman
On 8/25/20 5:16 AM, Roman Bolshakov wrote: > > Hi Eric, > > What if we just print an error if build/config-host.mak can't be found? > > ifeq ($(wildcard build/config-host.mak),) > $(error "Incomplete configuration. Please run ./configure") > endif > > IMO this is more sane approach than proceeding with partially-configured > not working build without a Makefile in proper place. Yes, that is definitely a better approach. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
On 8/22/20 4:21 PM, Roman Bolshakov wrote: > A recursive make is inovked if in-source build is used but $(MAKE) is invoked > the same as the one used in the original make invocaton. invocation > > Some platforms have preference to use gmake, or a make passed as an > option to "configure". Honor the choice. > > Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com> > --- > configure | 2 ++ > 1 file changed, 2 insertions(+) > -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org
© 2016 - 2026 Red Hat, Inc.