Allow user-defined Makefile to optimize compiling #355
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Our project has about 100 application source files and 50 test files. When I repeatedly run the tests (with no changes) on my local machine they take about 3-1/2 minutes. About half of that time is spent determining what files to compile and what include directories to use and the other half of that time is spent doing the compiling (one file at a time).
When (re)building a large project programmers typically use a tool like
make
to keep track of dependencies and avoid recompiling files that have not changed. Of course, there is a cost to maintaining theMakefile
but it is typically worth it.With this change we allow the user to provide a
Makefile
that considerably shortens the process (my project takes 10 seconds to rerun all tests if there are no changes; 15 seconds if there is a change to one test file; and 25 seconds if there is a change to an application file).If the user does not provide a
Makefile
then the prior behavior is preserved. Note that this is disabled on Windows (I don't know enough about the build environment; does it supportg++
?).