Thanks for your inputs. I cross checked
but there is no tab in after the line. makefile is attached in this mail.
gmake -rd returns this output.
Considering target file
`/tmp/bg/objs/src/bg2.o'.
File `/tmp/bg/objs/src/bg2.o'
does not exist.
Looking for an implicit
rule for `/tmp/bg/objs/src/bg2.o'.
Trying pattern rule
with stem `src/bg2'.
Trying implicit
prerequisite `src/bg2.c'.
Trying pattern rule
with stem `src/bg2'.
Trying implicit
prerequisite `src/bg2.c'.
Looking for a rule
with intermediate file `src/bg2.c'.
Avoiding implicit
rule recursion.
No implicit rule
found for `/tmp/bg/objs/src/bg2.o'.
Pruning file `makefile'.
Finished prerequisites
of target file `/tmp/bg/objs/src/bg2.o'.
Must remake target `/tmp/bg/objs/src/bg2.o'.
Successfully remade target
file `/tmp/bg/objs/src/bg2.o'.
If I remove the line
$(OBJS):makefile
and replace
/tmp/bg/objs/%.o:%.c makefile
everything seems to be working fine.
Is this a bug then?
Thanks & Regards,
Bhaskar
Paul Smith <address@hidden>
2007-06-27 06:36 PM
Please respond to
address@hidden
To
Bhaskar G <address@hidden>
cc
address@hidden
Subject
Re: dependency problem
Classification
On Tue, 2007-06-26 at 11:08 +0530, Bhaskar G wrote:
> Hi All,
>
> Sorry for the incomplete question. I have src/bg.c and src/bg1.c.
> src/bg2.c doenot exist. So when I run gmake I expect the error message
> "make: *** No rule to make target `src/bg2.o', needed by `bg.a'.
> Stop."
>
> not "cc src/bg.o src/bg1.o src/bg2.o -o bg.a
> cc: src/bg2.o: No such file or directory
> make: *** [bg.a] Error 1"
> $(OBJS):makefile
Maybe you have a stray TAB in your makefile after this line?
If that's not it you should use the -d option and see what make thinks
about the src/bg2.o target.
--
-------------------------------------------------------------------------------
Paul D. Smith <address@hidden> Find
some GNU make tips at:
http://www.gnu.org
http://make.paulandlesley.org
"Please remain calm...I may be mad, but I am a professional."
--Mad Scientist