This PR rewrites the build system to better track dependencies.
It takes a slightly odd approach, using two separate Makefiles to orchestrate the process.
The outer Makefile (Makefile in the repo) arranges the source files into _build and copies the inner Makefile (mk_recipes/buildInplace.mk) to _build/Makefile which is then invoked by the targets in mk_recipes/buildManagement.mk (I will happily take suggestions on renaming these files!).
The buildManagement.mk file handles the multi-stage build (i.e. building a new corepop, building the 3 different flavours, building the commander). The inner makefile (mk_recipes/buildInplace.mk) handles a build from start to finish and tracks dependencies correctly. The outer makefile still makes use of proxy files to handle ordering.
A few notable changes:
The Makefiles now use .ONESHELL: which means that all lines of a recipe are executed in the same shell. This is much more useful than the default behaviour.
The shell has been switched from /bin/sh to /bin/bash.
I've enabled -e and -o pipefail for the shell to better catch errors.
This PR rewrites the build system to better track dependencies. It takes a slightly odd approach, using two separate Makefiles to orchestrate the process. The outer Makefile (
Makefile
in the repo) arranges the source files into_build
and copies the inner Makefile (mk_recipes/buildInplace.mk
) to_build/Makefile
which is then invoked by the targets inmk_recipes/buildManagement.mk
(I will happily take suggestions on renaming these files!). ThebuildManagement.mk
file handles the multi-stage build (i.e. building a new corepop, building the 3 different flavours, building the commander). The inner makefile (mk_recipes/buildInplace.mk
) handles a build from start to finish and tracks dependencies correctly. The outer makefile still makes use of proxy files to handle ordering.A few notable changes:
.ONESHELL:
which means that all lines of a recipe are executed in the same shell. This is much more useful than the default behaviour.-e
and-o pipefail
for the shell to better catch errors.