Skip to content

make: use submodules for periph#7241

Merged
haukepetersen merged 18 commits intoRIOT-OS:masterfrom
kaspar030:make_periph_use_submodules
Nov 6, 2017
Merged

make: use submodules for periph#7241
haukepetersen merged 18 commits intoRIOT-OS:masterfrom
kaspar030:make_periph_use_submodules

Conversation

@kaspar030
Copy link
Copy Markdown
Contributor

@kaspar030 kaspar030 commented Jun 26, 2017

Currently, all available periph *.c files for a given platform are always compiled, ignorant of them actually being used. A linker quirk (see #5757) takes care of sorting out unneeded ISR's (which have a weak default), which is more than hacky. Also, guards within the files (#if RTC_NUMOF ...) cut out not needed code.

This PR makes individual periph drivers (e.g., gpio, uart...) submodules of "periph". It also turns every periph feature that is either required or optional and available into a module dependency (e.g., FEATURE_REQUIRED += periph_i2c will result in USEMODULE += periph_i2c), in order to select the necessary modules.

This is WIP because:

- it breaks buildtest (even more), as buildtest doesn't take into account any required features defined as module dependencies (fixed by #7589)

- most drivers / modules / boards don't specify their required features (This PR works fine, the dependencies are a dependency PR)

- depends on #7589. (merged)

Waiting for #7880, #7772, #7773.

@kaspar030 kaspar030 added Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation Area: drivers Area: Device drivers Area: build system Area: Build system State: WIP State: The PR is still work-in-progress and its code is not in its final presentable form yet labels Jun 26, 2017
@kaspar030 kaspar030 requested a review from haukepetersen June 26, 2017 12:10
@aabadie aabadie modified the milestone: Release 2017.07 Jun 26, 2017
@smlng
Copy link
Copy Markdown
Member

smlng commented Jun 26, 2017

very nice idea, specifically

most drivers / modules don't specify their required features

should be fixed anyway!

@vincent-d
Copy link
Copy Markdown
Member

I think the {cpu}/periph/Makefile have an extra makefile in the include path (git grep '$(RIOTMAKE)/makefiles/periph.mk' | awk -F ':' '{print $1}' | xargs sed -i 's;/makefiles/periph.mk;/periph.mk;g would fix it).

Otherwise I like the idea, but this would need quite some work to adapt every device driver and cpu. How could we manage easily the periph dependencies (for instance periph_uart needs periph_gpio on most platforms)?

@kaspar030
Copy link
Copy Markdown
Contributor Author

I think the {cpu}/periph/Makefile have an extra makefile in the include path

Yes, thanks! pushed a fix...

Copy link
Copy Markdown
Contributor

@haukepetersen haukepetersen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it. Could you rebase? With #7507 being merged this PR should actually work now, right?

# add all pseudo random number generator variants as pseudomodules
PSEUDOMODULES += prng_%

#
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment missing?!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

jup, fixed

@kaspar030 kaspar030 force-pushed the make_periph_use_submodules branch from 0c9fbd8 to 089d221 Compare September 8, 2017 23:15
@kaspar030 kaspar030 added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Sep 8, 2017
@kaspar030 kaspar030 mentioned this pull request Sep 9, 2017
@kaspar030
Copy link
Copy Markdown
Contributor Author

Supercedes #5065.

@kaspar030 kaspar030 added the State: waiting for other PR State: The PR requires another PR to be merged first label Sep 9, 2017
@roberthartung
Copy link
Copy Markdown
Member

@kaspar030 @haukepetersen This now heavily conflicts with my own changes to pm... Highlight me once this is done so I can start all over again and start integrating the PM for atmega_common we created at the IoT Hackathon...

@kaspar030
Copy link
Copy Markdown
Contributor Author

I'll rebase this on #7597 once that is in.

@haukepetersen
Copy link
Copy Markdown
Contributor

Any news?

@kaspar030 kaspar030 force-pushed the make_periph_use_submodules branch from b7c6298 to 3ec8126 Compare November 6, 2017 11:01
@haukepetersen
Copy link
Copy Markdown
Contributor

All green -> go

@haukepetersen haukepetersen merged commit 9c38671 into RIOT-OS:master Nov 6, 2017
basilfx added a commit to basilfx/RIOT that referenced this pull request Nov 6, 2017
basilfx added a commit to basilfx/RIOT that referenced this pull request Nov 6, 2017
basilfx added a commit to basilfx/RIOT that referenced this pull request Nov 6, 2017
@kaspar030 kaspar030 deleted the make_periph_use_submodules branch November 8, 2017 16:14
basilfx added a commit to basilfx/RIOT that referenced this pull request Nov 12, 2017
basilfx added a commit to basilfx/RIOT that referenced this pull request Nov 12, 2017
basilfx added a commit to basilfx/RIOT that referenced this pull request Nov 12, 2017
basilfx added a commit to basilfx/RIOT that referenced this pull request Nov 12, 2017
basilfx added a commit to basilfx/RIOT that referenced this pull request Nov 12, 2017
basilfx added a commit to basilfx/RIOT that referenced this pull request Nov 12, 2017
basilfx added a commit to basilfx/RIOT that referenced this pull request Nov 12, 2017
basilfx added a commit to basilfx/RIOT that referenced this pull request Nov 12, 2017
basilfx added a commit to basilfx/RIOT that referenced this pull request Nov 12, 2017
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 Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants