Creating a module library is as easy as creating a single directory, copying this sample Makefile and appropriately editing variable definitions. The following variables need to be defined properly in the Makefile:
LIBRARY
: This variable defines the name of the library file to be generated. Examples include librhexmodules.a, libexample.a etc. SOURCES
: This variable is expected to be a list of source files that will be compiled and archived into the library specified above. Full names of the source files with .cc extensions are required/. TEST
: The library directories also support creating test executables associated with a library. This variable is expected to define the name of the executable for which an associated file with a .cc extension is expected in the same directory. AUXFLAGS
: Any auxiliary compiler flags that you may want to define. Most often, these will be -I and -L arguments for the compiler to add include and link search directories to the compiler's list. AUXLIBS
: This variable is expected to define additional libraries that are needed by the test executable during the link process. The specified files must include their full paths as the Makefile attempts to generate these libraries as well.