home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / c / 16852 < prev    next >
Encoding:
Text File  |  1992-11-19  |  1.8 KB  |  46 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!cs.utexas.edu!sun-barr!ames!pacbell.com!iggy.GW.Vitalink.COM!nocsun.NOC.Vitalink.COM!wetware!ditka!eagercon!eagercon!eager
  3. From: eager@eagercon.com (Michael J. Eager)
  4. Subject: Re: Include file directory search path
  5. Message-ID: <1992Nov19.171758.14067@eagercon.com>
  6. Sender: root@eagercon.com (Operator)
  7. Reply-To: eager@eagercon.com
  8. Organization: Eager Consulting
  9. References: <SIM.92Nov18151448@mdtf14.fnal.gov>
  10. Date: Thu, 19 Nov 1992 17:17:58 GMT
  11. Lines: 33
  12.  
  13. In article 92Nov18151448@mdtf14.fnal.gov, sim@mdtf14.fnal.gov (Jim Sim) writes:
  14. >Is there a way to force the C preprocessor to use the same search path to
  15. >locate nested include files (files included by another include file) 
  16. >that it uses to locate non-nested include files. My motivation for doing 
  17. >this is to allow developers to make "test" changes to nested include files 
  18. >that don't affect "official" versions of those include files. Consider the 
  19. >following:
  20.  
  21. The compiler uses the same directory search path for all included files.
  22.  
  23. I think that what you want to do (if I can understand it) is to create two
  24. (or more) include directories.  Search them in sequence, with the testing
  25. directory first:
  26.  
  27.     cc -c main.c -Imy/testing -I/usr/local/official 
  28.  
  29. If someone makes a change in stuff.h, it is placed in my/testing and will
  30. be used instead of .../official
  31.  
  32. Any nested includes in stuff.h will be resolved in the same way, first from
  33. my/testing then from .../official.
  34.  
  35. (As an aside, you have to be sure that when you make changes to one include
  36. file that you recompile all files which include that file, either directly
  37. or indirectly.)
  38.  
  39. You may also want to look at VPATH in make.
  40.  
  41. ---
  42. Michael J. Eager        Michael.Eager@eagercon.com
  43. Eager Consulting        (415) 325-8077 
  44. 1960 Park Boulevard, Palo Alto, CA 94306-1141
  45.  
  46.