Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefiles: Remove abuses of FORCE and .PHONY #9631

Closed
2 of 3 tasks
jcarrano opened this issue Jul 25, 2018 · 8 comments
Closed
2 of 3 tasks

Makefiles: Remove abuses of FORCE and .PHONY #9631

jcarrano opened this issue Jul 25, 2018 · 8 comments
Labels
Area: build system Area: Build system State: stale State: The issue / PR has no activity for >185 days Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation

Comments

@jcarrano
Copy link
Contributor

jcarrano commented Jul 25, 2018

Description

What

FORCE and .PHONY targets are being abused in RIOT's makefile. For example:

$(ELFFILE): FORCE

$(BINDIR)/$(APPLICATION_MODULE).a: FORCE

.PHONY: pkg-prepare $(USEPKG:%=$(BINDIR)/%.a)

Why

This is incorrect. It triggers unnecessary rebuilds and may hide problems with the makefiles.

How to solve it.

Targets should depend on their prerequisites only. To solve this:

@jcarrano jcarrano added Area: build system Area: Build system Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation labels Jul 25, 2018
@cladmi
Copy link
Contributor

cladmi commented Jul 25, 2018

I would still say, more important than not rebuilding for nothing, which "only" wastes time, we are currently not rebuilding when necessary #9589 for example which makes the build invalid if you do not do make clean all.

But of course both are somehow linked together.

@jcarrano
Copy link
Contributor Author

@cladmi Of course they are linked. One can say that building too much is the lesser evil, but we should resist the temptation to work around our "too little built" issues by being overly conservative and forcing things to be build.

@jcarrano
Copy link
Contributor Author

Recursive use of make only complicates matters, see Recursive Make Considered Harmful.
The rule that runs the recursive make has to be forced, because there's no way for the outer make to know things have not been modified.

@cladmi
Copy link
Contributor

cladmi commented Jul 25, 2018

I know ;) #1242 #7670

@stale
Copy link

stale bot commented Aug 10, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.

@stale stale bot added State: stale State: The issue / PR has no activity for >185 days and removed State: stale State: The issue / PR has no activity for >185 days labels Aug 10, 2019
@jcarrano jcarrano added the State: stale State: The issue / PR has no activity for >185 days label Aug 12, 2019
@stale stale bot closed this as completed Sep 12, 2019
@cladmi
Copy link
Contributor

cladmi commented Sep 12, 2019

This is still valid and is in pre-cleaning steps in #10850

@miri64 miri64 reopened this Sep 12, 2019
@stale stale bot removed the State: stale State: The issue / PR has no activity for >185 days label Sep 12, 2019
@stale
Copy link

stale bot commented Mar 15, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.

@stale stale bot added the State: stale State: The issue / PR has no activity for >185 days label Mar 15, 2020
@miri64 miri64 removed the State: stale State: The issue / PR has no activity for >185 days label Mar 15, 2020
@stale
Copy link

stale bot commented Sep 17, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.

@stale stale bot added the State: stale State: The issue / PR has no activity for >185 days label Sep 17, 2020
@stale stale bot closed this as completed Oct 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: build system Area: Build system State: stale State: The issue / PR has no activity for >185 days Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation
Projects
None yet
Development

No branches or pull requests

3 participants