Create a new module

Hi Team,

I am staring to create my own module for RIOT CCN stuff, I am wondering for the USEMODULE in Makefile,

How can I add a self-define module in Makefile, and how do we specify the name like? What is the underlying complying mechanism to find the module?

USEMODULE += gnrc_ipv6_router_default

Thanks, Haoyang

Hello Haoyang,

I am staring to create my own module for RIOT CCN stuff, I am wondering for the USEMODULE in Makefile,

Cool, looking forward to this implementation. May I ask what kind of CCN stuff you're going to implement? Are you developing from scratch or do you use any existing CCN implementation as a foundation?

How can I add a self-define module in Makefile, and how do we specify the name like? What is the underlying complying mechanism to find the module?

Usually, the name and path of the module is derived from its directory name. If you create a folder like `sys/foobar` and put a Makefile there which contains a line like this: `include $(RIOTBASE)/Makefile.base` all C files in this folder will be compiled to something that is usable via `USEMODULE += foobar`. If you want to label your module different from its directory name for some reason, you can add another line to the Makefile before the above mentioned line saying `MODULE := myfoobar`.

However, for stuff residing inside a subdirectory of `sys` like `sys/net/...` you will need to some lines to `sys/Makefile` in order to let Make find this module. Just look at the existing examples there.

Cheers, Oleg

Hi Oleg,

Thanks for your quick reply!!

I think CCN is the same concept for ICN in USA. I am trying to implement MF-Lite based on RIOT, which is quick challenging for me…   http://mobilityfirst.orbit-lab.org/wiki/WikiStart Our small team is still deciding to implement from scratch or based on your CCN-lite implementation. Because RIOT network stack is based on IPv6, which means if we implement from scratch it will take plenty of time, and we are short of hand and experience. Any suggestion?

Thanks for your Makefile explanation, really helps!

Thanks, Haoyang

Hi Oleg,

I do cannot find any Makefile claim this module as the name gnrc_netif_default. But I found one named gnrc_netif.

# use the default network interface for the board   USEMODULE += gnrc_netif_default

I am wondering where can I find it. I used grep to search.

Thank you very much.

Cheers, Haoyang

Hello Haoyang,

`gnrc_netif_default` is a pseudo module and defined in `Makefile.pseudomodules`. In `Makefile.dep` you can see that it pulls in `gnrc_netif` as a dependency.

Best, Cenk