List Info

Thread: Why make complains though implicit rule is present ..




Why make complains though implicit rule is present ..
country flaguser name
United States
2007-06-08 06:10:15
I have a make file that includes dependency files created
automatically by a 
shell command :

ifneq "$(MAKECMDGOALS)" "clean"
  include $(dependencies)
endif

%.d: %.c
        $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -M $<
| 
        $(SED) 's,($(notdir $*).o) *:,$(dir $)1 $: ,' >
$.tmp
        $(MV) $.tmp $

The source files (from which .d files are created) are
present in 
subdirectories.

When I execute this make file (using make -f SmallPrjMain.mk
--just-print 
--debug=verbose), make terminates with error that rule to
make .d file is 
not present.

This looks odd to me since rule %.d : %.c is right there in
the make file..

I can send more details if required; I believe this question
might have 
appeared many a times in this forum, so I did not attach too
many details ..

BTW, the output of make is :

Reading makefiles...
Reading makefile `SmallPrjMain.mk'...
Reading makefile `dir1/dir1.mk' (search path) (no ~
expansion)...
Reading makefile `dir1/print1dir1.d' (search path) (no ~
expansion)...
SmallPrjMain.mk:36: dir1/print1dir1.d: No such file or
directory
Reading makefile `dir1/print2dir1.d;' (search path) (no ~
expansion)...
SmallPrjMain.mk:36: dir1/print2dir1.d;: No such file or
directory
make: *** No rule to make target `dir1/print2dir1.d;'. 
Stop.

Regards,
Sharan

____________________________________________________________
_____
Post your 2nd hand stuff for free on Yello.www.yello.in 

http://www.yello.in/home.php?m_source=hotmailtag&utm_med
ium=textlink&utm_content=in&utm_campaign=may



_______________________________________________
Help-make mailing list
Help-makegnu.org
http:
//lists.gnu.org/mailman/listinfo/help-make

Re: Why make complains though implicit rule is present ..
user name
2007-06-08 07:38:19
On Fri, 2007-06-08 at 11:10 +0000, sharan basappa wrote:

> ifneq "$(MAKECMDGOALS)" "clean"
>   include $(dependencies)
> endif
> 
> %.d: %.c
>         $(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -M
$< | 
>         $(SED) 's,($(notdir $*).o) *:,$(dir $)1 $: ,' >
$.tmp
>         $(MV) $.tmp $

> Reading makefiles...
> Reading makefile `SmallPrjMain.mk'...
> Reading makefile `dir1/dir1.mk' (search path) (no ~
expansion)...
> Reading makefile `dir1/print1dir1.d' (search path) (no
~ expansion)...
> SmallPrjMain.mk:36: dir1/print1dir1.d: No such file or
directory
> Reading makefile `dir1/print2dir1.d;' (search path) (no
~ expansion)...
> SmallPrjMain.mk:36: dir1/print2dir1.d;: No such file or
directory
> make: *** No rule to make target `dir1/print2dir1.d;'. 
Stop.

Typically you'll get an error like that if you don't have a
dir1/print2dir1.c file, so make can't use the implicit rule
you show
above.  However, running make with the -d option will get
you more
details about exactly what make is looking for and why it
can't rebuild.

-- 
------------------------------------------------------------
-------------------
 Paul D. Smith <psmithgnu.org>          Find
some GNU make tips at:
 http://www.gnu.org        
             http://make.paulandlesl
ey.org
 "Please remain calm...I may be mad, but I am a
professional." --Mad Scientist


_______________________________________________
Help-make mailing list
Help-makegnu.org
http:
//lists.gnu.org/mailman/listinfo/help-make

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )