4.8.2 Example Makefile

This example makefile illustrates two libraries, libone and libtwo, that are to be generated.

#
# An example GNUmakefile
#

# Include the common variables defined by the Makefile Package
include $(GNUSTEP_MAKEFILES)/common.make

# Two libraries
LIBRARY_NAME = libone libtwo

#
# The files for the libone library
#
# The Objective-C files to compile
libone_OBJC_FILES = one.m draw.m

# The C source files to be compiled
libone_C_FILES = parse.c

# The PostScript wrap source files to be compiled
libone_PSWRAP_FILES = drawing.psw

# The header files for the library
libone_HEADER_FILES_DIR = ./one
libone_HEADER_FILES_INSTALL_DIR = one
libone_HEADER_FILES = one.h draw.h

#
# The files for the libtwo library
#
# The Objective-C files to compile
libtwo_OBJC_FILES = two.m another.m test.m

# The header files for the library
libtwo_HEADER_FILES_DIR = ./two
libtwo_HEADER_FILES_INSTALL_DIR = two
libtwo_HEADER_FILES = two.h another.h test.h common.h

# Option include to set any additional variables
-include GNUmakefile.preamble

# Include in the rules for making libraries
include $(GNUSTEP_MAKEFILES)/library.make

# Option include to define any additional rules
-include GNUmakefile.postamble

Notice that the libone library has Objective-C, C, and PostScript wrap files to be compiled; while, the libtwo library only has some Objective-C files.

The header files for the libone library reside in the one subdirectory from where the sources are located, and the header files will be installed into the one subdirectory within GNUSTEP_HEADERS. Likewise the header files for the libtwo library reside in the two subdirectory from where the sources are located, and the header files will be installed into the two subdirectory within GNUSTEP_HEADERS.