home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / mac / programm / 21942 < prev    next >
Encoding:
Internet Message Format  |  1993-01-22  |  3.3 KB

  1. Path: sparky!uunet!cs.utexas.edu!sun-barr!olivea!pagesat!netsys!agate!stanford.edu!eos!data.nas.nasa.gov!taligent!kip-50.taligent.com!user
  2. From: keith@taligent.com (Keith Rollin)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: MPW Lib/Make question
  5. Message-ID: <keith-210193233528@kip-50.taligent.com>
  6. Date: 22 Jan 93 07:50:55 GMT
  7. References: <1993Jan19.224625.13630@gn.ecn.purdue.edu> <1993Jan20.060444.8192@gn.ecn.purdue.edu> <1993Jan22.114118.13376@waikato.ac.nz>
  8. Sender: usenet@taligent.com (More Bytes Than You Can Read)
  9. Followup-To: comp.sys.mac.programmer
  10. Organization: Taligent
  11. Lines: 88
  12.  
  13. In article <1993Jan22.114118.13376@waikato.ac.nz>, ldo@waikato.ac.nz
  14. (Lawrence D'Oliveiro, Waikato University) wrote:
  15. > In article <1993Jan20.060444.8192@gn.ecn.purdue.edu>, jess@gn.ecn.purdue.edu (Jess M Holle) writes:
  16. > >>
  17. > >>I now am having some problems understanding the use of lib and
  18. > >>make under MPW.  What I want to do is to be able to automatically
  19. > >>rebuild any of the huge libraries which we use, while only having
  20. > >>to re-compile the files which need it.  I also don't want to keep
  21. > >>old object files hanging around.
  22. > >>
  23. > >>In other words, I have one library that is almost 1 MB in size.
  24. > >>When I change 1 source file, I'd like to be able to "make" the
  25. > >>library again and have only the one file recompiled and the
  26. > >>updated information overwrite the old information in the library.
  27. > As far as I'm aware, the Lib tool hasn't got any function for *updating*
  28. > a library, you have to rebuild it from scratch. This is probably because
  29. > there is no actual object library format under MPW; library files are just
  30. > concatenations of object modules from separate .o files.
  31.  
  32.  
  33. You can sort of update a library using the Lib tool (although it's close to
  34. rebuilding from scratch, like you say). Use something like:
  35.  
  36. Lib -d -o NewLib Updated1.o Updated2.o OldLib
  37. Rename -y NewLib OldLib
  38.  
  39. Just remember to specify the .o files with the updated routines before the
  40. library holding the old routines, and that Lib doesn't like to write its
  41. output to any of the input files.
  42.  
  43.  
  44. > Here's the sort of rule I have in my makefiles for rebuilding an object
  45. > library (I'm using "\" to indicate "hold down the option key and press the
  46. > following key"):
  47. >     MyLib.o \f \d
  48. >         Component1.p.o \d
  49. >         Component2.a.o \d
  50. >         Component3.mod.o
  51. >         Lib -o MyLib.o \d
  52. >         Component1.p.o \d
  53. >         Component2.a.o \d
  54. >         Component3.mod.o
  55. > As you can see, it's quite simple (apart from the nuisance of having to write
  56. > out the list of object files twice!). If you edit any of the source files,
  57. > Make will recompile just those, and rebuild the entire library.
  58.  
  59.  
  60. You don't have to specify the list of object files twice. Use either of the
  61. following instead:
  62.  
  63. ----------
  64.  
  65. MyLib.o \f \d
  66.          Component1.p.o \d
  67.          Component2.a.o \d
  68.          Component3.mod.o
  69.          Lib -o {Targ} {Deps}
  70.  
  71. --- or ---
  72.  
  73. MyObjects = \d
  74.          Component1.p.o \d
  75.          Component2.a.o \d
  76.          Component3.mod.o
  77.  
  78. MyLib \f {MyObjects}
  79.    Lib -o {Targ} {MyObjects}
  80.  
  81. ----------
  82.  
  83.  
  84. > You know you've been programming the Mac a long time when...
  85. > ...you know all the arguments to CopyBits by heart.
  86.  
  87.  
  88. How about Munger? Or NewWindow? Or DragGrayRgn? Or AESend? Or when you can
  89. fill in the necessary fields of a parameter block for a low-level File
  90. Manager call (like PBCatSearch)? Heck, CopyBits is easy...
  91.  
  92. -----
  93. Keith Rollin
  94. Phantom Programmer
  95. Taligent, Inc.
  96.