After reading a bit of Building and Managing Programs in MPW, I realized my Makefile is not using any of the complex features available in MPW. So, I incorporated some path constants and Directory Based Dependency Rules, and eliminated a lot of the hard-coded paths and dependencies in my make file.
I figured out that the key to using Directory Based Dependency Rules and code segments in the Makefile is to add a modified extension to the list of object files you want to put in a separate code segment. Then, add a new default build rule for that extension. Code segments are way easy now! I can now remove the --model far option which seems like it might be incompatible with older Macintosh System versions. The main segment with the PPP interface comes in about 31K and the rest of lwip is just 28K, each fitting nicely in a code segment.
Here is an example section of an MPW Makefile (new extension in yellow and segment name option in blue):
ObjFiles-68K = "{SrcDir}ip_frag.c.o" ∂
"{NetISrc}etharp.c.n.o"
### Default Rules ###
{NetISrc} ƒ {NetISrc} {PPPISrc}
{SrcDir} ƒ {CoreSrc} {IPV4Src} {APISrc}
.c.o ƒ .c {•MondoBuild•}
{C} {depDir}{default}.c -o {targDir}{default}.c.o {COptions}
.c.n.o ƒ .c {•MondoBuild•}
{C} {depDir}{default}.c -o {targDir}{default}.c.n.o {COptions} -seg NetIf
No comments:
Post a Comment