Fix makefile - avoid unnecessary rebuilds and other confusion#241
Open
cbryant203 wants to merge 2 commits into
Open
Fix makefile - avoid unnecessary rebuilds and other confusion#241cbryant203 wants to merge 2 commits into
cbryant203 wants to merge 2 commits into
Conversation
…always rebuilding or being fooled by files of that name
…confused by files of those names
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The original Makefile used convenience names as targets (e.g. iid) which were not the names of outputs actually generated (
iidgenerated an executableea_iid). This meant that make would always rebuild these targets as the build recipe would never create the target.This would also have been vulnerable to being broken if a file was present whose name was that of a convenience target (and a few had directories with their names), but this didn't happen because the dependencies used intermediate object files that were never actually created, so building
iidwould see that it existed (as a directory) and depended on non-existentiid_main.oso attempt to build that. Since the recipe foriid_main.oinstead builtea_iidthis had the effect of always buildingea_iid. Then the recipe for buildingiidfromea_iid.owould run, but did nothing so was not visible.This change expresses the actual dependencies and makes the convenience names
.PHONYso make knows that they do not refer to files and any such files are to have no effect.