Reducing Complexity with Convenience Libraries
Jupiter is fairly trivial as open source software projects go, so in order to highlight some more of Automake's key features, let's expand it a little. We'll first add a convenience library, and then modify jupiter
to consume this library. A convenience library is a static library that's only used within the containing project. Such temporary libraries are generally used when multiple binaries in a project need to incorporate the same source code. I'll move the code in main.c to a library source file and call the function in the library from jupiter
's main
routine. Begin by executing the following commands from the top-level project directory:
$mkdir common
$touch common/jupcommon.h
$copy src/main.c ...
Get Autotools now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.