home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!cs.utexas.edu!sun-barr!ames!pacbell.com!iggy.GW.Vitalink.COM!nocsun.NOC.Vitalink.COM!wetware!ditka!eagercon!eagercon!eager
- From: eager@eagercon.com (Michael J. Eager)
- Subject: Re: Include file directory search path
- Message-ID: <1992Nov19.171758.14067@eagercon.com>
- Sender: root@eagercon.com (Operator)
- Reply-To: eager@eagercon.com
- Organization: Eager Consulting
- References: <SIM.92Nov18151448@mdtf14.fnal.gov>
- Date: Thu, 19 Nov 1992 17:17:58 GMT
- Lines: 33
-
- In article 92Nov18151448@mdtf14.fnal.gov, sim@mdtf14.fnal.gov (Jim Sim) writes:
- >Is there a way to force the C preprocessor to use the same search path to
- >locate nested include files (files included by another include file)
- >that it uses to locate non-nested include files. My motivation for doing
- >this is to allow developers to make "test" changes to nested include files
- >that don't affect "official" versions of those include files. Consider the
- >following:
-
- The compiler uses the same directory search path for all included files.
-
- I think that what you want to do (if I can understand it) is to create two
- (or more) include directories. Search them in sequence, with the testing
- directory first:
-
- cc -c main.c -Imy/testing -I/usr/local/official
-
- If someone makes a change in stuff.h, it is placed in my/testing and will
- be used instead of .../official
-
- Any nested includes in stuff.h will be resolved in the same way, first from
- my/testing then from .../official.
-
- (As an aside, you have to be sure that when you make changes to one include
- file that you recompile all files which include that file, either directly
- or indirectly.)
-
- You may also want to look at VPATH in make.
-
- ---
- Michael J. Eager Michael.Eager@eagercon.com
- Eager Consulting (415) 325-8077
- 1960 Park Boulevard, Palo Alto, CA 94306-1141
-
-