ksherlock / mpw

Macintosh Programmer's Workshop (mpw) compatibility layer
238 stars 21 forks source link

Any chance of a setup guide? #38

Closed uliwitness closed 1 year ago

uliwitness commented 1 year ago

Hi,

I find this amazing project impressive, thanks for making it available! I'm a bit flummoxed on how to actually use it though. Where do I copy the original MPW files (and which ones) to have mpw find them? What are good defaults for the $MPW and $Commands environment variables?

Any chance of providing a quick bullet points list in the Wiki listing how to set things up?

I understand that there are multiple uses for it (building Apple ][ software, Mac software and ... ARM ... I suppose Newton software?), so it might not go all the way to compiling a classic Mac app, but it would help people get there. I'd write one myself, but I couldn't find the info needed anywhere.

Thanks, even if you shouldn't have the time to write one. -- Uli

uliwitness commented 1 year ago

So I guess a start would be:

- Get your copy of MPW [see Wiki page]
- create a folder `~/mpw`
- open the `Interfaces&Libraries` folder from your copy of MPW, and copy the `Interfaces`, `Libraries`, `DebuggingLibraries` and `RuntimeLibraries` folders inside it to your `~/mpw` folder
- open the `MPW` folder and copy the `Tools` folder from there to your `~/mpw` folder

? I'm not sure what else would be of useful, or if DebuggingLibraries and RuntimeLibraries should not be copied? So any additional info you can add would be great.

ksherlock commented 1 year ago

in my ~mpw folder, put all the verbatim files. Environment.text controls how commands, interfaces, and libraries are found.

My setup looks like this:

MPWVersion ?= 3.5
ShellDirectory=$MPW${MPWVersion}:
Commands=${ShellDirectory}Tools,${MPW}Tools:,.
# MPW Macintosh compilers
SCIncludes=${ShellDirectory}:Interfaces:CIncludes:
CIncludes=${ShellDirectory}:Interfaces:CIncludes:
AIncludes=${ShellDirectory}Interfaces:AIncludes:
RIncludes=${ShellDirectory}Interfaces:RIncludes:
PInterfaces=${ShellDirectory}Interfaces:PInterfaces:

Libraries=${ShellDirectory}Libraries:Libraries:
PLibraries=${ShellDirectory}Libraries:PLibraries:
CLibraries=${ShellDirectory}Libraries:CLibraries:

PPCLibraries=${ShellDirectory}Libraries:PPCLibraries:
SharedLibraries=${ShellDirectory}Libraries:SharedLibraries:
CFM68KLibraries=${ShellDirectory}Libraries:CFM68KLibraries:
....

and then I have separate 3.2 and 3.5 folders so I can switch between compilers (mpw -D MPWVersion=3.2 ... for 3.2)

iMac:mpw kelvin$ ls 3.2
Interfaces/ Libraries/  SysErrs.err*    Tools/
iMac:mpw kelvin$ ls 3.5
Help/           MPW.Help*       Tools/
Interfaces/     RuntimeLibraries/
Libraries/      SysErrs.err*

For codewarrior, newtonsoft, etc, you could merge them all together or keep separate folders.

MW68KLibraries=${MPW}MW:Libraries:MW68KLibraries:
MWPPCLibraries=${MPW}MW:Libraries:MWPPCLibraries:

CWCIncludes=${MPW}MW:Interfaces:CWCIncludes:
CWANSIIncludes=${MPW}MW:Interfaces:CWANSIIncludes:
MWCIncludes=${CIncludes}

Here are some MPW command line utilities, which have generally been tested with actual MPW as well. The makefile assumes an MPW 3.5 installation and shows compiling and linking. Building a GUI app would be similar, but would include a rez step.

Another way to build is this which includes an MPW-compatible mpw-make program which executes original MPW makefiles. (They need to be in macroman text encoding).

uliwitness commented 1 year ago

I'll see if I can find the time to try this out and write up something shorter. I don't think beginners looking for instructions need a multi-version setup, and making this variable isn't that different from any other shell script.

uliwitness commented 1 year ago

OK, I've taken the liberty of editing the Wiki to add a minimal version of the setup instructions I used to get a working MPW. I've also created a Makefile (based on this one by Steven Troughton-Smith) to build the SillyBalls example that came with MPW, and it happily built that. Would you mind if I added a short rundown on how to build a Mac app to the Wiki as well?

uliwitness commented 1 year ago

I just wrote an example into the Wiki how one can build a 68k and PPC application. It's not the most simple version (and doesn't merge the app into a fat binary), but it's what I'm currently using. It shows the most important parts: How to compile, and how to generate resources (using MacOS X's Rez), so should at least get people started for whatever Mac app they want to build.

If you think that's not off-topic for this Wiki, I might come back and simplify it some more, maybe even split it up into separate 68k and PPC Makefiles or so, to make things quicker and easier to read (suggestions appreciated!). And maybe you (or someone else) could create a second version of this article adjusted for building an Apple II app.

ksherlock commented 1 year ago

Thanks. That looks good to me.

uliwitness commented 1 year ago

If anyone wants to keep this open as a reminder for adding an Apple ][ tutorial, I'm fine with that. Otherwise, feel free to close this ticket, I personally am happy.

potomak commented 1 year ago

Not sure if I should create a new issue, but for now I'll just add a comment here.

Thanks for the step by step instructions.

I followed the wiki to setup the env and build mpw-sillyballs and I got this error:

$ make all
mkdir -p obj bin
~/src/potomak/mpw/build/bin/mpw MrC -d OLDROUTINENAMES=1 -typecheck relaxed SillyBalls.c -o obj/SillyBalls.ppc.o; \

Unable to find command MrC
$MPW = /Users/gcappellotto/mpw
$Commands = Users:gcappellotto:mpw:Tools:
make: *** [obj/SillyBalls.ppc.o] Error 64

I found the missing MrC (and MrCPP) in a remote directory under Latest Updates from Apple/Files beyond Apple's Notes/Programs, I copied it to Tools. Now I was able to compile, but I got another error:

$ make all
mkdir -p obj bin
~/src/potomak/mpw/build/bin/mpw MrC -d OLDROUTINENAMES=1 -typecheck relaxed SillyBalls.c -o obj/SillyBalls.ppc.o; \

MrC C Compiler 5.0.0d3c1
Copyright (C) 1994-2000 by Apple Computer, Inc.

}
^
File "SillyBalls.c"; line 168 #Warning 30: implied return at closing '}' of main does not return value
#-----------------------
~/src/potomak/mpw/build/bin/mpw PPCLink -m main -w -c 'SILB' -t APPL obj/SillyBalls.ppc.o {SharedLibraries}InterfaceLib {SharedLibraries}StdCLib {PPCLibraries}StdCRuntime.o {PPCLibraries}PPCCRuntime.o -o bin/SillyBalls.ppc; \
    Rez -rd SillyBalls.r -o bin/SillyBalls.ppc -i ~/mpw/Interfaces/RIncludes -append
Unable to find command PPCLink
$MPW = /Users/gcappellotto/mpw
$Commands = Users:gcappellotto:mpw:Tools:
~/src/potomak/mpw/build/bin/mpw SC -d OLDROUTINENAMES=1 -typecheck relaxed SillyBalls.c -o obj/SillyBalls.68k.o
Unable to find command SC
$MPW = /Users/gcappellotto/mpw
$Commands = Users:gcappellotto:mpw:Tools:
make: *** [obj/SillyBalls.68k.o] Error 64

I didn't find PPCLink anywhere, but I was able to find SC (and SCPP) under the same remote directory Latest Updates from Apple/Files beyond Apple's Notes/Programs. I copied it to Tools and retried:

$ make all
mkdir -p obj bin
~/src/potomak/mpw/build/bin/mpw SC -d OLDROUTINENAMES=1 -typecheck relaxed SillyBalls.c -o obj/SillyBalls.68k.o
SC C Compiler 8.9.0d3e1
Copyright (C) 1985-2000 by Apple Computer, Inc.

}
^
File "SillyBalls.c"; line 168 #Warning 30: implied return at closing '}' of main does not return value
#-----------------------
~/src/potomak/mpw/build/bin/mpw link -w -c 'SILB' -t APPL -sn STDIO=Main -sn INTENV=Main -sn %A5Init=Main obj/SillyBalls.68k.o {Libraries}Stubs.o {Libraries}MacRuntime.o {Libraries}IntEnv.o {Libraries}Interface.o {Libraries}ToolLibs.o {CLibraries}StdCLib.o -o bin/SillyBalls.68k
### link: Error: Undefined entry, name: (Error 28) "SysBeep"
  Referenced from: Initialize in file: obj/SillyBalls.68k.o
### link: Error: Undefined entry, name: (Error 28) "qd"
  Referenced from: Initialize in file: obj/SillyBalls.68k.o
### link: Errors prevented normal completion.
make: *** [bin/SillyBalls.68k] Error 2

First of all I was expecting to find MrC and SC in the Tools directory of the copy of MPW that I was able to find online, so maybe I'm mixing and matching incompatible versions of compiler and libraries?

What else am I doing wrong?

It would be great if there was a single zip/sit file with all the files required to build apps (libraries + tools) :)

ksherlock commented 1 year ago

You can grab MPW 3.5 from here:

https://staticky.com/mirrors/ftp.apple.com/developer/Tool_Chest/Core_Mac_OS_Tools/MPW_etc./MPW-GM_Images/MPW-GM.img.bin (which is in MacBinary II format but double clicking in finder will extract it to MPW-GM.img)

OS X won't mount MPW-GM.img directly, anymore, so you need to run Disk Utility -> Images -> Convert... to convert it to a MPW-GM.dmg, which can be mounted. In there you'll find the Tools directory which has PPCLink, MrC, etc.

potomak commented 1 year ago

Thanks for the detailed info.

I downloaded the file, unpacked, but when I try to convert the .img to .dmg I get the error:

Operation failed with status 110: image not recognized

I'm doing this on OS X.

I tried also to add the .img as a volume in the emulator (Basilisk II), but that doesn't work either.

Screen Shot 2022-10-10 at 9 39 05 PM

I also tried to unpack the .img.bin on the emulator and then convert, but I got the same error.

I'm on OS X 11.7, but it's a bit suspicious that nobody else complained about this on the Internet, so I guess I'm doing something wrong.

Update

I was able to read and mount the .img using DiskCopy 6.3.3 (downloaded from here: https://www.macintoshrepository.org/2416-diskcopy-4-2-5-0-5-5-6-0-6-2-6-3-3-6-4-6-5b13-7-0-8-0) from the emulator.

Screen Shot 2022-10-10 at 9 47 45 PM
potomak commented 1 year ago

I retried to compile mpw-sillyballs and I got the same error I shared above:

$ make all
mkdir -p obj bin
~/src/potomak/mpw/build/bin/mpw MrC -d OLDROUTINENAMES=1 -typecheck relaxed SillyBalls.c -o obj/SillyBalls.ppc.o; \

MrC C Compiler 4.1.0f1c1
Copyright (C) 1994-1999 by Apple Computer, Inc.

}
^
File "SillyBalls.c"; line 168 #Warning 30: implied return at closing '}' of main does not return value
#-----------------------
~/src/potomak/mpw/build/bin/mpw PPCLink -m main -w -c 'SILB' -t APPL obj/SillyBalls.ppc.o {SharedLibraries}InterfaceLib {SharedLibraries}StdCLib {PPCLibraries}StdCRuntime.o {PPCLibraries}PPCCRuntime.o -o bin/SillyBalls.ppc; \
    Rez -rd SillyBalls.r -o bin/SillyBalls.ppc -i ~/mpw/Interfaces/RIncludes -append
# Error:  File "obj/SillyBalls.ppc.o"
#         Reference to unresolved symbol "qd"
# 
#  Unresolved external references:
#    qd
# Error:  No output file generated
# Error:  Error 3034 while linking
# Error:  There were unresolved references
# Fatal error: 
PPCLink - Execution terminated!
~/src/potomak/mpw/build/bin/mpw SC -d OLDROUTINENAMES=1 -typecheck relaxed SillyBalls.c -o obj/SillyBalls.68k.o
SC C Compiler 8.8.4f1
Copyright (C) 1985-1999 by Apple Computer, Inc.

}
^
File "SillyBalls.c"; line 168 #Warning 30: implied return at closing '}' of main does not return value
#-----------------------
~/src/potomak/mpw/build/bin/mpw link -w -c 'SILB' -t APPL -sn STDIO=Main -sn INTENV=Main -sn %A5Init=Main obj/SillyBalls.68k.o {Libraries}Stubs.o {Libraries}MacRuntime.o {Libraries}IntEnv.o {Libraries}Interface.o {Libraries}ToolLibs.o {CLibraries}StdCLib.o -o bin/SillyBalls.68k
### link: Error: Undefined entry, name: (Error 28) "SysBeep"
  Referenced from: Initialize in file: obj/SillyBalls.68k.o
### link: Error: Undefined entry, name: (Error 28) "qd"
  Referenced from: Initialize in file: obj/SillyBalls.68k.o
### link: Errors prevented normal completion.
make: *** [bin/SillyBalls.68k] Error 2
potomak commented 1 year ago

I found qd conditionally defined in QuickDraw.h on line 2110 in this block:

#if !OPAQUE_TOOLBOX_STRUCTS || !TARGET_API_MAC_CARBON
struct QDGlobals {
  char                privates[76];
  long                randSeed;               /* in Carbon use GetQDGlobalsRandomSeed*/
  BitMap              screenBits;             /* in Carbon use GetQDGlobalsScreenBits*/
  Cursor              arrow;                  /* in Carbon use GetQDGlobalsArrow*/
  Pattern             dkGray;                 /* in Carbon use GetQDGlobalsDarkGray*/
  Pattern             ltGray;                 /* in Carbon use GetQDGlobalsLightGray*/
  Pattern             gray;                   /* in Carbon use GetQDGlobalsGray*/
  Pattern             black;                  /* in Carbon use GetQDGlobalsBlack*/
  Pattern             white;                  /* in Carbon use GetQDGlobalsWhite*/
  GrafPtr             thePort;                /* in Carbon use GetQDGlobalsThePort*/
};
typedef struct QDGlobals                QDGlobals;
typedef QDGlobals *                     QDGlobalsPtr;
typedef QDGlobalsPtr *                  QDGlobalsHdl;
extern QDGlobals qd;

#endif  /* !OPAQUE_TOOLBOX_STRUCTS || !TARGET_API_MAC_CARBON */

Maybe I need to set TARGET_API_MAC_CARBON or OPAQUE_TOOLBOX_STRUCTS differently (not sure how) to build mpw-sillyballs?

uliwitness commented 1 year ago

Did you get your SillyBalls.c from the same MPW 3.5 image? In mine, this is how the main function looks:

void main(void)
{
    Initialize();

    do {
        NewBall();
    } while (!Button());

}

So there should be no return value needed. Did you maybe get a different version of the file from somewhere else?

ksherlock commented 1 year ago

I can't reproduce the MrC warning or the PPC Link error. This is with a fresh install from the 3.5 golden master.

% ~/bin/mpw MrC -v -d OLDROUTINENAMES=1 -typecheck relaxed SillyBalls.c -o obj/SillyBalls.ppc.o

MrC C Compiler 4.1.0f1c1
Copyright (C) 1994-1999 by Apple Computer, Inc.

'SillyBalls.c'
  'Users:kelvin:mpw:3.5:Interfaces:CIncludes:Types.h'
    'Users:kelvin:mpw:3.5:Interfaces:CIncludes:ConditionalMacros.h'
    'Users:kelvin:mpw:3.5:Interfaces:CIncludes:MacTypes.h'
  'Users:kelvin:mpw:3.5:Interfaces:CIncludes:Memory.h'
    'Users:kelvin:mpw:3.5:Interfaces:CIncludes:MacMemory.h'
      'Users:kelvin:mpw:3.5:Interfaces:CIncludes:MixedMode.h'
  'Users:kelvin:mpw:3.5:Interfaces:CIncludes:Quickdraw.h'
    'Users:kelvin:mpw:3.5:Interfaces:CIncludes:Components.h'
      'Users:kelvin:mpw:3.5:Interfaces:CIncludes:MacErrors.h'
      'Users:kelvin:mpw:3.5:Interfaces:CIncludes:Files.h'
        'Users:kelvin:mpw:3.5:Interfaces:CIncludes:OSUtils.h'
          'Users:kelvin:mpw:3.5:Interfaces:CIncludes:Patches.h'
          'Users:kelvin:mpw:3.5:Interfaces:CIncludes:DateTimeUtils.h'
          'Users:kelvin:mpw:3.5:Interfaces:CIncludes:CFString.h'
            'Users:kelvin:mpw:3.5:Interfaces:CIncludes:CFBase.h'
            'Users:kelvin:mpw:3.5:Interfaces:CIncludes:CFArray.h'
            'Users:kelvin:mpw:3.5:Interfaces:CIncludes:CFData.h'
            'Users:kelvin:mpw:3.5:Interfaces:CIncludes:CFDictionary.h'
            'Users:kelvin:mpw:3.5:Interfaces:CIncludes:stdarg.h'
              'Users:kelvin:mpw:3.5:Interfaces:CIncludes:NullDef.h'
              'Users:kelvin:mpw:3.5:Interfaces:CIncludes:SizeTDef.h'
              'Users:kelvin:mpw:3.5:Interfaces:CIncludes:VaListTDef.h'
        'Users:kelvin:mpw:3.5:Interfaces:CIncludes:TextCommon.h'
        'Users:kelvin:mpw:3.5:Interfaces:CIncludes:UTCUtils.h'
        'Users:kelvin:mpw:3.5:Interfaces:CIncludes:Finder.h'
    'Users:kelvin:mpw:3.5:Interfaces:CIncludes:QuickdrawText.h'
      'Users:kelvin:mpw:3.5:Interfaces:CIncludes:IntlResources.h'
    'Users:kelvin:mpw:3.5:Interfaces:CIncludes:CGContext.h'
      'Users:kelvin:mpw:3.5:Interfaces:CIncludes:CGBase.h'
        'Users:kelvin:mpw:3.5:Interfaces:CIncludes:stddef.h'
          'Users:kelvin:mpw:3.5:Interfaces:CIncludes:WCharTDef.h'
      'Users:kelvin:mpw:3.5:Interfaces:CIncludes:CGAffineTransform.h'
        'Users:kelvin:mpw:3.5:Interfaces:CIncludes:CGGeometry.h'
      'Users:kelvin:mpw:3.5:Interfaces:CIncludes:CGColorSpace.h'
        'Users:kelvin:mpw:3.5:Interfaces:CIncludes:CGDataProvider.h'
          'Users:kelvin:mpw:3.5:Interfaces:CIncludes:CFURL.h'
      'Users:kelvin:mpw:3.5:Interfaces:CIncludes:CGFont.h'
      'Users:kelvin:mpw:3.5:Interfaces:CIncludes:CGImage.h'
      'Users:kelvin:mpw:3.5:Interfaces:CIncludes:CGPDFDocument.h'
  'Users:kelvin:mpw:3.5:Interfaces:CIncludes:Fonts.h'
    'Users:kelvin:mpw:3.5:Interfaces:CIncludes:ATSTypes.h'
  'Users:kelvin:mpw:3.5:Interfaces:CIncludes:Events.h'
  'Users:kelvin:mpw:3.5:Interfaces:CIncludes:Menus.h'
    'Users:kelvin:mpw:3.5:Interfaces:CIncludes:Processes.h'
    'Users:kelvin:mpw:3.5:Interfaces:CIncludes:AppleEvents.h'
      'Users:kelvin:mpw:3.5:Interfaces:CIncludes:AEDataModel.h'
      'Users:kelvin:mpw:3.5:Interfaces:CIncludes:AEInteraction.h'
        'Users:kelvin:mpw:3.5:Interfaces:CIncludes:Notification.h'
    'Users:kelvin:mpw:3.5:Interfaces:CIncludes:Collections.h'
  'Users:kelvin:mpw:3.5:Interfaces:CIncludes:Windows.h'
    'Users:kelvin:mpw:3.5:Interfaces:CIncludes:MacWindows.h'
      'Users:kelvin:mpw:3.5:Interfaces:CIncludes:Aliases.h'
      'Users:kelvin:mpw:3.5:Interfaces:CIncludes:Drag.h'
      'Users:kelvin:mpw:3.5:Interfaces:CIncludes:QDOffscreen.h'
      'Users:kelvin:mpw:3.5:Interfaces:CIncludes:Icons.h'
        'Users:kelvin:mpw:3.5:Interfaces:CIncludes:CodeFragments.h'
          'Users:kelvin:mpw:3.5:Interfaces:CIncludes:CFBundle.h'
          'Users:kelvin:mpw:3.5:Interfaces:CIncludes:Multiprocessing.h'
  'Users:kelvin:mpw:3.5:Interfaces:CIncludes:TextEdit.h'
  'Users:kelvin:mpw:3.5:Interfaces:CIncludes:Dialogs.h'
    'Users:kelvin:mpw:3.5:Interfaces:CIncludes:Controls.h'
    'Users:kelvin:mpw:3.5:Interfaces:CIncludes:CarbonEvents.h'
      'Users:kelvin:mpw:3.5:Interfaces:CIncludes:AERegistry.h'
  'Users:kelvin:mpw:3.5:Interfaces:CIncludes:Sound.h'
  'Users:kelvin:mpw:3.5:Interfaces:CIncludes:ToolUtils.h'
    'Users:kelvin:mpw:3.5:Interfaces:CIncludes:FixMath.h'
    'Users:kelvin:mpw:3.5:Interfaces:CIncludes:TextUtils.h'
      'Users:kelvin:mpw:3.5:Interfaces:CIncludes:NumberFormatting.h'
      'Users:kelvin:mpw:3.5:Interfaces:CIncludes:StringCompare.h'
        'Users:kelvin:mpw:3.5:Interfaces:CIncludes:Script.h'
        'Users:kelvin:mpw:3.5:Interfaces:CIncludes:TypeSelect.h'
  main
  Initialize
  NewBall
MrC[pp] 4.1 PPC Code Generator
166 instructions (664 code bytes) generated in 0 seconds

% ~/bin/mpw PPCLink -m main -w -c 'SILB' -t APPL obj/SillyBalls.ppc.o {SharedLibraries}InterfaceLib {SharedLibraries}StdCLib {PPCLibraries}StdCRuntime.o {PPCLibraries}PPCCRuntime.o -o bin/SillyBalls.ppc

PPCLink 1.5.2

 Reading files
 … obj/SillyBalls.ppc.o
 … [InterfaceLib] {SharedLibraries}InterfaceLib
 … [StdCLib] {SharedLibraries}StdCLib
 … {PPCLibraries}StdCRuntime.o
 … {PPCLibraries}PPCCRuntime.o

 Finding Main entry point: "main"

 Following live references

 Writing output file
 … data
 … code
 … PEF Container
 uncompressed data size:  128
 compressed data size:    28
 optimized size:          27
 Input reloc count:  29
 Output reloc count: 4
potomak commented 1 year ago

Yes, that was it, the version of SillyBalls.c that I found in the MPW compiled correctly! Thanks so much for your help.

Just out of curiosity this is the difference between the two example programs:

$ diff SillyBalls.c SillyBalls.c.bak 
11c11
< # Copyright ? 1988, 1995 Apple Computer, Inc.
---
> # Copyright ? 1988 Apple Computer, Inc.
141c141
< #include <Sound.h>
---
> #include <OSUtils.h>
143c143
< #include <Processes.h>
---
> #include <SegLoad.h>
151,156c151,152
< Rect      windRect;
< 
< /* The qd global has been removed from the libraries */
< QDGlobals qd;
< 
< 
---
> Rect  windRect;
>   
164c160
< void main(void)
---
> main()
177c173
< void Initialize(void)
---
> void Initialize()
229c225
< void NewBall(void)
---
> void NewBall()
280a277
> 

And here is the result:

Screen Shot 2022-10-12 at 7 34 07 PM
uliwitness commented 1 year ago

Those are some weird modifications; removing the void from the parameter list only makes sense if you're running the code in a C++ compiler (otherwise that gives you K&R syntax and eliminates parameter checking -- bad idea), and removing the return type on main means it implicitly becomes int.

Anyway, since @potomak is happy and my issue was resolved as well, I think I'll close this issue. Don't want to make the project look bad by leaving lots of old open issues. Thanks again for all the help, and for making this emulator in the first place, @ksherlock !

mathieutozer commented 1 year ago

I followed the instructions too, but now I have an issue where the includes aren't being found, not sure if I should create another issue but:

(base) tozer@Mathieus-Laptop sillyballs % make all                             
mkdir -p obj bin
/usr/local/bin/mpw SC -d OLDROUTINENAMES=1 -typecheck relaxed SillyBalls.c -o obj/SillyBalls.68k.o
C Compiler 8.1.0 Copyright (C) 1985-1996 by Symantec Corporation
   (written by Walter Bright, adapted to the 68000 by Symantec)

#include <Types.h>
                ^
File "SillyBalls.c"; line 132 #Fatal error: unable to open input file 'Types.h'
#-----------------------
make: *** [obj/SillyBalls.68k.o] Error 1

The files are located here:

(base) tozer@Mathieus-Laptop sillyballs % ls ~/mpw/Interfaces/CIncludes/Types.h
/Users/tozer/mpw/Interfaces/CIncludes/Types.h

Might this have to do with my path? I added an extra forward slash to the end, but that didn't make any difference (which seems suspicious)

(base) tozer@Mathieus-Laptop sillyballs % echo $MPW
/Users/tozer/mpw/
mathieutozer commented 1 year ago

Interesting - I tried this and it appears to be ok, prompting me to think maybe it's just a 68k issue

sillyballs % mpw MrC -v -d OLDROUTINENAMES=1 -typecheck relaxed _SillyBalls.c -o obj/SillyBalls.ppc.o
MrC C Compiler 3.0.1f1c12
Copyright (C) 1994-1997 by Apple Computer, Inc.

'_SillyBalls.c'
  'Users:tozer:mpw:Interfaces:CIncludes:Types.h'
    'Users:tozer:mpw:Interfaces:CIncludes:ConditionalMacros.h'
  'Users:tozer:mpw:Interfaces:CIncludes:Memory.h'
    'Users:tozer:mpw:Interfaces:CIncludes:MixedMode.h'
  'Users:tozer:mpw:Interfaces:CIncludes:Quickdraw.h'
    'Users:tozer:mpw:Interfaces:CIncludes:QuickdrawText.h'
  'Users:tozer:mpw:Interfaces:CIncludes:Fonts.h'
  'Users:tozer:mpw:Interfaces:CIncludes:Events.h'
    'Users:tozer:mpw:Interfaces:CIncludes:OSUtils.h'
  'Users:tozer:mpw:Interfaces:CIncludes:Menus.h'
  'Users:tozer:mpw:Interfaces:CIncludes:Windows.h'
    'Users:tozer:mpw:Interfaces:CIncludes:Controls.h'
  'Users:tozer:mpw:Interfaces:CIncludes:TextEdit.h'
  'Users:tozer:mpw:Interfaces:CIncludes:Dialogs.h'
    'Users:tozer:mpw:Interfaces:CIncludes:Errors.h'
  'Users:tozer:mpw:Interfaces:CIncludes:ToolUtils.h'
    'Users:tozer:mpw:Interfaces:CIncludes:TextUtils.h'
      'Users:tozer:mpw:Interfaces:CIncludes:Script.h'
        'Users:tozer:mpw:Interfaces:CIncludes:IntlResources.h'
    'Users:tozer:mpw:Interfaces:CIncludes:FixMath.h'
    'Users:tozer:mpw:Interfaces:CIncludes:Icons.h'
  'Users:tozer:mpw:Interfaces:CIncludes:Processes.h'
    'Users:tozer:mpw:Interfaces:CIncludes:Files.h'
  main
MrC C Compiler 3.0.1f1c12
Copyright (C) 1994-1997 by Apple Computer, Inc.

}
^
File "_SillyBalls.c"; line 172 #Warning 30: implied return at closing '}' of main does not return value
#-----------------------
  Initialize
  NewBall
Apple PPC Code Generator, 3.0.1
166 instructions (664 code bytes) generated in 0 seconds

Commenting the 68k build from the makefile compiles for PPC fine. My toolset is MPWVersion ?= 3.4.2 if that helps.