help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to make "gmake" recompile the files based on their dependencies'


From: Derek Clegg
Subject: Re: how to make "gmake" recompile the files based on their dependencies' modified time
Date: Fri, 3 Oct 2008 09:20:38 -0700

On Oct 2, 2008, at 11:55 PM, Stephan Beal wrote:

On Fri, Oct 3, 2008 at 8:00 AM, parth <address@hidden> wrote:
all: $(DEPENDENCIES) $(PROGRAM).cc
      g++ Maze.o Astar.cc -o $(PROGRAM)

See "Paul's 2nd Rule of Makefiles":

http://make.paulandlesley.org/rules.html#rule2

These rules are very interesting.  I have a question about applying rule #3:

I have a project with sources and the Makefile in, for example, /src/project, and I need to place the object files and executables in /dst/project.  I'm not sure how to "locate the sources from the object directory" in this case.  It would be possible to do a recursive make, I suppose:

all:
$(MAKE) -C /dst/project -f /src/project/Makefile all-in-dst-directory

Aside from that, I'm not sure how to force make to change its working directory, so that it was "locating the sources from the objects directory" — unless I'm misunderstanding the rule.

Thanks in advance for any insight.

Derek
address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]