Unix Programming - makedepend question

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > October 2006 > makedepend question





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author makedepend question
jithu

2006-10-17, 1:25 pm

Hi
I am posting it here since, after searching in google for
Makefiles, i got lot of reference material on Makefile. But very few of
them specified on creating Makefiles for any directory structure. I
mean i got very few references for things like seperating object files
from sources files . The only useful thing i got was
http://make.paulandlesley.org/multi-arch.html which is too complex for
a newbie like me.So if you have some good material on makefile for
directory structures please post them as reply. Now if you have time
please answer my question.

I have 2 directories named "cppsrc" and "public" inside another
direcory PRJ_DIR. All the cpp source files are present inside the
"cppsrc" and all the header files are present in "public". My
"Makefile" is present in PRJ_DIR. I use "makedepend" in my makefile as
below.

SRC_FILE = cppsrc/main.cpp cppsrc/test.cpp
makedepend -f- -I public $(SRC_FILE) > .depend

But this create the the dependancy list as below
cppsrc/main.o: public/test.h
cppsrc/test.o: public/test.h

What i need is a list like
main.o: public/test.h
test.o: public/test.h.

How to create this list.Remeber my Makefile is in PRJ_DIR and
makedepend is invoked from it.I know by giving cd cppsrc; followed by
makedepend will do the job.
But the aim of this question is more (70%) to get some good references
on the subject from the masters itslef and still the (30%) is to get a
better solution.

Thanks in Advance
Kiran.

Ralf Fassel

2006-10-17, 1:25 pm

* "jithu" <kiran.happy@gmail.com>
| SRC_FILE = cppsrc/main.cpp cppsrc/test.cpp
| makedepend -f- -I public $(SRC_FILE) > .depend
|
| But this create the the dependancy list as below
| cppsrc/main.o: public/test.h
| cppsrc/test.o: public/test.h
|
| What i need is a list like
| main.o: public/test.h
| test.o: public/test.h.
|
| How to create this list.

makedepend -f- -I public $(SRC_FILE) | sed -e 's,cppsrc/,,' > .depend

This will delete the first occurence of the string "cppsrc/" in any
output line of 'makedepend'.

HTH
R'
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com