[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: help: makefile: directory rules
From: |
Paul Li |
Subject: |
Re: help: makefile: directory rules |
Date: |
Fri, 17 Mar 2006 15:12:03 +1100 |
Hi Greg,
Thank you so much for the message.
Following your reply, i've got 2 questions:
* where to put the makefile?
* since head files are under different directories from .c files, how
to declare #include ".h"?
Thanks again.
Paul
On 3/17/06, Greg Chicares <address@hidden> wrote:
> 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?
>
> Let's say those are all subdirectories of /somepath/ and
> assume you're using C. If you write
>
> vpath %.c /somepath/src1 /somepath/src2
> vpath %.h /somepath/headers
>
> then you can run 'make' in a completely different directory
> and it will find those files.
>