Skip to content

make: process include and dep for external modules#8987

Merged
jia200x merged 2 commits intoRIOT-OS:masterfrom
cladmi:pr/improve/external_modules
Oct 23, 2018
Merged

make: process include and dep for external modules#8987
jia200x merged 2 commits intoRIOT-OS:masterfrom
cladmi:pr/improve/external_modules

Conversation

@cladmi
Copy link
Contributor

@cladmi cladmi commented Apr 19, 2018

Allow using EXTERNAL_MODULE_DIRS for complete modules with configuration and dependencies as if they were in RIOT.

It gives them the same possibilities as packages when all files are already there and do not need to be downloaded.

Contribution description

Process Makefile.include for external modules. It is included after the others
so it could overwrite some of the configuration if wanted.

Process Makefile.dep for external modules. It is included before the others so
it could be parsed before setting 'default' values to dependencies.

Compile time testing

I added a test that checks at compile time the header inclusion, linking and parsing dependencies.

Pre-contrib

I needed to make USEMODULE_INCLUDES_ an immediate variable to allow using MAKEFILE_LIST to define an include directory. Not really sure why though :/ I know why the fix makes it work, not why it is required in the first place.
In the external module makefile include, I need to use an immediate variable to evaluate MAKEFILE_LIST directly.

Issues/PRs references

Would allow using modules without modifying RIOT with a mechanism like #7523

@cladmi cladmi added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Area: build system Area: Build system CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Apr 19, 2018
@cladmi cladmi force-pushed the pr/improve/external_modules branch from e1db08c to f55affb Compare April 20, 2018 09:04
@kaspar030
Copy link
Contributor

Nice one, and one step towards USEMODULE_GIT += https://github.com/me/module.

@cladmi cladmi force-pushed the pr/improve/external_modules branch from f55affb to 33f3fe0 Compare April 20, 2018 13:35
@cladmi
Copy link
Contributor Author

cladmi commented Apr 20, 2018

I reformulated and split in two bullet points for Makefile.include and Makefile.dep

@danpetry if you want to check the English too :)

@cladmi cladmi added this to the Release 2018.07 milestone Jul 4, 2018
@cladmi cladmi force-pushed the pr/improve/external_modules branch from 33f3fe0 to c0b4997 Compare July 4, 2018 07:34
@cladmi
Copy link
Contributor Author

cladmi commented Jul 4, 2018

Rebased the conflicting file.

@cladmi cladmi requested a review from smlng July 4, 2018 07:34
Copy link
Member

@smlng smlng left a comment

Choose a reason for hiding this comment

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

Tested with native on macOS, samr21-xpro, and arduino-mega2560 - runs perfectly on all of them.

@smlng
Copy link
Member

smlng commented Jul 4, 2018

ping @kaspar030

@cladmi
Copy link
Contributor Author

cladmi commented Aug 21, 2018

Rebased on master. As it was merged after writing this PR, I found out that currently this PR does not talk about defining BUILDDEP in the external modules and does not use it in tests. This would show more how to define an external "package" like module. I can add this in followup PR.

@cladmi
Copy link
Contributor Author

cladmi commented Sep 10, 2018

Ping @kaspar030

@kYc0o
Copy link
Contributor

kYc0o commented Sep 19, 2018

@kaspar030 are you satisfied with the rewording?

@kYc0o
Copy link
Contributor

kYc0o commented Oct 8, 2018

@kaspar030 ping.

@kYc0o
Copy link
Contributor

kYc0o commented Oct 19, 2018

@jia200x would you like to have this for the release? If so, we need to dismiss @kaspar030 review.

@cladmi cladmi force-pushed the pr/improve/external_modules branch from bb89a8a to 578b66d Compare October 21, 2018 16:59
@jia200x
Copy link
Member

jia200x commented Oct 22, 2018

@jia200x would you like to have this for the release? If so, we need to dismiss @kaspar030 review.

Would be nice to have this for the Release. @kaspar030 last call?

1 similar comment
@jia200x
Copy link
Member

jia200x commented Oct 22, 2018

@jia200x would you like to have this for the release? If so, we need to dismiss @kaspar030 review.

Would be nice to have this for the Release. @kaspar030 last call?


* Adding a module with source code
* Setting a header include directory
* Adding dependences, which are evaluated before other modules dependencies
Copy link
Contributor

Choose a reason for hiding this comment

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

dependencies

@kaspar030
Copy link
Contributor

are you satisfied with the rewording?

Yes.

2 similar comments
@kaspar030
Copy link
Contributor

are you satisfied with the rewording?

Yes.

@kaspar030
Copy link
Contributor

are you satisfied with the rewording?

Yes.

@cladmi
Copy link
Contributor Author

cladmi commented Oct 22, 2018

Updated the last comment.

@jia200x
Copy link
Member

jia200x commented Oct 23, 2018

@kaspar030 are you OK with the changes? Could you (N)ACK?

@kaspar030
Copy link
Contributor

lgtm

@kaspar030
Copy link
Contributor

@cladmi pls squash!

Process `Makefile.include` for external modules. It is included after the others
so it could overwrite some of the configuration if wanted.

Process `Makefile.dep` for external modules. It is included before the others so
it could be parsed before setting 'default' values to dependencies.
It demonstrates:

 * Adding a module with source code
 * Setting a header include directory
 * Adding dependences, which are evaluated before other modules dependencies

If the application compiles, everything is ok.
@cladmi cladmi force-pushed the pr/improve/external_modules branch from c084430 to 4157a07 Compare October 23, 2018 11:22
@cladmi
Copy link
Contributor Author

cladmi commented Oct 23, 2018

Squashed, waiting for murdock.

@jia200x
Copy link
Member

jia200x commented Oct 23, 2018

murdock is happy. Let's merge it then ;)

@jia200x jia200x merged commit 13312ef into RIOT-OS:master Oct 23, 2018
@jia200x
Copy link
Member

jia200x commented Oct 23, 2018

@cladmi thank you for this contribution

@cladmi
Copy link
Contributor Author

cladmi commented Oct 23, 2018

Thanks all for reviewing and merging.

@cladmi cladmi deleted the pr/improve/external_modules branch October 23, 2018 12:56
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 CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR 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.

5 participants