Matlab buildfile MEX
Matlab buildtool has become a capable build system for tasks including MEX targets and tests with incremental progress, which avoids the need rerun already completed tasks. A standalone buildtool example illustrates the basic use of Matlab buildtool.
Run the build and test tasks:
buildtool mex
buildtool test
See several additional examples of more advanced Mex and Matlab Engine tasks. Matlab-stdlib is another substantial example of buildfile.m usage.