Each top-level directory containing a library.mk is a library with the dirname being the name of the library.
Make builds only the requested lib and its dependencies, and combines them into one static archive.
No external build system is required1.
To build the release version of a specific library, call
make <libname>If you want the debug version instead, set the BUILD variable to debug
make <libname> BUILD=debugTo get the entire collection as one single archive, use
make allDebug uses -O0 -g3 -DDEBUG; release uses -O2 -DNDEBUG.
Each library target builds and packages its archive and public headers by default.
Running make <libname> creates dist/release/<libname>/lib/lib<libname>.a and dist/release/<libname>/include/, containing the public headers of <libname> and all transitive dependencies.
A consumer can link with
cc main.c -Idist/release/<libname>/include dist/release/<libname>/lib/lib<libname>.a -o myappOnly one archive needs to be linked2.
Important
If you link two independently bundled archives that contain the same dependency, their duplicate implementations can cause symbol conflicts.
Released under the Unlicense. I have dedicated this software to the public domain. You are free to use, modify, distribute, and share this software for any purpose, without restriction.