home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / sgi / 19148 < prev    next >
Encoding:
Text File  |  1993-01-28  |  1.9 KB  |  64 lines

  1. Newsgroups: comp.sys.sgi
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!caen!uvaarpa!murdoch!uvacs.cs.Virginia.EDU!rg3h
  3. From: rg3h@uvacs.cs.Virginia.EDU (Rich Gossweiler)
  4. Subject: ? for make gurus
  5. Message-ID: <1993Jan26.192554.15037@murdoch.acc.Virginia.EDU>
  6. Sender: usenet@murdoch.acc.Virginia.EDU
  7. Reply-To: rg3h@Virginia.EDU
  8. Organization: University of Virginia Computer Science Department
  9. Date: Tue, 26 Jan 1993 19:25:54 GMT
  10. Lines: 52
  11.  
  12. I'd like to put all my .o files in a separate subdirectory.  On the
  13. suns, I use a macro as shown below:
  14.  
  15.  
  16. #
  17. # all the object files to be created
  18. #
  19. VR_OBJS        = dynarray.o    sock.o        vr_comm.o    \
  20.         timing.o    vr_init.o    vr_draw.o    \
  21.         vr_file.o    vr_tree.o    vr_tracker.o    \
  22.         vr_light.o    vr_glove.o    vr_util.o    \
  23.         vr_timing.o
  24.  
  25. #
  26. # Rule substitution -- prepend the .o files with subdirectory "sunobj/"
  27. #
  28. VR_OBJECTS    = $(VR_OBJS:%=sunobj/%)
  29.  
  30.  
  31. sunobj/%.o:    $(INC) %.c
  32.         @echo '>>>>> Making $@ <<<<<'
  33.         $(CC) -c -o $@ $<
  34.         @echo " "
  35.  
  36.  
  37. $(VR_LIBRARY):    $(VR_OBJECTS)
  38.         @echo "***** Creating library $@ *****"
  39.         /bin/rm -f $@
  40.         ar qv $@ $?
  41.         ranlib $@
  42.         @echo " "
  43.  
  44. The $(VR_OBJECTS) macro substitutes "sunobj/" in front of each .o file
  45. (specified in the $(VR_OBJS) variabele).  I use this as the dependency
  46. in making the VR library, and tell the compiler to put the .o files in
  47. that directory.
  48.  
  49. Unfortunately, it appears as though I can't do this with the sgi make
  50. macros. All I want to do is put the .o files in another directory, and
  51. make the .c files be dependent on them, over in that subdirectory.
  52. Anyone have any suggestions on how I might achieve this perplexing
  53. goal?
  54.  
  55. Thanks,
  56. Rich 
  57.  
  58.  
  59. -- 
  60. Rich Gossweiler (rg3h@cs.Virginia.EDU) | Education is mostly cleaning
  61. CS Department, Olsson Hall             | erasers and waiting for lunch.
  62. The University of Virginia             |         -- Joe Bazooka
  63. Charlottesville, Virginia 22903        |  
  64.