0

Someone can help me to write an .mk file and add custom library to buildroot.

Example:

I have foo.c and foo.h and this library that i wrote, have to be installed on a custom Linux to make my main app running successfully.

I also want to know if until this Linux was deployed, Could I use <foo.h> instead of ".../foo.h"

thanks in advance.

hmz-rhl
  • 3
  • 1

1 Answers1

0

As I understand it you have a simple library with a .c and .h.

The Makefile needs to do the following.

  1. Compile the .c to a .o
  2. Put the .o inside a .a (Static library).
  3. Put the .a (static library) into the "build root" as you call it. If the "prefix/build root" chosen is /usr/local (the default in most cases) the correct place is /usr/local/lib.
  4. Copy the .h to the "build root". The correct place is "include". "/usr/local/include".

You can see a simple Makefile example here. Also you can make the project a single header project. Like here

Harkaitz
  • 66
  • 2