Skip to content

Fix makefile - avoid unnecessary rebuilds and other confusion#241

Open
cbryant203 wants to merge 2 commits into
usnistgov:masterfrom
cbryant203:master
Open

Fix makefile - avoid unnecessary rebuilds and other confusion#241
cbryant203 wants to merge 2 commits into
usnistgov:masterfrom
cbryant203:master

Conversation

@cbryant203

Copy link
Copy Markdown

The original Makefile used convenience names as targets (e.g. iid) which were not the names of outputs actually generated (iid generated an executable ea_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 iid would see that it existed (as a directory) and depended on non-existent iid_main.o so attempt to build that. Since the recipe for iid_main.o instead built ea_iid this had the effect of always building ea_iid. Then the recipe for building iid from ea_iid.o would run, but did nothing so was not visible.

This change expresses the actual dependencies and makes the convenience names .PHONY so make knows that they do not refer to files and any such files are to have no effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant