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

  1. Path: sparky!uunet!munnari.oz.au!comp.vuw.ac.nz!waikato.ac.nz!ldo
  2. From: ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University)
  3. Newsgroups: comp.sys.mac.programmer
  4. Subject: Re: MPW Lib/Make question
  5. Message-ID: <1993Jan22.114118.13376@waikato.ac.nz>
  6. Date: 22 Jan 93 11:41:18 +1300
  7. References: <1993Jan19.224625.13630@gn.ecn.purdue.edu> <1993Jan20.060444.8192@gn.ecn.purdue.edu>
  8. Organization: University of Waikato, Hamilton, New Zealand
  9. Lines: 53
  10.  
  11. In article <1993Jan20.060444.8192@gn.ecn.purdue.edu>, jess@gn.ecn.purdue.edu (Jess M Holle) writes:
  12. >>
  13. >>I now am having some problems understanding the use of lib and
  14. >>make under MPW.  What I want to do is to be able to automatically
  15. >>rebuild any of the huge libraries which we use, while only having
  16. >>to re-compile the files which need it.  I also don't want to keep
  17. >>old object files hanging around.
  18. >>
  19. >>In other words, I have one library that is almost 1 MB in size.
  20. >>When I change 1 source file, I'd like to be able to "make" the
  21. >>library again and have only the one file recompiled and the
  22. >>updated information overwrite the old information in the library.
  23.  
  24. As far as I'm aware, the Lib tool hasn't got any function for *updating*
  25. a library, you have to rebuild it from scratch. This is probably because
  26. there is no actual object library format under MPW; library files are just
  27. concatenations of object modules from separate .o files.
  28.  
  29. Here's the sort of rule I have in my makefiles for rebuilding an object
  30. library (I'm using "\" to indicate "hold down the option key and press the
  31. following key"):
  32.  
  33.     MyLib.o \f \d
  34.         Component1.p.o \d
  35.         Component2.a.o \d
  36.         Component3.mod.o
  37.         Lib -o MyLib.o \d
  38.         Component1.p.o \d
  39.         Component2.a.o \d
  40.         Component3.mod.o
  41.  
  42. As you can see, it's quite simple (apart from the nuisance of having to write
  43. out the list of object files twice!). If you edit any of the source files,
  44. Make will recompile just those, and rebuild the entire library.
  45.  
  46. Rebuilding a library is fast: I have one built from 90 component object
  47. files, and it typically takes much less time than recompiling one of the
  48. Modula-2 or assembler source files.
  49.  
  50. >>If all else fails, I'll have to leave hundreds of .o files hanging
  51. >>around my drive, but I'd much rather be able to collect them into
  52. >>tidy libraries and update them as needed (without a full rebuild).
  53.  
  54. You still need to keep all the .o files around, otherwise you'll have to
  55. recompile all the sources each time you rebuild the library. At least you
  56. can keep them in some subdirectory, separate from the library.
  57.  
  58. Lawrence D'Oliveiro                       fone: +64-7-856-2889
  59. Computer Services Dept                     fax: +64-7-838-4066
  60. University of Waikato            electric mail: ldo@waikato.ac.nz
  61. Hamilton, New Zealand    37^ 47' 26" S, 175^ 19' 7" E, GMT+13:00
  62. You know you've been programming the Mac a long time when...
  63. ...you know all the arguments to CopyBits by heart.
  64.