[Top][All Lists]

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

Re: How to specify the location for .o files in makedepend?

From: John Graham-Cumming
Subject: Re: How to specify the location for .o files in makedepend?
Date: Tue, 16 Aug 2005 17:56:05 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040208 Thunderbird/0.5 Mnenhy/

address@hidden wrote:
I have a problem using makedepend. By default, makedepend generate the
dependancy that the .o files are in the same directory as the src file.
But in my case, I have all the .o file in a different directory. Say, my
src files are in ./src, while obj files are in ./obj. How do I specify the
path for the obj files in makedepend? I tried -p option, but it prepends
the prefix instead of replacing the whole path.

I suspect that you are doing something like:

    makedepend ./src/foo.c

which is generating a line of the form:

    ./src/foo.o: ./src/foo.c

When you want:

    ./obj/foo.o: ./src/foo.c

and you've discovered that doing

    make depend ./src/foo.c -p ./obj/

gives you:

    ./obj/./src/foo.o: ./src/foo.c

The simplest solution is to do this instead:

    cd ./src ; makedepend foo.c

You'll want to add a -f option to specify the Makefile that you are updating with dependencies so that this works.

John Graham-Cumming


Sign up for my Spam and Anti-spam Newsletter

reply via email to

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