1 MPW Makefile Conversion
ksherlock edited this page 2013-07-29 12:52:52 -07:00

MPW's make utility is similar to the Unix make utility. Similar enough that some makefiles can be converted with simple text replacements.

Here is an MPW makefile from IR 2.0.2 (ir.make):

IR ƒƒ IR.make ∂
		IRInit.aii.obj ∂
		RequestProc.aii.obj ∂
		IR.rfork
	LinkIIGS -t $B6 -at $0000 ∂
		IRInit.aii.obj ∂
		RequestProc.aii.obj ∂
		-o IR
		DuplicateIIgs -y -m IR :

IRInit.aii.obj ƒ IR.make IRInit.aii
	AsmIIGS -t IRInit.aii
RequestProc.aii.obj ƒ IR.make RequestProc.aii
	AsmIIGS -t RequestProc.aii
IR.rfork ƒ IR.make IR.r 
	RezIIgs IR.r -o IR.rfork
	Duplicate -r -y IR.rfork IR
  • ƒƒ and ƒ should be replaced with :.
  • should be replaced with \.
  • $ needs to be escaped as \$$.
  • mpw commands (AsmIIgs, LinkIIgs, RezIIgs, and Duplicate) are executed as mpw command (unless you generate shell scripts for each command).
  • the DuplicateIIgs command is no longer necessary.
  • if the makefile (IR.make) is included as a dependency, it should be updated to the new name.

The modern makefile (makefile) is now:

IR : makefile \
		IRInit.aii.obj \
		RequestProc.aii.obj \
		IR.rfork
	mpw LinkIIGS -t \$$B6 -at \$$0000 \
		IRInit.aii.obj \
		RequestProc.aii.obj \
		-o IR
    mpw Duplicate -r -y IR.rfork IR

IRInit.aii.obj : IR.make IRInit.aii
	mpw AsmIIGS -t IRInit.aii
RequestProc.aii.obj : IR.make RequestProc.aii
	mpw AsmIIGS -t RequestProc.aii
IR.rfork : IR.make IR.r 
	mpw RezIIgs IR.r -o IR.rfork

(the Duplicate command was also moved from IR.rfork to IR since I prefer to set the resource fork after linking).

More complicated makefiles involving variables require more work and editing.