* makedepend usage problem
@ 2002-03-28 5:24 Mariappan, MaharajanX
0 siblings, 0 replies; only message in thread
From: Mariappan, MaharajanX @ 2002-03-28 5:24 UTC (permalink / raw)
To: 'gcc-help@gcc.gnu.org'; +Cc: Mariappan, MaharajanX
Hi GNU Gurus!
I've a problem with makedepend command usage inside the Makefile.
I have placeed Makefile in DIR1, c sources are present in DIR2. I want to
place object files in DIR3
so I write the top Makefile like below
SUBDIRS = DIR1
ifneq "$(strip $(SUBDIRS)) ""
req_dirs := $(subst /,X/,$(SUBDIRS))
$(req_dirs):
$(MAKE) -w -C $(subt X/,/,$@) PWD=$(subt X/,/,$@);
endif
target: $(req_dirs)
ifneq "$(strip $(SUBDIRS)) ""
req_dirs := $(subst /,X/,$(SUBDIRS))
$(dep_req_dirs):
$(MAKE) -w -C $(subt X/,/,$@) PWD=$(subt X/,/,$@) localdepend;
endif
localdepend:
(cd $(SRCDIR); \
$(MAKEDEPEND) -Y -p$(OBJDIR) $(notdir $(SRCS)) \
)
makedepend: $(dep_req_dirs) localdepend
The Makefile in DIR1 looks like,
SRCDIR = DIR2
OBJDIR = DIR3
SRCS := $(wildcard $(SRCDIR)/*.c)
When I run gmake makedepend in top dir.
It will create dependency like below:
DIR3/filename.o : headerfile.h
But when I run build target, make will start in DIR1[where Makefile present]
and it cann't locate the header file, since this file exists in DIR2, not in
DIR1]
So I tried to cahnge the localdepend target like below:-
localdepend:
( \
$(MAKEDEPEND) -Y -p$(OBJDIR) $(SRCS) \
)
But now the problem is:
DIR3/DIR2/filename.o : DIR2/headerfile.h
But I want something like below line..
DIR3/filename.o : Dir2/headerfile.h
The pathname of src file need not be present when I pass -p<objdir> option
in the lhs of dependency list, but present the pathname in the rhs.
I've tried to find a way to fix this problem, but cudn't. I'm really
appreciating any help regarding this.
TIA,
Maharajan.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-03-28 13:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-28 5:24 makedepend usage problem Mariappan, MaharajanX
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).