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

Makefile.features: location is not relevant for all features #2967

Closed
biboc opened this issue May 11, 2015 · 13 comments
Closed

Makefile.features: location is not relevant for all features #2967

biboc opened this issue May 11, 2015 · 13 comments
Assignees
Labels
Area: build system Area: Build system Discussion: RFC The issue/PR is used as a discussion starting point about the item of the issue/PR

Comments

@biboc
Copy link
Member

biboc commented May 11, 2015

In #2918, we've observed that the features written in board/XXX/Makefile.features is not always related to the board but mainly to the cpu.
I think that two Makefile.features should exist. For instance, boards/samr21-xpro/Makefile.features and cpu/samd21/Makefile.features

Most of those features (below) depends on the cpu and not the board.
FEATURES_PROVIDED += transceiver
FEATURES_PROVIDED += periph_gpio
FEATURES_PROVIDED += periph_spi
FEATURES_PROVIDED += cpp
FEATURES_PROVIDED += periph_timer
FEATURES_PROVIDED += periph_uart
FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_rtc
FEATURES_PROVIDED += periph_rtt
FEATURES_PROVIDED += periph_cpuid
FEATURES_MCU_GROUP = cortex_m0

Then, FEATURES_CONFLICT will be added in one of the two files according to the reason of the conflict.

@biboc biboc changed the title Makefile.features Makefile.features: location is not relevant for all features May 11, 2015
@Kijewski
Copy link
Contributor

Makefile.buildtests:225 and Makefile.include:287 are the relevant lines that pull in $(RIOTBOARD)/$(BOARD)/Makefile.features. 👍 for adding $(RIOTCPU)/$(CPU)/Makefile.features.

@OlegHahm OlegHahm added Area: build system Area: Build system Discussion: RFC The issue/PR is used as a discussion starting point about the item of the issue/PR labels May 11, 2015
@biboc
Copy link
Member Author

biboc commented May 12, 2015

Ok great! :-)

@biboc biboc closed this as completed May 12, 2015
@Kijewski
Copy link
Contributor

I found a problem with this solution: In Makefile.buildtests we don't know the CPU of a BOARD. So the BOARD's Makefile.features would need to CPU's Makefile.features. Does someone see a problem with that solution?

@Kijewski Kijewski reopened this May 12, 2015
@biboc
Copy link
Member Author

biboc commented May 20, 2015

@Kijewski, I didn't get your solution. Could you provide an example please?

@OlegHahm OlegHahm modified the milestone: Release 2015.09 Sep 3, 2015
@OlegHahm
Copy link
Member

OlegHahm commented Sep 3, 2015

@Kijewski, ping!

@OlegHahm OlegHahm modified the milestones: Release 2015.09, Release NEXT MAJOR Oct 22, 2015
@OlegHahm OlegHahm removed this from the Release 2015.12 milestone Dec 2, 2015
@cgundogan
Copy link
Member

@Kijewski ping ping

@Kijewski
Copy link
Contributor

Kijewski commented Jan 5, 2016

Pong, pong, pong.

boards/msba2/Makefile.features imports boards/msba2-common/Makefile.features imports boards/msba2-common/Makefile.features import cpu/lpc2387/Makefile.features import cpu/arm7_common/Makefile.features.

Rationale: Makefile.buildtests does not know MSB-A2's CPU.

@kYc0o
Copy link
Contributor

kYc0o commented Aug 4, 2016

@Kijewski any news?

@miri64
Copy link
Member

miri64 commented Oct 13, 2016

Why was this marked as a known issue. Doesn't seem like a bug to me...

@pyropeter
Copy link
Contributor

While working on #6162 (Rust support) we stumbled upon this issue. The solution provided by @Kijewski seems to be reasonable.

We tried to add a feature-flag for Rust support. Since the support depends on the cpu architecture, we added FEATURES_PROVIDED += rust_support to cpu/native/Makefile.features (and others). This works fine regarding the unsupported feature warning displayed when building code for an unsupported board. But this does not work as expected as far as the info-boards-supported target is concerned. As @Kijewski explained, this is caused by the board_missing_features function in Makefile.buildtests. It does not include cpu/$cpu/Makefile.features. This is not easy to fix because the CPU of a certain board is not known in that function.

@pyropeter
Copy link
Contributor

Hello?

@kaspar030
Copy link
Contributor

kaspar030 commented Mar 23, 2017

Doesn't seem like a bug to me...

This is a bug, because edit a cpu's edit Makefile.features is currently not considered for "make info-boards-supported".
This doesn't manifest, as all Makefile.features within boards only define periph_pm, which is currently not correctly used anywhere.

@kaspar030
Copy link
Contributor

Fixed by #7880.

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 Discussion: RFC The issue/PR is used as a discussion starting point about the item of the issue/PR
Projects
None yet
Development

No branches or pull requests

8 participants