Library reference#
Makefiles: Top-level | Instance | Master
Inheritance: Project → SharedBundle → Library
A library is an object that other libraries and applications can link to in order to use functions, classes, and constants from the library.
By default, libraries link against Base (FoundationKit), but not against Gui (AppKit). If you need to link against Gui, use xxx_NEEDS_GUI.
Creating a library#
- LIBRARY_NAME#
The list of all tools in this GNUmakefile.
include $(GNUSTEP_MAKEFILES)/common.make
LIBRARY_NAME = <Your library name here>
include $(GNUSTEP_MAKEFILES)/library.make
Library properties#
Library also inherits Project properties.
- xxx_HEADER_FILES#
The list of header filenames that are to be installed with the library, relative to
xxx_HEADER_FILES_DIR.If a header is in a subdirectory, then that header will be installed in that subdirectory of the installation directory.
- xxx_HEADER_FILES_DIR#
The location of the header files in
xxx_HEADER_FILESrelative to the directory containing theGNUmakefile.xxx_HEADER_FILES_DIRis optional; if blank or undefined, GNUstep Make assumes that the relative path to the header files is the directory containing theGNUmakefile.
- xxx_HEADER_FILES_INSTALL_DIR#
The relative subdirectory path below
GNUSTEP_HEADERSwhere the header files are to be installed.If this directory or any of its parent directories do not exist, then the Makefile Package will create them. The Makefile Package prefixes
xxx_HEADER_FILES_INSTALL_DIRto each of the filenames, including any subdirectory paths, inxxx_HEADER_FILESwhen they are installed.xxx_HEADER_FILES_INSTALL_DIRis optional; if blank or undefined, GNUstep make assumes that the installation directory is justGNUSTEP_HEADERSwith no subdirectory.
- xxx_LIBRARIES_DEPEND_UPON#
The set of libraries that the shared library depends upon.
On some platforms, when a shared library is built, any libraries which the object code in the shared library depends upon must be linked in the generation of the shared library. This is similar to the process of linking an executable file like a command line tool or Objective-C program, except that the result is a shared library. Libraries specified with
xxx_LIBRARIES_DEPEND_UPONshould be listed as-lflags to the linker. When possible, use variables defined by the Makefile Package to specify GUI, Foundation, or system libraries, likeGUI_LIBS,FND_LIBS,OBJC_LIBS, orSYSTEM_LIBS.xxx_LIBRARIES_DEPEND_UPONis independent ofADDITIONAL_OBJC_LIBS,ADDITIONAL_TOOL_LIBS, andADDITIONAL_GUI_LIBS, so any libraries specified there may need to be specified withxxx_LIBRARIES_DEPEND_UPON. The following example illustrates the use ofxxx_LIBRARIES_DEPEND_UPONfor a shared library namedlibcomplexthat depends on the Foundation Kit, Objective-C runtime, various system libraries, and an additional user library namedlibsimple.libcomplex_LIBRARIES_DEPEND_UPON = -lsimple $(FND_LIBS) $(OBJC_LIBS) $(SYSTEM_LIBS)