[riot-devel] Location of header files
authmillenon at gmail.com
Thu Jun 20 13:32:35 CEST 2013
2013/6/20 Oleg Hahm <oliver.hahm at inria.fr>
> This situation is clearly poor and unsatisfying. Additionally, it raises
> question about how to include the headers into C files. Should each
> application add every single include path to its Makefile and then just
> put a
> include "foobar.h"
> into the source code or is it "better" to include relative paths like
> include "sys/foo/foobar.h"
I would prefer to add the module's include path in its Makefile, so you can
just write "#include <foobar.h>"
> I really think we should tidy up this mess once and for all. So, what do
> prefer? Put all headers into a generic path (like *nix system do)?
> like RIOT/include/. Or enforce the policy to store headers closely to the
> corresponding C files? And if so, would you prefer separate include
> directories or mingle source and header files?
> Personally, I would vote to locate header files into an include
> of the corresponding module. In my opinion, this is the cleanest solution
> obeys RIOT's modularity best. I would then configure the Make system in a
> that include paths are set accordingly to the used modules in the
> application's Makefile. Whaddayathink?
Yes, but this might cause some naming collisions, given the fact each
module would include its include directory to the global include path. I
would propose that we do the following scheme
include/<modulename>.h // optional, if it makes sense: includes all
headers in include/<modulename>/
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the devel