Problem with Multicomponent Make Targets

The problem with multicomponent Make targets arises because a file only has a single modification date/time, whereas it really needs separate one for its data fork and each resource in its resource fork.

Consider the build commands that would be generated by the example on the intro page, after making modifications to all the relevant source files:

After executing the Link command, the file's modification date/time is updated. If you were to discard the Rez command at this point (without executing it), and rerun Make, it would report that the target is up-to-date, and the needed Rez invocation would never get done.

A more realistic (and pernicious) case can arise where the target has three or more components. Consider:

where I assume that files in all three groups, Files1, Files2 and Files3 have been updated so that all three sets of commands, Commands1, Commands2 and Commands3 need to be executed.

Imagine that the Commands1 sequence completes successfully, updating the modification date for MyProg, but a compilation error happens during the execution of Commands2. You fix the error and reexecute Make, which correctly leaves out the Commands1 sequence, and regenerates the Commands2 sequence. But Commands3 never gets regenerated, because you didn't make any further changes to the source files in Files3 since MyProg was last modified!

The only way to avoid this kind of situation is to keep those commands around until the build completes successfully, and avoid rerunning Make if an error occurs during a build. Which just happens to be what I do.

Created by LDO 1997 August 8.

Back to MPW Intro