I have a solution,
I added two lines to local Makefile:
OBJS += ./lib/stepper.o
CPPFLAGS += -I$(CURDIR)/include
thanks to last line:
include ./libopencm3.target.mk
those values are inherited and all project is building successfully.
Chuck - thanks for some tips that led me to proper direction - I always
considered makefiles language to be cryptic..
On 3 May 2014 23:28, Chuck Mcmanis <[email protected]> wrote:
> Ok, that is a different problem :-). One solution is to create a makefile
> for the library. You can reuse a lot of what is in Makefile.include but the
> existing structure is designed for projects where all the files are in the
> same directory.
>
> That gives you two choices. One, you can move all the .cpp and .h files
> into the directory and add a line OBJS=file1.o,file2.o,...,filen.o, or you
> can create a new makefile for your library which will build a .a file and
> use LDLIBS to point to it, once it has been built. Either way, reading
> through the gnu make documentation might be helpful in deciding where you
> want to make the change.
>
>
>
> On May 3, 2014, at 5:06 PM, Marcin Jurczuk <[email protected]> wrote:
>
> It doesn't help.
>
>
> What I want to get is that all *.cpp *.c files in ./lib folder will be
> compiled and used for linking.
> Righ now running make doesn't compile files in ./lib and and therefor
> linker can't find proper .o files even if I supply -L./lib..
>
>
>
>
> On 3 May 2014 22:34, Chuck McManis <[email protected]> wrote:
>
>> If you are using the examples make file you can just add
>> "-I<include_dir>" to CFLAGS which will add it to the command line.
>>
>>
>>
>> On Sat, May 3, 2014 at 11:52 AM, Marcin Jurczuk <[email protected]>wrote:
>>
>>> Hi guys,
>>>
>>> Sorry if this is wrong place but after two days of fighting I decided
>>> that asking here might be easier since no response was found via uncle
>>> Google :-/
>>>
>>> I made two files (*.h *.cpp ) that provide me stepper motor library
>>> which I want to incorporate to my project which is using libopencm3.
>>> Examples are based on simple single file source code.
>>>
>>> What (where) changes need to be made so I can have "lib/include" folder
>>> where my *.cpp and *h will be located and compiled by "make".
>>>
>>> Manual make works so my code is ok however I don't know where to modify
>>> libopencm3.rules.mk/ libopencm3.target.mk so they will look into
>>> lib/include folder for files to compilation.
>>>
>>> Project structure is simple
>>> ./libopencm3
>>> ./include
>>> ./src/
>>> ./man.c
>>> ./Makefile
>>>
>>> Regards,
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
>>> Instantly run your Selenium tests across 300+ browser/OS combos. Get
>>> unparalleled scalability from the best Selenium testing platform
>>> available.
>>> Simple to use. Nothing to install. Get started now for free."
>>> http://p.sf.net/sfu/SauceLabs
>>> _______________________________________________
>>> libopencm3-devel mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/libopencm3-devel
>>>
>>>
>>
>
> ------------------------------------------------------------------------------
> "Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
> Instantly run your Selenium tests across 300+ browser/OS combos. Get
> unparalleled scalability from the best Selenium testing platform available.
> Simple to use. Nothing to install. Get started now for free."
> http://p.sf.net/sfu/SauceLabs
>
> _______________________________________________
> libopencm3-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/libopencm3-devel
>
>
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos. Get
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
libopencm3-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libopencm3-devel