The intention is to batch all container invocations instead of
instanciating one for every rule that needs to run within a container.
This keeps track of build dependencies using a .any-build timestamp file
and define a CONTAINER=1 variable when make is running within the
container.
When running within the container, only "configure" and "build" targets
are active, all the other targets are no-op. When make is run outside
of the container, it's the opposite, except for the "build" targets
which all depend on this .any-build timestamp file to trigger the
container build execution.
The targets dependency graph is still complete, so "source" targets
will always all be executed before the container, and configure steps
will optionally run if the generated files are missing. When source
change is detected, only the build rules are executed again, trusting
each build system to decide if configure should be run again or not.
* Make it more flexible on the image name,
* Remove the image type support, only Docker is likely to be supported.
* Add target runtime name (scout / soldier), independent of the image.
The ccache symlinks dir may differ (Arch and Debian disagree, for
example), and this allows us to use ccache for mingw-w64 within the
runtime container.
We need access to linux crt functions (like getenv()), so disallow use
of msvcrt. Notably, linux crt wchar functions are _not_ compatible with
Windows WCHAR strings.
"ENV=VAR ./configure" is different from "./configure ENV=VAR".
The latter caches command line variables in config.status.
So "config.status --recheck" succeeds executing configure script
Otherwise, "config.status --recheck" often fails when only source
is updated because some variables are not cached. Examples include
being not able to find bison or vkd3d.h when they are obviously present,
which are because of missing BISON and VKD3D_CFLAGS variables.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>