Makefile: separate meson rerun from the rest of the ninja invocation
authorPaolo Bonzini <pbonzini@redhat.com>
Fri, 23 Oct 2020 12:34:54 +0000 (08:34 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 26 Oct 2020 11:08:37 +0000 (07:08 -0400)
commit5914ef77cc1bd4c3d79ccd3e3f82f34604275b93
tree93766c55d00fc282f7731a6ba9ece818379d582d
parent7239c050e81ad4aad282f8d43848c14b3956838a
Makefile: separate meson rerun from the rest of the ninja invocation

The rules to build Makefile.mtest are suffering from the "tunnel vision"
problem that is common with recursive makefiles.  Makefile.mtest depends
on build.ninja, but Make does not know when build.ninja needs to be
rebuilt before creating Makefile.mtest.

To fix this, separate the ninja invocation into the "regenerate build
files" phase and the QEMU build phase.  Sentinel files such as
meson-private/coredata.dat or build.ninja are used to figure out the
phases that haven't run yet; however, because those files' timestamps
are not guaranteed to be touched, the usual makefile stamp-file trick
is used on top.

Reported-by: Havard Skinnemoen <hskinnemoen@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Makefile