%% Greg Chicares <[EMAIL PROTECTED]> writes:

  gc> On 2006-3-17 2:41 UTC, paulur wrote:
  >> There are two directories /src1 and /src2 where the soruce codes are, and
  >> another directory /headers for head files.
  >> 
  >> How should the makefile set variables ( not to hard code all the
  >> directories) so that the complier can find these files?

  gc> Let's say those are all subdirectories of /somepath/ and
  gc> assume you're using C. If you write

  gc> vpath %.c /somepath/src1 /somepath/src2
  gc> vpath %.h /somepath/headers

  gc> then you can run 'make' in a completely different directory
  gc> and it will find those files.

Yes but the OP was asking what to set so the _compiler_ can find those
files.


That's a function of your compiler, and not at all related to make.
Typically you would add -I<somepath> to your compile line, and that
means modifying a make variable that contains options provided to your
compiler.


Without knowing anything about your makefile environment there's not
much more we can say.  But please don't send your entire makefile
environment: we're not able to examine/debug something like that.
You'll need to learn enough makefile syntax to be able to ask shorter,
targeted questions.  The GNU make manual is an excellent resource for
learning about makefiles.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[EMAIL PROTECTED]>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to