Skip to content

cpu/make: added global Makefile.periph#5065

Closed
haukepetersen wants to merge 10 commits intoRIOT-OS:masterfrom
haukepetersen:opt_periph_makimaki
Closed

cpu/make: added global Makefile.periph#5065
haukepetersen wants to merge 10 commits intoRIOT-OS:masterfrom
haukepetersen:opt_periph_makimaki

Conversation

@haukepetersen
Copy link
Copy Markdown
Contributor

So far, every c file in RIOTBASE/CPU/periph/*.c is build. This leads to some not very nice use of file guards around full c files.

This PR improves the situation, as now only the peripherals, that are configured by the board (using the FEATURES_PROVIDED var) are actually compiled. This prevents us from having to configure certain peripherals for each board that uses a certain CPU, and from using those anti-pattern file guards.

This PR is a somewhat simplified and limited version of #3420.

@haukepetersen haukepetersen added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Area: build system Area: Build system Impact: major The PR changes a significant part of the code base. It should be reviewed carefully labels Mar 14, 2016
@haukepetersen haukepetersen added this to the Release 2016.04 milestone Mar 14, 2016
@haukepetersen haukepetersen added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Mar 14, 2016
@jnohlgard
Copy link
Copy Markdown
Member

What do you think about using the wildcard Makefile function in another way?

# get a list with the peripherals, that are configured by the board
WANT = $(patsubst periph_%,%*.c,$(filter periph_%,$(FEATURES_PROVIDED)))
# only compile the peripheral drivers, that are present and configured
SRC += $(wildcard $(WANT))

This would make a list of all wanted periph drivers just as before, but matching filenames against a wildcard pattern instead.
That would cover the kinetis hwrng special case as well.

FEATURES_PROVIDED=periph_uart periph_gpio periph_hwrng
would translate into:
SRC += $(wildcard uart*.c gpio*.c hwrng*.c)

@haukepetersen
Copy link
Copy Markdown
Contributor Author

That would do, but I think it defeats the purpose. Let's take the hwrng issue for the kinetis: I think the goal here is actually not to build all hwrng_*.c files, but in the mit-term to only build the one specific file that is actually wanted. This way we can get rid of the #ifdef KINETIS_RNGA guards all together.

@haukepetersen haukepetersen added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Mar 15, 2016
@OlegHahm OlegHahm modified the milestone: Release 2016.04 Mar 17, 2016
@haukepetersen
Copy link
Copy Markdown
Contributor Author

@gebart ping

@jnohlgard
Copy link
Copy Markdown
Member

I don't have any good ideas for the hwrng_* files on Kinetis... I propose we merge this as-is and open an issue for getting rid of the whole-file ifdefs as a reminder. What do you think?

@jnohlgard jnohlgard added this to the Release 2016.04 milestone Mar 18, 2016
@haukepetersen
Copy link
Copy Markdown
Contributor Author

Sounds good to me.

@jnohlgard
Copy link
Copy Markdown
Member

something is messed up, see CI logs, lots of periph tests are failing.

@haukepetersen
Copy link
Copy Markdown
Contributor Author

I had this once before locally (but I can not explain it): it seems to me the Makefile.buildtest fucks up, it tries to build tests for boards, that do not provide the required features (e.g. CPUID for avsextrem). I failed more than once before in understanding and adapting the Makefile.buildtest, so no idea how to fix this.

@haukepetersen
Copy link
Copy Markdown
Contributor Author

Also I have no idea why this behavior is caused by this PR, where it should actually be quite unrelated?!

@haukepetersen haukepetersen added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Mar 21, 2016
@haukepetersen
Copy link
Copy Markdown
Contributor Author

Just out of curiosity: restarted the build-test to see if the result is reproducible.

@haukepetersen
Copy link
Copy Markdown
Contributor Author

I think I found the reason: by exporting the FEATURES_PROVIDED variable in Makefile.vars we somehow break the Makefile.buildtest. But this file I tried to understand 100 times and always failed...

@Kijewski: can you help out here and tell me out to make this work?

@haukepetersen
Copy link
Copy Markdown
Contributor Author

won't make it for this release, so postponing it.

@haukepetersen haukepetersen modified the milestones: Release 2016.07, Release 2016.04 Mar 29, 2016
@jnohlgard
Copy link
Copy Markdown
Member

I guess we can postpone this another release

@jnohlgard jnohlgard added this to the Release 2016.10 milestone Jul 12, 2016
@haukepetersen haukepetersen added State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Mar 22, 2017
@haukepetersen
Copy link
Copy Markdown
Contributor Author

tried another path, but still not working. @kaspar030 feel free to take over...

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Apr 6, 2017

Needs rebase since #4699 was merged.

@haukepetersen
Copy link
Copy Markdown
Contributor Author

I won't - as stated above, I can't find a solution that works to this topic, so others need to take over...

@PeterKietzmann
Copy link
Copy Markdown
Member

Let's close it as nobody is working on it?

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Jun 20, 2017

ping what should we do here ?

@haukepetersen
Copy link
Copy Markdown
Contributor Author

Thats the question :-)

This topic is getting more and more pressing and needs to be solved ASAP with high priority, but for this somebody needs an idea how to do this... So would like to leave the PR open until something new is PRed so we keep this on our minds.

@haukepetersen
Copy link
Copy Markdown
Contributor Author

This PR is superseded by #7241. But I leave it open for now as this PR contains some changes that need to be moved into #7241...

@haukepetersen
Copy link
Copy Markdown
Contributor Author

closed in favor of #7241

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 Impact: major The PR changes a significant part of the code base. It should be reviewed carefully State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants