[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Library building 102
From: |
Robert P. J. Day |
Subject: |
Re: Library building 102 |
Date: |
Thu, 26 May 2005 19:27:36 -0400 (EDT) |
On Fri, 27 May 2005, Brendan Heading wrote:
>
> OK, I've worked out the basic idea of what I want my makefile to look like. A
> few further optimizations are in order.
>
> What I'd like to do is put resulting objects in a different directory from
> where the source file resides, it keeps things nice and tidy. The trouble that
> I'm having is figuring out how to do this in a nice simple way.
>
> If written statically, the rule to do this might be :
>
> objectdir/foo.o: foo/src/foo.c
>
> or using variables :
>
> $(OBJDIR)/%.o: $(FOO_SRCS)/%.c
>
> but this obviously breaks down as I would need a rule for each source
> directory I have. Is there a generic way I can do this for all .o and .c files
> ?
>
> ie something like :
>
> $(OBJDIR)/%.o : %.c
>
> except with something added so that Make knows how to find the *.c file ?
>
> I'm guessing this might be a job for VPATH.
or just "vpath" looking specifically for .c files.
rday