Previous: , Up: objc.make   [Contents]


1.4.11.2 Example Makefile

This makefile illustrates two Objective-C programs, simple and list that are to be generated.

#
# An example GNUmakefile
#

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

# Build a simple Objective-C program
OBJC_PROGRAM_NAME = simple list

# Have the Objective-C runtime macro be defined for simple program
simple_CPPFLAGS = $(RUNTIME_DEFINE)

# The Objective-C files to compile for simple program
simple_OBJC_FILES = simple.m

# The Objective-C files to compile for list program
list_OBJC_FILES = list.m linkedlist.m

# The C files to compile for list program
list_C_FILES = sort.c

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

# Include in the rules for making Objective-C programs
include $(GNUSTEP_MAKEFILES)/objc.make

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

The simple Objective-C program only consists of single Objective-C file; while, the list Objective-C program consists of two Objective-C files and one C file. The simple Objective-C program use the variable defined by the Makefile Package, RUNTIME_DEFINE, to define a macro based upon the Objective-C Runtime library; presumably simple.m has code which is dependent upon the Objective-C Runtime.