Re: [riot-devel] Include in Makefile

2015-10-14 Thread Baptiste Clenet
Thanks Thomas and Rakendra. I didn't try it but it will work as good
as Attilio solution expect from the fact that it will use only one
module APPLICATION.

Thanks again!

Cheers,

Baptiste

2015-10-14 14:03 GMT+02:00 Thomas Eichinger :
> Baptist,
>
> Did you try the following?
>
> app/Makefile:
> ```
> ...
> DIRS += thingA thingB
> INCLUDES += -I$(CURDIR)/include -I$(CURDIR)/thingA -I$(CURDIR)/thingB
> ...
> ```
>
> app/thingA/Makefile, app/thingB/Makefile
> ```
> module = $(APPLICATION)
>
> include $(RIOTBASE)/Makefile.base
> ```
>
> This way all code in `app` should form one module.
> Let me know if this helps.
>
> Best,
> Thomas
>
> On 14 Oct 2015, at 9:05 CEST(+0200), Baptiste Clenet wrote:
>
>> Anyone? @OlegHahm , @daniel-k ?
>>
>> 2015-10-09 16:50 GMT+02:00 Baptiste Clenet :
>>> Hi all,
>>>
>>> I'm building an example (let's called it "app") for RIOT with the
>>> following structure:
>>> app/*.c
>>> app/include/*.h
>>> app/thingA/*.c
>>> app/thingA/include*.h
>>> app/thingB/*.c
>>> app/thingB/include*.h
>>>
>>> How to add the required path in the Makefile? Should I add
>>> Makefile.base in each folder or is there another way to do it with
>>> RIOT Makefile ? I couldn't find any example of this structure.
>>>
>>> Cheers,
>>>
>>>
>>> --
>>> Baptiste
>>
>>
>>
>> --
>> Baptiste
>> ___
>> devel mailing list
>> devel@riot-os.org
>> https://lists.riot-os.org/mailman/listinfo/devel
> ___
> devel mailing list
> devel@riot-os.org
> https://lists.riot-os.org/mailman/listinfo/devel



-- 
Baptiste
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] Include in Makefile

2015-10-14 Thread Thomas Eichinger
Baptist,

Did you try the following?

app/Makefile:
```
...
DIRS += thingA thingB
INCLUDES += -I$(CURDIR)/include -I$(CURDIR)/thingA -I$(CURDIR)/thingB
...
```

app/thingA/Makefile, app/thingB/Makefile
```
module = $(APPLICATION)

include $(RIOTBASE)/Makefile.base
```

This way all code in `app` should form one module.
Let me know if this helps.

Best,
Thomas

On 14 Oct 2015, at 9:05 CEST(+0200), Baptiste Clenet wrote:

> Anyone? @OlegHahm , @daniel-k ?
>
> 2015-10-09 16:50 GMT+02:00 Baptiste Clenet :
>> Hi all,
>>
>> I'm building an example (let's called it "app") for RIOT with the
>> following structure:
>> app/*.c
>> app/include/*.h
>> app/thingA/*.c
>> app/thingA/include*.h
>> app/thingB/*.c
>> app/thingB/include*.h
>>
>> How to add the required path in the Makefile? Should I add
>> Makefile.base in each folder or is there another way to do it with
>> RIOT Makefile ? I couldn't find any example of this structure.
>>
>> Cheers,
>>
>>
>> --
>> Baptiste
>
>
>
> -- 
> Baptiste
> ___
> devel mailing list
> devel@riot-os.org
> https://lists.riot-os.org/mailman/listinfo/devel
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] Include in Makefile

2015-10-14 Thread rakendra thapa
We need to use USEMODULE macro in Makefile, else in case
app/*.c is making reference to functions defined in app/thingA/*.c, it will
give undefined reference error.

Thanks and Regards,
Rakendra



On Wed, Oct 14, 2015 at 5:13 PM, Baptiste Clenet 
wrote:

> kaspar, it works if all include are in the root folder otherwise there
> is linking problem ("undefined reference to" function, error).
>
> Attilio, yes it works thanks, but I think we shouldn't have to create
> a module for that. Anyway, let's see if someone can provide another
> solution.
>
> Cheers,
>
> 2015-10-14 12:25 GMT+02:00 Attilio Dona :
> > In app/Makefile:
> >
> > DIRS += thingsA thingsB
> >
> > INCLUDES += -I$(CURDIR)/thingsA -I$(CURDIR)/thingsB
> >
> > USEMODULE += thingsA thingsB
> >
> > in thingsA and thingsB directory add a Makefile:
> >
> > include $(RIOTBASE)/Makefile.base
> >
> >
> > Something like that should work ... but if there is a better solution
> nice
> > to know!
> >
> > greetings
> > Attilio
> >
> >
> > On Fri, Oct 9, 2015 at 4:50 PM, Baptiste Clenet 
> wrote:
> >>
> >> Hi all,
> >>
> >> I'm building an example (let's called it "app") for RIOT with the
> >> following structure:
> >> app/*.c
> >> app/include/*.h
> >> app/thingA/*.c
> >> app/thingA/include*.h
> >> app/thingB/*.c
> >> app/thingB/include*.h
> >>
> >> How to add the required path in the Makefile? Should I add
> >> Makefile.base in each folder or is there another way to do it with
> >> RIOT Makefile ? I couldn't find any example of this structure.
> >>
> >> Cheers,
> >>
> >>
> >> --
> >> Baptiste
> >> ___
> >> devel mailing list
> >> devel@riot-os.org
> >> https://lists.riot-os.org/mailman/listinfo/devel
> >
> >
> >
> > ___
> > devel mailing list
> > devel@riot-os.org
> > https://lists.riot-os.org/mailman/listinfo/devel
> >
>
>
>
> --
> Baptiste
> ___
> devel mailing list
> devel@riot-os.org
> https://lists.riot-os.org/mailman/listinfo/devel
>
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] Include in Makefile

2015-10-14 Thread Baptiste Clenet
kaspar, it works if all include are in the root folder otherwise there
is linking problem ("undefined reference to" function, error).

Attilio, yes it works thanks, but I think we shouldn't have to create
a module for that. Anyway, let's see if someone can provide another
solution.

Cheers,

2015-10-14 12:25 GMT+02:00 Attilio Dona :
> In app/Makefile:
>
> DIRS += thingsA thingsB
>
> INCLUDES += -I$(CURDIR)/thingsA -I$(CURDIR)/thingsB
>
> USEMODULE += thingsA thingsB
>
> in thingsA and thingsB directory add a Makefile:
>
> include $(RIOTBASE)/Makefile.base
>
>
> Something like that should work ... but if there is a better solution nice
> to know!
>
> greetings
> Attilio
>
>
> On Fri, Oct 9, 2015 at 4:50 PM, Baptiste Clenet  wrote:
>>
>> Hi all,
>>
>> I'm building an example (let's called it "app") for RIOT with the
>> following structure:
>> app/*.c
>> app/include/*.h
>> app/thingA/*.c
>> app/thingA/include*.h
>> app/thingB/*.c
>> app/thingB/include*.h
>>
>> How to add the required path in the Makefile? Should I add
>> Makefile.base in each folder or is there another way to do it with
>> RIOT Makefile ? I couldn't find any example of this structure.
>>
>> Cheers,
>>
>>
>> --
>> Baptiste
>> ___
>> devel mailing list
>> devel@riot-os.org
>> https://lists.riot-os.org/mailman/listinfo/devel
>
>
>
> ___
> devel mailing list
> devel@riot-os.org
> https://lists.riot-os.org/mailman/listinfo/devel
>



-- 
Baptiste
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] Include in Makefile

2015-10-14 Thread Attilio Dona
In app/Makefile:

DIRS += thingsA thingsB

INCLUDES += -I$(CURDIR)/thingsA -I$(CURDIR)/thingsB

USEMODULE += thingsA thingsB

in thingsA and thingsB directory add a Makefile:

include $(RIOTBASE)/Makefile.base


Something like that should work ... but if there is a better solution nice
to know!

greetings
Attilio


On Fri, Oct 9, 2015 at 4:50 PM, Baptiste Clenet  wrote:

> Hi all,
>
> I'm building an example (let's called it "app") for RIOT with the
> following structure:
> app/*.c
> app/include/*.h
> app/thingA/*.c
> app/thingA/include*.h
> app/thingB/*.c
> app/thingB/include*.h
>
> How to add the required path in the Makefile? Should I add
> Makefile.base in each folder or is there another way to do it with
> RIOT Makefile ? I couldn't find any example of this structure.
>
> Cheers,
>
>
> --
> Baptiste
> ___
> devel mailing list
> devel@riot-os.org
> https://lists.riot-os.org/mailman/listinfo/devel
>
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] Include in Makefile

2015-10-14 Thread Kaspar Schleiser

Hey,

On 10/14/2015 09:05 AM, Baptiste Clenet wrote:

Anyone? @OlegHahm , @daniel-k ?


One way that comes to mind is manually filling the SRC variable in 
app/Makefile,


e.g.,

SRC += ./*.c thingA/*.c

Kaspar

___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel


Re: [riot-devel] Include in Makefile

2015-10-14 Thread Baptiste Clenet
Anyone? @OlegHahm , @daniel-k ?

2015-10-09 16:50 GMT+02:00 Baptiste Clenet :
> Hi all,
>
> I'm building an example (let's called it "app") for RIOT with the
> following structure:
> app/*.c
> app/include/*.h
> app/thingA/*.c
> app/thingA/include*.h
> app/thingB/*.c
> app/thingB/include*.h
>
> How to add the required path in the Makefile? Should I add
> Makefile.base in each folder or is there another way to do it with
> RIOT Makefile ? I couldn't find any example of this structure.
>
> Cheers,
>
>
> --
> Baptiste



-- 
Baptiste
___
devel mailing list
devel@riot-os.org
https://lists.riot-os.org/mailman/listinfo/devel