[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: |
lanxue |
Subject: |
Re: How to specify the location for .o files in makedepend? |
Date: |
Tue, 16 Aug 2005 11:01:45 -0700 (PDT) |
User-agent: |
SquirrelMail/1.4.4 |
Thanks for the replies. I tried this:
cd $(TEST)/src;
makedepend -Y $(CFLAGS) -p $(TEST)/obj *.c
In which $(TEST) gives the full path of the parent directory. But got
errors that can't open *.c. I also tried to specify the src file name, eg,
mytest.c, but still the file can't be found. I suspect "cd" might not work
in here.
Thanks,
Lan
> 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.
> --
> John Graham-Cumming
> address@hidden
>
> Home: http://www.jgc.org/
> POPFile: http://getpopfile.org/
>
> Sign up for my Spam and Anti-spam Newsletter
> at http://www.jgc.org/
>
>
> _______________________________________________
> Help-make mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-make
>
Re: How to specify the location for .o files in makedepend?, Paul D. Smith, 2005/08/21