diff --git a/ports/mac/ElWhip.c b/ports/mac/ElWhip.c index bf91760..44dcf9e 100644 --- a/ports/mac/ElWhip.c +++ b/ports/mac/ElWhip.c @@ -1 +1 @@ -/* ElWhip.c * * * Created by Eric Pooch on 1/26/14. * Copyright 2014 __MyCompanyName__. All rights reserved. * */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "arch/macos_debug.h" #include #include #include "ElWhip.h" #include "test.h" /* GMac is used to hold the result of a SysEnvirons call. This makes it convenient for any routine to check the environment. */ SysEnvRec gMac; /* set up by Initialize */ /* GHasWaitNextEvent is set at startup, and tells whether the WaitNextEvent trap is available. If it is false, we know that we must call GetNextEvent. */ //Boolean gHasWaitNextEvent; /* set up by Initialize */ /* GInBackground is maintained by our osEvent handling routines. Any part of the program can check it to find out if it is currently in the background. */ Boolean gInBackground; /* maintained by Initialize and DoEvent */ /* Here are declarations for all of the C routines. In MPW 3.0 we can use actual prototypes for parameter type checking. */ void EventLoop( void ); void DoEvent( EventRecord *event ); void DoMenuCommand( long menuResult ); void MemoryInit( void ); void MacintoshInit( void ); void Restart(void); void Terminate( void ); void GetTERect(WindowPtr window, Rect *teRect); Boolean TrapAvailable( short tNumber, TrapType tType ); void AlertUser( void ); /* Define HiWrd and LoWrd macros for efficiency. */ #define HiWrd(aLong) (((aLong) >> 16) & 0xFFFF) #define LoWrd(aLong) ((aLong) & 0xFFFF) /* This routine is part of the MPW runtime library. This external reference to it is done so that we can unload its segment, %A5Init. */ extern void _DataInit(); int main(void) { OSErr error = 0; FILE *fildes; char buff[255]; UnloadSeg((Ptr) _DataInit); MemoryInit(); MacintoshInit(); /* initialize the program */ test_init(); EventLoop(); /* call the main event loop */ return 0; } /* Get events forever, and handle them by calling DoEvent. Get the events by calling WaitNextEvent, if it's available, otherwise by calling GetNextEvent. Also call AdjustCursor each time through the loop. */ #pragma segment Main void EventLoop() { Boolean gotEvent; EventRecord event; RgnHandle cursorRgn; do { /* use WNE if it is available */ //if ( gHasWaitNextEvent ) //{ // gotEvent = WaitNextEvent(everyEvent, &event, MAXLONG, cursorRgn); //} else //{ SystemTask(); gotEvent = GetNextEvent(everyEvent, &event); //} if ( gotEvent ) { /* Handle the event */ DoEvent(&event); } test_poll(); } while ( true ); /* loop forever; we quit via ExitToShell */ } /*EventLoop*/ /* Do the right thing for an event. Determine what kind of event it is, and call the appropriate routines. */ void DoEvent( EventRecord *event ) { short part, err; WindowPtr window; Boolean hit; char key; switch ( event->what ) { case mouseDown: part = FindWindow(event->where, &window); switch ( part ) { case inMenuBar: /* process a mouse menu command (if any) */ DoMenuCommand(MenuSelect(event->where)); break; case inSysWindow: /* let the system handle the mouseDown */ SystemClick(event, window); break; } break; case keyDown: case autoKey: /* check for menukey equivalents */ key = event->message & charCodeMask; if ( event->modifiers & cmdKey ) /* Command key down */ { if ( event->what == keyDown ) { DoMenuCommand(MenuKey(key)); } } break; case kOSEvent: /* 1.02 - must BitAND with 0x0FF to get only low byte */ switch ((event->message >> 24) & 0x0FF) { /* high byte of message */ case kSuspendResumeMessage: /* suspend/resume is also an activate/deactivate */ gInBackground = (event->message & kResumeMask) == 0; //DoActivate(FrontWindow(), !gInBackground); break; } break; } } /*DoEvent*/ /* This is called when an item is chosen from the menu bar (after calling MenuSelect or MenuKey). It performs the right operation for each command. It is good to have both the result of MenuSelect and MenuKey go to one routine like this to keep everything organized. */ void DoMenuCommand(long menuResult) { short menuID = HiWord(menuResult); /* the resource ID of the selected menu */ short menuItem = LoWord(menuResult); /* the item number of the selected menu */ short itemHit; Str255 daName; short daRefNum; Boolean handledByDA; switch ( menuID ) { case mApple: switch ( menuItem ) { case iAbout: /* bring up alert for About */ itemHit = Alert(rAboutAlert, nil); break; default: /* all non-About items in this menu are DAs */ /* type Str255 is an array in MPW 3 */ GetItem(GetMHandle(mApple), menuItem, daName); daRefNum = OpenDeskAcc(daName); break; } break; case mFile: switch ( menuItem ) { case iQuit: Terminate(); break; } break; } HiliteMenu(0); /* unhighlight what MenuSelect (or MenuKey) hilited */ } /*DoMenuCommand*/ #pragma segment LWUPDN void MemoryInit() { /* If you have stack requirements that differ from the default, then you could use SetApplLimit to increase StackSpace at this point, before calling MaxApplZone. */ MaxApplZone(); /* expand the heap so code segments load at the top */ //LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, ("App Limit: %lu \n", (long)GetApplLimit() )); //LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, ("Free Memory: %lu \n", (long)FreeMem() )); } /* Set up the whole world, including global variables, Toolbox managers, and menus. */ void MacintoshInit() { Handle menuBar; WindowPtr window; long total, contig; EventRecord event; short count; gInBackground = false; InitGraf((Ptr) &qd.thePort); InitFonts(); InitWindows(); InitMenus(); InitDialogs(nil); InitCursor(); /* Allow the default button of our alert be outlined. */ for (count = 1; count <= 3; count++) EventAvail(everyEvent, &event); SysEnvirons(kSysEnvironsVersion, &gMac); /* Make sure that the machine has at least 128K ROMs. If it doesn't, exit. */ //if (gMac.machineType < 0) AlertUser(); /* 1.02 - Move TrapAvailable call to after SysEnvirons so that we can tell in TrapAvailable if a tool trap value is out of range. */ // gHasWaitNextEvent = TrapAvailable(_WaitNextEvent, ToolTrap); // if ((long) GetApplLimit() - (long) ApplicZone() < kMinHeap) AlertUser(); /* ZeroScrap(); */ //PurgeSpace(&total, &contig); //if (total < kMinSpace) AlertUser(); menuBar = GetNewMBar(rMenuBar); /* read menus into menu bar */ if ( menuBar == nil ) AlertUser(); SetMenuBar(menuBar); /* install menus */ DisposHandle(menuBar); AddResMenu(GetMHandle(mApple), 'DRVR'); /* add DA names to Apple menu */ DrawMenuBar(); #ifdef MACOS_BROWSER BrowserInit(); #endif } /*Initialize*/ #pragma segment Main void Terminate() { test_stop(); ExitToShell(); /* exit if no cancellation */ } /*Terminate*/ void Restart(void) { test_restart(); //UnloadSeg((Ptr) MacintoshInit); } /* Return a rectangle that is inset from the portRect by the size of the scrollbars and a little extra margin. */ void GetTERect(WindowPtr window, Rect *teRect) { *teRect = window->portRect; InsetRect(teRect, kTextMargin, kTextMargin); /* adjust for margin */ teRect->bottom = teRect->bottom - kScrollWidth; /* and for the scrollbars */ teRect->right = teRect->right - kScrollWidth; } /*GetTERect*/ /* Check to see if a window belongs to a desk accessory. */ Boolean IsDAWindow(WindowPtr window) { if ( window == nil ) return false; else /* DA windows have negative windowKinds */ return ((WindowPeek) window)->windowKind < 0; } /*IsDAWindow*/ void AlertUser() { short itemHit; SetCursor(&qd.arrow); itemHit = Alert(rUserAlert, nil); ExitToShell(); } /* AlertUser */ /* Check to see if a given trap is implemented. This is only used by the Initialize routine in this program, so we put it in the Initialize segment. The recommended approach to see if a trap is implemented is to see if the address of the trap routine is the same as the address of the Unimplemented trap. */ #pragma segment LWUPDN Boolean TrapAvailable(short tNumber, TrapType tType) { if ( ( tType == ToolTrap ) && ( gMac.machineType > envMachUnknown ) && ( gMac.machineType < envMacII ) ) { /* it's a 512KE, Plus, or SE */ tNumber = tNumber & 0x03FF; if ( tNumber > 0x01FF ) /* which means the tool traps */ tNumber = _Unimplemented; /* only go to 0x01FF */ } return NGetTrapAddress(tNumber, tType) != GetTrapAddress(_Unimplemented); } /*TrapAvailable*/ \ No newline at end of file +/* ElWhip.c * * * Created by Eric Pooch on 1/26/14. * Copyright 2014 __MyCompanyName__. All rights reserved. * */ #ifdef LIBS_OLD // This is for 3.1 Libraries/Headers #include #else // This is for 3.5 Libraries/Headers #define OLDROUTINENAMES 1 #include #include #include #include QDGlobals qd; #endif #include #include #include #include #include #include #include #include #include #include #include "arch/macos_debug.h" #include #include #include "ElWhip.h" #include "test.h" /* GMac is used to hold the result of a SysEnvirons call. This makes it convenient for any routine to check the environment. */ SysEnvRec gMac; /* set up by Initialize */ /* GHasWaitNextEvent is set at startup, and tells whether the WaitNextEvent trap is available. If it is false, we know that we must call GetNextEvent. */ //Boolean gHasWaitNextEvent; /* set up by Initialize */ /* GInBackground is maintained by our osEvent handling routines. Any part of the program can check it to find out if it is currently in the background. */ Boolean gInBackground; /* maintained by Initialize and DoEvent */ /* Here are declarations for all of the C routines. In MPW 3.0 we can use actual prototypes for parameter type checking. */ void EventLoop( void ); void DoEvent( EventRecord *event ); void DoMenuCommand( long menuResult ); void MemoryInit( void ); void MacintoshInit( void ); void Restart(void); void Terminate( void ); void GetTERect(WindowPtr window, Rect *teRect); Boolean TrapAvailable( short tNumber, TrapType tType ); void AlertUser( void ); /* Define HiWrd and LoWrd macros for efficiency. */ #define HiWrd(aLong) (((aLong) >> 16) & 0xFFFF) #define LoWrd(aLong) ((aLong) & 0xFFFF) /* This routine is part of the MPW runtime library. This external reference to it is done so that we can unload its segment, %A5Init. */ extern void _DataInit(); int main(void) { OSErr error = 0; FILE *fildes; char buff[255]; UnloadSeg((Ptr) _DataInit); MemoryInit(); MacintoshInit(); /* initialize the program */ test_init(); EventLoop(); /* call the main event loop */ return 0; } /* Get events forever, and handle them by calling DoEvent. Get the events by calling WaitNextEvent, if it's available, otherwise by calling GetNextEvent. Also call AdjustCursor each time through the loop. */ #pragma segment Main void EventLoop() { Boolean gotEvent; EventRecord event; RgnHandle cursorRgn; do { /* use WNE if it is available */ //if ( gHasWaitNextEvent ) //{ // gotEvent = WaitNextEvent(everyEvent, &event, MAXLONG, cursorRgn); //} else //{ SystemTask(); gotEvent = GetNextEvent(everyEvent, &event); //} if ( gotEvent ) { /* Handle the event */ DoEvent(&event); } test_poll(); } while ( true ); /* loop forever; we quit via ExitToShell */ } /*EventLoop*/ /* Do the right thing for an event. Determine what kind of event it is, and call the appropriate routines. */ void DoEvent( EventRecord *event ) { short part, err; WindowPtr window; Boolean hit; char key; switch ( event->what ) { case mouseDown: part = FindWindow(event->where, &window); switch ( part ) { case inMenuBar: /* process a mouse menu command (if any) */ DoMenuCommand(MenuSelect(event->where)); break; case inSysWindow: /* let the system handle the mouseDown */ SystemClick(event, window); break; } break; case keyDown: case autoKey: /* check for menukey equivalents */ key = event->message & charCodeMask; if ( event->modifiers & cmdKey ) /* Command key down */ { if ( event->what == keyDown ) { DoMenuCommand(MenuKey(key)); } } break; case kOSEvent: /* 1.02 - must BitAND with 0x0FF to get only low byte */ switch ((event->message >> 24) & 0x0FF) { /* high byte of message */ case kSuspendResumeMessage: /* suspend/resume is also an activate/deactivate */ gInBackground = (event->message & kResumeMask) == 0; //DoActivate(FrontWindow(), !gInBackground); break; } break; } } /*DoEvent*/ /* This is called when an item is chosen from the menu bar (after calling MenuSelect or MenuKey). It performs the right operation for each command. It is good to have both the result of MenuSelect and MenuKey go to one routine like this to keep everything organized. */ void DoMenuCommand(long menuResult) { short menuID = HiWord(menuResult); /* the resource ID of the selected menu */ short menuItem = LoWord(menuResult); /* the item number of the selected menu */ short itemHit; Str255 daName; short daRefNum; Boolean handledByDA; switch ( menuID ) { case mApple: switch ( menuItem ) { case iAbout: /* bring up alert for About */ itemHit = Alert(rAboutAlert, nil); break; default: /* all non-About items in this menu are DAs */ /* type Str255 is an array in MPW 3 */ GetItem(GetMHandle(mApple), menuItem, daName); daRefNum = OpenDeskAcc(daName); break; } break; case mFile: switch ( menuItem ) { case iQuit: Terminate(); break; } break; } HiliteMenu(0); /* unhighlight what MenuSelect (or MenuKey) hilited */ } /*DoMenuCommand*/ #pragma segment LWUPDN void MemoryInit() { /* If you have stack requirements that differ from the default, then you could use SetApplLimit to increase StackSpace at this point, before calling MaxApplZone. */ MaxApplZone(); /* expand the heap so code segments load at the top */ //LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, ("App Limit: %lu \n", (long)GetApplLimit() )); //LWIP_DEBUGF(LWIP_DBG_LEVEL_WARNING, ("Free Memory: %lu \n", (long)FreeMem() )); } /* Set up the whole world, including global variables, Toolbox managers, and menus. */ void MacintoshInit() { Handle menuBar; WindowPtr window; long total, contig; EventRecord event; short count; gInBackground = false; InitGraf((Ptr) &qd.thePort); InitFonts(); InitWindows(); InitMenus(); InitDialogs(nil); InitCursor(); /* Allow the default button of our alert be outlined. */ for (count = 1; count <= 3; count++) EventAvail(everyEvent, &event); SysEnvirons(kSysEnvironsVersion, &gMac); /* Make sure that the machine has at least 128K ROMs. If it doesn't, exit. */ //if (gMac.machineType < 0) AlertUser(); /* 1.02 - Move TrapAvailable call to after SysEnvirons so that we can tell in TrapAvailable if a tool trap value is out of range. */ // gHasWaitNextEvent = TrapAvailable(_WaitNextEvent, ToolTrap); // if ((long) GetApplLimit() - (long) ApplicZone() < kMinHeap) AlertUser(); /* ZeroScrap(); */ //PurgeSpace(&total, &contig); //if (total < kMinSpace) AlertUser(); menuBar = GetNewMBar(rMenuBar); /* read menus into menu bar */ if ( menuBar == nil ) AlertUser(); SetMenuBar(menuBar); /* install menus */ DisposHandle(menuBar); AddResMenu(GetMHandle(mApple), 'DRVR'); /* add DA names to Apple menu */ DrawMenuBar(); #ifdef MACOS_BROWSER BrowserInit(); #endif } /*Initialize*/ #pragma segment Main void Terminate() { test_stop(); ExitToShell(); /* exit if no cancellation */ } /*Terminate*/ void Restart(void) { test_restart(); //UnloadSeg((Ptr) MacintoshInit); } /* Return a rectangle that is inset from the portRect by the size of the scrollbars and a little extra margin. */ void GetTERect(WindowPtr window, Rect *teRect) { *teRect = window->portRect; InsetRect(teRect, kTextMargin, kTextMargin); /* adjust for margin */ teRect->bottom = teRect->bottom - kScrollWidth; /* and for the scrollbars */ teRect->right = teRect->right - kScrollWidth; } /*GetTERect*/ /* Check to see if a window belongs to a desk accessory. */ Boolean IsDAWindow(WindowPtr window) { if ( window == nil ) return false; else /* DA windows have negative windowKinds */ return ((WindowPeek) window)->windowKind < 0; } /*IsDAWindow*/ void AlertUser() { short itemHit; SetCursor(&qd.arrow); itemHit = Alert(rUserAlert, nil); ExitToShell(); } /* AlertUser */ /* Check to see if a given trap is implemented. This is only used by the Initialize routine in this program, so we put it in the Initialize segment. The recommended approach to see if a trap is implemented is to see if the address of the trap routine is the same as the address of the Unimplemented trap. */ #pragma segment LWUPDN Boolean TrapAvailable(short tNumber, TrapType tType) { if ( ( tType == ToolTrap ) && ( gMac.machineType > envMachUnknown ) && ( gMac.machineType < envMacII ) ) { /* it's a 512KE, Plus, or SE */ tNumber = tNumber & 0x03FF; if ( tNumber > 0x01FF ) /* which means the tool traps */ tNumber = _Unimplemented; /* only go to 0x01FF */ } return NGetTrapAddress(tNumber, tType) != GetTrapAddress(_Unimplemented); } /*TrapAvailable*/ \ No newline at end of file diff --git a/ports/mac/Makefile b/ports/mac/Makefile index 1c44cd9..fda6159 100644 --- a/ports/mac/Makefile +++ b/ports/mac/Makefile @@ -1 +1 @@ -# File: Makefile # Target: TestEcho (MPW 3.1 libraries), ElWhip (MPW 3.1 libraries) # Created: Sunday, November 29, 2009 11:11:08 PM # # ElWhip uses MPW 3.5 and Link (rather than iLink) and the Libraries and Interfaces # from MPW 3.1 to build a program to run on all System versions, # even earlier than System 6.08. # Copy (or make an Alias of) the Interfaces:CIncludes and Libraries folders from # MPW 3.1 and name them Interfaces:CIncludes-3.1 and Libraries-3.1 Program = "ElWhip" MAKEFILE = MakeFile #¥MondoBuild¥ = {MAKEFILE} # Make blank to avoid rebuilds when makefile is modified ¥MondoBuild¥ = Vers = v0.7.1 ObjDir = : SrcDir = ::::lwip:src: IncDir = {SrcDir}include: APISrc = "{SrcDir}api:" CoreSrc = "{SrcDir}core:" IPV4Src = "{CoreSrc}ipv4:" NetISrc = "{SrcDir}netif:" PPPISrc = "{NetISrc}ppp:" ContribDir = ::: PortsDir = {ContribDir}ports: AppsDir = {ContribDir}apps: MacSrc = {PortsDir}mac: # Use the includes from MPW 3.1 Includes = ¶ -i "{CIncludes}:CIncludes-3.1:" ¶ -i {MacSrc}include: ¶ -i {MacSrc}include:arch: ¶ -i {AppsDir} ¶ -i {IncDir} ¶ -i {IncDir}lwip: ¶ -i {IncDir}ipv4: ¶ -i {IncDir}ipv6: ¶ -i {IncDir}netif: ¶ -i {AppsDir}httpserver_raw: ¶ -i {IncDir}netif:ppp: # -i {IncDir}netif:ppp:polarssl: Sym-68K = -sym off COptions = -includes unix {Includes} {Sym-68K} -mbg off -model near -opt space -w off #-includes unix #-model far LOptions = -mf -d -t 'APPL' -c 'LWIP' -model near AddDebugOpt = -d LWIP_DEBUG -u LWIP_NOASSERT NoDebugOpt = -u LWIP_DEBUG -d LWIP_NOASSERT ### Source Files ### SrcFiles = {MacSrc}test.c ¶ {MacSrc}sys_arch.c ¶ {MacSrc}sio.c ¶ # {AppsDir}tcpecho_raw:echo.c ¶ {AppsDir}httpserver_raw:httpd.c ¶ {AppsDir}httpserver_raw:fs.c ¶ {APISrc}err.c ¶ # {CoreSrc}init.c ¶ # {CoreSrc}mem.c ¶ {CoreSrc}memp.c ¶ {CoreSrc}netif.c ¶ {CoreSrc}inet_chksum.c ¶ {CoreSrc}pbuf.c ¶ {CoreSrc}raw.c ¶ # {CoreSrc}stats.c ¶ {CoreSrc}tcp_in.c ¶ {CoreSrc}tcp_out.c ¶ {CoreSrc}tcp.c ¶ # {CoreSrc}udp.c ¶ {CoreSrc}timers.c ¶ # {IPV4Src}icmp.c ¶ # {IPV4Src}igmp.c ¶ {IPV4Src}ip4.c ¶ {IPV4Src}ip4_addr.c ¶ # {IPV4Src}ip_frag.c ¶ # {NetISrc}etharp.c ¶ # {NetISrc}slipif.c ¶ {PPPISrc}ppp.c ¶ {PPPISrc}lcp.c ¶ {PPPISrc}magic.c ¶ {PPPISrc}auth.c ¶ # {PPPISrc}upap.c ¶ {PPPISrc}ipcp.c ¶ {PPPISrc}utils.c ¶ {PPPISrc}fsm.c # {PPPISrc}polarssl:md5.c ### Object Files ### ObjectFiles = "{MacSrc}sys_arch.c.l.o" ¶ "{MacSrc}sio.c.p.o" ¶ # "{AppsDir}echo.c.a.o" ¶ "{AppsDir}httpserver_raw:httpd.c.a.o" ¶ "{AppsDir}httpserver_raw:fs.c.a.o" ¶ "{SrcDir}err.c.l.o" ¶ # "{SrcDir}init.c.l.o" ¶ # "{SrcDir}mem.c.l.o" ¶ "{SrcDir}memp.c.l.o" ¶ "{SrcDir}netif.c.ud.o" ¶ "{SrcDir}inet_chksum.c.l.o" ¶ "{SrcDir}pbuf.c.l.o" ¶ "{SrcDir}raw.c.l.o" ¶ # "{SrcDir}stats.c.l.o" ¶ "{SrcDir}tcp_in.c.l.o" ¶ "{SrcDir}tcp_out.c.l.o" ¶ "{SrcDir}tcp.c.l.o" ¶ # "{SrcDir}udp.c.l.o" ¶ "{SrcDir}timers.c.l.o" ¶ # "{SrcDir}autoip.c.l.o" ¶ # "{SrcDir}icmp.c.l.o" ¶ # "{SrcDir}igmp.c.l.o" ¶ "{SrcDir}ip4.c.l.o" ¶ "{SrcDir}ip4_addr.c.l.o" ¶ # "{SrcDir}ip_frag.c.l.o" ¶ # "{NetISrc}etharp.c.l.o" ¶ # "{NetISrc}slipif.c.p.o" ¶ "{NetISrc}ppp.c.p.o" ¶ "{NetISrc}lcp.c.ud.o" ¶ "{NetISrc}magic.c.p.o" ¶ "{NetISrc}auth.c.ud.o" ¶ # "{NetISrc}upap.c.p.o" ¶ "{NetISrc}ipcp.c.ud.o" ¶ "{NetISrc}utils.c.p.o" ¶ "{NetISrc}fsm.c.ud.o" # "{NetISrc}md5.c.p.o" ### Libraries ### # Use the Libraries from MPW 3.1 CLibraries-Old = {CLibraries}::Libraries-3.1:CLibraries: Libraries-Old = {Libraries}::Libraries-3.1:Libraries: #CLibraries-Old = {CLibraries} #Libraries-Old = {Libraries LibFiles-Old = ¶ # "{CLibraries-Old}CSANELib.o" ¶ # "{CLibraries-Old}Math.o" ¶ # "{CLibraries-Old}Complex.o" ¶ "{CLibraries-Old}StdCLib.o" ¶ "{CLibraries-Old}CInterface.o" ¶ "{CLibraries-Old}CRuntime.o" ¶ # "{Libraries-Old}ToolLibs.o" ¶ # "{Libraries-Old}Runtime.o" ¶ "{Libraries-Old}Interface.o" LibFiles-68K = ¶ # "{Libraries}MathLib.o" ¶ "{CLibraries}StdCLib.o" ¶ "{Libraries}MacRuntime.o" ¶ "{Libraries}IntEnv.o" ¶ "{Libraries}Interface.o" # Special case because of the /r/n issues. "{AppsDir}httpserver_raw:httpd.c.a.o" Ä "{AppsDir}httpserver_raw:httpd.c" {C} {Deps} -o {Targ} {COptions} -noMapCR {NoDebugOpt} -seg LWAPP ### Default Rules ### .c.m.o Ä .c {¥MondoBuild¥} {C} {depDir}{default}.c -o {targDir}{default}.c.m.o {COptions} {NoDebugOpt} -seg Main .c.n.o Ä .c {¥MondoBuild¥} {C} {depDir}{default}.c -o {targDir}{default}.c.n.o {COptions} {NoDebugOpt} -seg Main -d TEST_MAIN_DISABLE .c.pp.o Ä .c {¥MondoBuild¥} {C} {depDir}{default}.c -o {targDir}{default}.c.pp.o {COptions} {NoDebugOpt} -seg LWPPPL .c.p.o Ä .c {¥MondoBuild¥} {C} {depDir}{default}.c -o {targDir}{default}.c.p.o {COptions} {NoDebugOpt} -seg LWPPP .c.ud.o Ä .c {¥MondoBuild¥} {C} {depDir}{default}.c -o {targDir}{default}.c.ud.o {COptions} {NoDebugOpt} -seg LWUPDN .c.a.o Ä .c {¥MondoBuild¥} {C} {depDir}{default}.c -o {targDir}{default}.c.a.o {COptions} {NoDebugOpt} -seg LWAPP .c.l.o Ä .c {¥MondoBuild¥} {C} {depDir}{default}.c -o {targDir}{default}.c.l.o {COptions} {NoDebugOpt} -seg LWTCPIP .c.o Ä .c {¥MondoBuild¥} {C} {depDir}{default}.c -o {targDir}{default}.c.o {COptions} {NoDebugOpt} -seg Main {MacSrc} Ä {MacSrc} {NetISrc} Ä {NetISrc} {PPPISrc} {SrcDir} Ä {CoreSrc} {IPV4Src} {APISrc} ### Build Rules ### TestEcho ÄÄ "{MacSrc}test.c.m.o" {ObjectFiles} {LibFiles-Old} {¥MondoBuild¥} Link ¶ -o {Targ} ¶ "{MacSrc}test.c.m.o" ¶ {ObjectFiles} ¶ {LibFiles-Old} ¶ {Sym-68K} ¶ {LOptions} If "{Sym-68K}" =~ /-sym Å[nNuU]Å/ ILinkToSYM {Targ}.NJ -mf -sym 3.2 -c 'sade' End CObjs = "{MacSrc}test.c.n.o" ¶ "{MacSrc}ElWhip.c.n.o" ¶ {ObjectFiles} Clean Ä Delete {ObjectFiles} Delete ElWhip.dmg Delete ElWhip Delete Å.makeout Delete Å.out ElWhip ÄÄ {CObjs} {LibFiles-Old} {¥MondoBuild¥} Link ¶ -o {Targ} ¶ {CObjs} ¶ {LibFiles-Old} ¶ {Sym-68K} ¶ {LOptions} ElWhip ÄÄ ElWhip.r ElWhip_ICN.r ElWhip.h {¥MondoBuild¥} Rez -rd -o {Targ} ElWhip.r -append # Don't Use rsrc files # DeRez "ElWhip_ICN.rsrc" | Rez -o {Targ} -append Rez -rd -o {Targ} ElWhip_ICN.r -append SetFile -a BC {Targ} #ElWhip-distrib Ä ElWhip DiskImg = ':400K.dmg' {Program}.dmg Ä {Program} Duplicate {DiskImg} {Targ} Open -f {Targ} Alert "Click OK after the volume mounts to continue..." Loop If `Exists {Deps}:` Break End End Duplicate :{Deps} {Deps}: SetFile -a BC {Deps} Duplicate :www:[Â.]Å {Deps}: # Convert to mac line feeds and output a copy StreamEdit {ContribDir}README.md -o {Deps}:Readme.txt SetFile -t TEXT {Deps}:Readme.txt Rename {Deps}: {Deps}_{Vers}: Eject {Deps}_{Vers}: .img Ä .dmg Duplicate {Deps} {Targ} ElWhip-vMac Ä ElWhip {DiskImg} Open -f 'Mac OS X:Users:epooch:Documents:MacOS6.dmg' Alert "Click OK after the volume mounts to continue..." Loop If `Exists 'MacOS6:'` Break End End Duplicate ElWhip 'MacOS6:ElWhip-vMac'; Eject MacOS6 ### Optional Dependencies ### ### Build this target to generate "include file" dependencies. ### Dependencies Ä $OutOfDate MakeDepend ¶ -append {MAKEFILE} ¶ -ignore "{CIncludes}" ¶ -objdir "{ObjDir}" ¶ -objext .o ¶ {Includes} ¶ {SrcFiles} \ No newline at end of file +# File: Makefile # Target: TestEcho (MPW 3.1 libraries), ElWhip (MPW 3.1 libraries) # Created: Sunday, November 29, 2009 11:11:08 PM # # ElWhip uses MPW 3.5 and Link (rather than iLink) and the Libraries and Interfaces # from MPW 3.1 to build a program to run on all System versions, # even earlier than System 6.08. # Copy (or make an Alias of) the Interfaces:CIncludes and Libraries folders from # MPW 3.1 and name them Interfaces:CIncludes-3.1 and Libraries-3.1 # # If you just want to build for 3.5 libraries (losing older system compatibility), # change: # IncFiles = -i {Includes-68K} {Includes} # COptions = -includes unix {IncFiles} {Sym-68K} -mbg off -model near -opt space -w off #-d LIBS_OLD # LibFiles = {LibFiles-68K} Program = "ElWhip" MAKEFILE = MakeFile #¥MondoBuild¥ = {MAKEFILE} # Make blank to avoid rebuilds when makefile is modified ¥MondoBuild¥ = Vers = v0.7.1 ObjDir = : SrcDir = ::::lwip:src: IncDir = {SrcDir}include: APISrc = "{SrcDir}api:" CoreSrc = "{SrcDir}core:" IPV4Src = "{CoreSrc}ipv4:" NetISrc = "{SrcDir}netif:" PPPISrc = "{NetISrc}ppp:" ContribDir = ::: PortsDir = {ContribDir}ports: AppsDir = {ContribDir}apps: MacSrc = {PortsDir}mac: Includes-Old = "{CIncludes}:CIncludes-3.1:" Includes-68K = "{CIncludes}" Includes = ¶ -i {MacSrc}include: ¶ -i {MacSrc}include:arch: ¶ -i {AppsDir} ¶ -i {IncDir} ¶ -i {IncDir}lwip: ¶ -i {IncDir}ipv4: ¶ -i {IncDir}ipv6: ¶ -i {IncDir}netif: ¶ -i {AppsDir}httpserver_raw: ¶ -i {IncDir}netif:ppp: # -i {IncDir}netif:ppp:polarssl: IncFiles = -i {Includes-Old} {Includes} Sym-68K = -sym off COptions = -includes unix {IncFiles} {Sym-68K} -mbg off -model near -opt space -w off -d LIBS_OLD LOptions = -mf -d -t 'APPL' -c 'LWIP' -model near AddDebugOpt = -d LWIP_DEBUG -u LWIP_NOASSERT NoDebugOpt = -u LWIP_DEBUG -d LWIP_NOASSERT ### Source Files ### SrcFiles = {MacSrc}test.c ¶ {MacSrc}sys_arch.c ¶ {MacSrc}sio.c ¶ # {AppsDir}tcpecho_raw:echo.c ¶ {AppsDir}httpserver_raw:httpd.c ¶ {AppsDir}httpserver_raw:fs.c ¶ {APISrc}err.c ¶ # {CoreSrc}init.c ¶ # {CoreSrc}mem.c ¶ {CoreSrc}memp.c ¶ {CoreSrc}netif.c ¶ {CoreSrc}inet_chksum.c ¶ {CoreSrc}pbuf.c ¶ {CoreSrc}raw.c ¶ # {CoreSrc}stats.c ¶ {CoreSrc}tcp_in.c ¶ {CoreSrc}tcp_out.c ¶ {CoreSrc}tcp.c ¶ # {CoreSrc}udp.c ¶ {CoreSrc}timers.c ¶ # {IPV4Src}icmp.c ¶ # {IPV4Src}igmp.c ¶ {IPV4Src}ip4.c ¶ {IPV4Src}ip4_addr.c ¶ # {IPV4Src}ip_frag.c ¶ # {NetISrc}etharp.c ¶ # {NetISrc}slipif.c ¶ {PPPISrc}ppp.c ¶ {PPPISrc}lcp.c ¶ {PPPISrc}magic.c ¶ {PPPISrc}auth.c ¶ # {PPPISrc}upap.c ¶ {PPPISrc}ipcp.c ¶ {PPPISrc}utils.c ¶ {PPPISrc}fsm.c # {PPPISrc}polarssl:md5.c ### Object Files ### ObjectFiles = "{MacSrc}sys_arch.c.l.o" ¶ "{MacSrc}sio.c.p.o" ¶ # "{AppsDir}echo.c.a.o" ¶ "{AppsDir}httpserver_raw:httpd.c.a.o" ¶ "{AppsDir}httpserver_raw:fs.c.a.o" ¶ "{SrcDir}err.c.l.o" ¶ # "{SrcDir}init.c.l.o" ¶ # "{SrcDir}mem.c.l.o" ¶ "{SrcDir}memp.c.l.o" ¶ "{SrcDir}netif.c.ud.o" ¶ "{SrcDir}inet_chksum.c.l.o" ¶ "{SrcDir}pbuf.c.l.o" ¶ "{SrcDir}raw.c.l.o" ¶ # "{SrcDir}stats.c.l.o" ¶ "{SrcDir}tcp_in.c.l.o" ¶ "{SrcDir}tcp_out.c.l.o" ¶ "{SrcDir}tcp.c.l.o" ¶ # "{SrcDir}udp.c.l.o" ¶ "{SrcDir}timers.c.l.o" ¶ # "{SrcDir}autoip.c.l.o" ¶ # "{SrcDir}icmp.c.l.o" ¶ # "{SrcDir}igmp.c.l.o" ¶ "{SrcDir}ip4.c.l.o" ¶ "{SrcDir}ip4_addr.c.l.o" ¶ # "{SrcDir}ip_frag.c.l.o" ¶ # "{NetISrc}etharp.c.l.o" ¶ # "{NetISrc}slipif.c.p.o" ¶ "{NetISrc}ppp.c.p.o" ¶ "{NetISrc}lcp.c.ud.o" ¶ "{NetISrc}magic.c.p.o" ¶ "{NetISrc}auth.c.ud.o" ¶ # "{NetISrc}upap.c.p.o" ¶ "{NetISrc}ipcp.c.ud.o" ¶ "{NetISrc}utils.c.p.o" ¶ "{NetISrc}fsm.c.ud.o" # "{NetISrc}md5.c.p.o" ### Libraries ### # Use the Libraries from MPW 3.1 CLibraries-Old = {CLibraries}::Libraries-3.1:CLibraries: Libraries-Old = {Libraries}::Libraries-3.1:Libraries: LibFiles-Old = ¶ # "{CLibraries-Old}CSANELib.o" ¶ # "{CLibraries-Old}Math.o" ¶ # "{CLibraries-Old}Complex.o" ¶ "{CLibraries-Old}StdCLib.o" ¶ "{CLibraries-Old}CInterface.o" ¶ "{CLibraries-Old}CRuntime.o" ¶ # "{Libraries-Old}ToolLibs.o" ¶ # "{Libraries-Old}Runtime.o" ¶ "{Libraries-Old}Interface.o" LibFiles-68K = ¶ # "{Libraries}MathLib.o" ¶ "{CLibraries}StdCLib.o" ¶ "{Libraries}MacRuntime.o" ¶ "{Libraries}IntEnv.o" ¶ "{Libraries}Interface.o" LibFiles = {LibFiles-Old} # Special case because of the /r/n issues. "{AppsDir}httpserver_raw:httpd.c.a.o" Ä "{AppsDir}httpserver_raw:httpd.c" {C} {Deps} -o {Targ} {COptions} -noMapCR {NoDebugOpt} -seg LWAPP ### Default Rules ### .c.m.o Ä .c {¥MondoBuild¥} {C} {depDir}{default}.c -o {targDir}{default}.c.m.o {COptions} {NoDebugOpt} -seg Main .c.n.o Ä .c {¥MondoBuild¥} {C} {depDir}{default}.c -o {targDir}{default}.c.n.o {COptions} {NoDebugOpt} -seg Main -d TEST_MAIN_DISABLE .c.pp.o Ä .c {¥MondoBuild¥} {C} {depDir}{default}.c -o {targDir}{default}.c.pp.o {COptions} {NoDebugOpt} -seg LWPPPL .c.p.o Ä .c {¥MondoBuild¥} {C} {depDir}{default}.c -o {targDir}{default}.c.p.o {COptions} {NoDebugOpt} -seg LWPPP .c.ud.o Ä .c {¥MondoBuild¥} {C} {depDir}{default}.c -o {targDir}{default}.c.ud.o {COptions} {NoDebugOpt} -seg LWUPDN .c.a.o Ä .c {¥MondoBuild¥} {C} {depDir}{default}.c -o {targDir}{default}.c.a.o {COptions} {NoDebugOpt} -seg LWAPP .c.l.o Ä .c {¥MondoBuild¥} {C} {depDir}{default}.c -o {targDir}{default}.c.l.o {COptions} {NoDebugOpt} -seg LWTCPIP .c.o Ä .c {¥MondoBuild¥} {C} {depDir}{default}.c -o {targDir}{default}.c.o {COptions} {NoDebugOpt} -seg Main {MacSrc} Ä {MacSrc} {NetISrc} Ä {NetISrc} {PPPISrc} {SrcDir} Ä {CoreSrc} {IPV4Src} {APISrc} ### Build Rules ### TestEcho ÄÄ "{MacSrc}test.c.m.o" {ObjectFiles} {LibFiles} {¥MondoBuild¥} Link ¶ -o {Targ} ¶ "{MacSrc}test.c.m.o" ¶ {ObjectFiles} ¶ {LibFiles} ¶ {Sym-68K} ¶ {LOptions} If "{Sym-68K}" =~ /-sym Å[nNuU]Å/ ILinkToSYM {Targ}.NJ -mf -sym 3.2 -c 'sade' End CObjs = "{MacSrc}test.c.n.o" ¶ "{MacSrc}ElWhip.c.n.o" ¶ {ObjectFiles} Clean Ä Delete {CObjs} Delete ElWhip.dmg Delete ElWhip Delete Å.makeout Delete Å.out ElWhip ÄÄ {CObjs} {LibFiles} {¥MondoBuild¥} Link ¶ -o {Targ} ¶ {CObjs} ¶ {LibFiles} ¶ {Sym-68K} ¶ {LOptions} ElWhip ÄÄ ElWhip.r ElWhip_ICN.r ElWhip.h {¥MondoBuild¥} Rez -rd -o {Targ} ElWhip.r -append # Don't Use rsrc files # DeRez "ElWhip_ICN.rsrc" | Rez -o {Targ} -append Rez -rd -o {Targ} ElWhip_ICN.r -append SetFile -a BC {Targ} #ElWhip-distrib Ä ElWhip DiskImg = ':400K.dmg' {Program}.dmg Ä {Program} Duplicate {DiskImg} {Targ} Open -f {Targ} Alert "Click OK after the volume mounts to continue..." Loop If `Exists {Deps}:` Break End End Duplicate :{Deps} {Deps}: SetFile -a BC {Deps} Duplicate :www:[Â.]Å {Deps}: # Convert to mac line feeds and output a copy StreamEdit {ContribDir}README.md -o {Deps}:Readme.txt SetFile -t TEXT {Deps}:Readme.txt Rename {Deps}: {Deps}_{Vers}: Eject {Deps}_{Vers}: .img Ä .dmg Duplicate {Deps} {Targ} ElWhip-vMac Ä ElWhip {DiskImg} Open -f 'Mac OS X:Users:epooch:Documents:MacOS6.dmg' Alert "Click OK after the volume mounts to continue..." Loop If `Exists 'MacOS6:'` Break End End Duplicate ElWhip 'MacOS6:ElWhip-vMac'; Eject MacOS6 ### Optional Dependencies ### ### Build this target to generate "include file" dependencies. ### Dependencies Ä $OutOfDate MakeDepend ¶ -append {MAKEFILE} ¶ -ignore "{CIncludes}" ¶ -objdir "{ObjDir}" ¶ -objext .o ¶ {IncFiles} ¶ {SrcFiles} \ No newline at end of file