Library from Makefile?

Can anyone guide me on compiling a PlatformioIO library from a Makefile? Specifically, I’m interested in incoprorating GeographicLib into a project. It’s straightforward to build this on Windows and Linux, but I’m not sure where to start in using PlatformIO.

The syntax for the library.json can be found in the documentation, with many example libraries being out there.

This library seems very complex with dependencies to GNU MPFR (multi-precission floats) etc. So you would need to have that as dependency too.

For a start, you should gather all needed .cpp and .h sources, place them in a new folder GeographicLib in the lib/ of a sample project, together with a simple example for the library in src/. Then you’d need to adapt all the needed build flags and other stuff from the working Windows or Linux build to carry them over to your target microcontroller platform.

1 Like