ADC Home > Reference Library > Technical Q&As > Legacy Documents > Tools >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

Makefiles Problems


Q: We're having trouble with one of our MPW makefiles. We want to force a full build of the application whenever the "Test.make" file or the "DefineCreator" file is changed, but we've been unable to do this successfully. Although we've had some success, the methods we've tried always execute some of the commands, even if none of the dependents have changed.

A: There are two approaches you can take to resolve this problem:

Add the make file and the "DefineCreator" file to each dependency line in your make file. For example, in 7Edit, each of the object files is dependent on the corresponding .h and .c files, as well as on the MakeFile itself, so the dependency line for each C file is:

SVEditUtils.c.o [[florin]] makefile SVEditUtils.h SVEditUtils.c SVEditGlobals.h
    c  SVEditUtils.c -sym on

Since adding the MakeFile and any additional files to each dependency line could be more work than it's worth, you could also use a double dependency rule to make all the object files dependent on the MakeFile and your "DefineCreator" file. Your MakeFile might include the following:

OBJECTS = [[partialdiff]]
   SVEditGlobals.c.o [[partialdiff]]
   SVEditUtils.c.o [[partialdiff]]
   SVEditAEUtils.c.o [[partialdiff]]
   SVEditions.c.o [[partialdiff]]
   SVEditWindow.c.o [[partialdiff]]
   SVEditFile.c.o [[partialdiff]]
   SVAppleEvents.c.o [[partialdiff]]
   SVEditMain.c.o [[partialdiff]]
{OBJECTS} [[florin]][[florin]] makeFile DefineCreator
SVEditGlobals.c.o [[florin]][[florin]] SVEditGlobals.h SVEditGlobals.c

(more dependencies following...)

If either the MakeFile or the DefineCreator file is changed, the entire application will be rebuilt. You don't need to include any further build commands, since you would be using the default build rules in this case.

For additional information, see "Make and Make Files" in Chapter 4 of Building and Managing Programs in MPW.

[Jun 01 1995]


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.