Next: , Previous: Makefile Introduction, Up: Top



1.2 Structure of a Makefile

Here is an example makefile (named GNUmakefile to emphasis the fact that it relies on special features of the GNU make program).

     #
     # 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
     
     # The Objective-C files to compile
     simple_OBJC_FILES = simple.m
     
     -include GNUmakefile.preamble
     
     # Include in the rules for making Objective-C programs
     include $(GNUSTEP_MAKEFILES)/objc.make
     
     -include GNUmakefile.postamble

This is all that is necessary to define the project.