Next: 3 Building more than Up: 2 Libraries Previous: 2.3 Linking against an

2.4 Linking a library against another library

You might need to build a shared library (for example called libNicola) which depends on another library (for example on libHelloWorld), and requiring the other library to be loaded automatically whenever your library is. We say that your library (libNicola) depends on the other one (libHelloWorld).

This case is quite simple - you write a usual GNUmakefile for your library:

include $(GNUSTEP_MAKEFILES)/common.make

LIBRARY_NAME = libNicola
libNicola_OBJC_FILES = two.m

include GNUmakefile.preamble
include $(GNUSTEP_MAKEFILES)/library.make
and add a GNUmakefile.preamble in which you tell the make package that this library depends on the library libHelloWorld:
libNicola_LIBRARIES_DEPEND_UPON += -lHelloWorld



2010-03-12