Using Tools: 13.2 pmake: How to Customize pmake

Up: GEOS SDK TechDocs | Up | Prev: 13.1 Copyright Notice and Acknowledgment | Next: 13.3 Command Line Arguments

For most applications, executing mkmf will generate a perfect makefile. However, you may be creating an unusual geode or have some makefile definitions which you want to include. Fortunately, there are ways to customize your make environment without having to build a MAKEFILE from scratch.

Makefiles can #include other makefiles. If you have a file named LOCAL.MK in your make directory, then the standard makefile generated by mkmf will include it; if you wish to customize your makes, you can create a LOCAL.MK file and fill it with appropriate make directives.

Depending on how much customization you need to do, you may wish to read on to find out about makefile syntax. However, there are several simple things you can do without learning too much about makefiles.

# Pass extra flags to Goc:
 GOCFLAGS		+= flag1 flag2
# Pass extra flags to your C compiler:
 CCOMFLAGS		+= flag1 flag2
# Pass extra flags to the Esp assembler (if you have
# that tool):
 ASMFLAGS		+= flag1 flag2
# Pass extra flags to the Glue linker:
 LINKFLAGS 		+= flag1 flag2
# Look somewhere special for .GOC files
# (This pattern applies to any suffix):
.PATH.GOC 		: $(ROOT_DIR)\DIR1 \DIR2
# Specify geode name:
 GEODE 		= NAME
# Set NO_EC variable (which signals that we don't
# want to make an Error Checking version):
 NO_EC 		= 1
# If your preprocessor is not reachable via the 
# Path environment variable:
 CPP 		= vol:\path\name
# If your C compiler is not reachable via the Path
# environment variable:
 CCOM 		= vol:\path\name
# Include some other make file
#include "OTHERMF.MK"
# Include the standard makefile directives
# This will include INCLUDE\GEODE.MK:
#include <$(SYSMAKEFILE)>
Sample local.mk Files
---FINGER\LOCAL.MK
# Local Makefile for FPaint
#  FPaint is stored in a directory called FINGER. This would normally confuse
#  pmake, which expects the geode name to be the same as the directory name.
#  Let us, therefore, alert pmake to the geode's real name:
GEODE		= FPAINT
# This was the only thing we wanted to change, so include standard definitions:
#include <$(SYSMAKEFILE)>
---PROMO\LOCAL.MK
# Local Makefile for Promo
#  Promo uses some clip art that isn't in or below its source directory, so we
#  tell pmake where to look for it:
.PATH.GOH 	: $(CSOURCE_PATHS) $(CINCLUDE_DIR) $(ROOT_DIR)\LOGOART
# This program contains no Error Checking code (See 
# the GOC Programming chapter for information
# about EC code. So we tell pmake not to bother making an Error Checking
# version:
NO_EC = 1
# Include the standard system makefile:
#include <$(SYSMAKEFILE)>

Up: GEOS SDK TechDocs | Up | Prev: 13.1 Copyright Notice and Acknowledgment | Next: 13.3 Command Line Arguments