Review your favorite Linux distribution.
Go Back > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.


  Search this Thread
Old 12-05-2012, 01:02 PM   #1
LQ Newbie
Registered: Dec 2012
Posts: 1

Rep: Reputation: Disabled
No rule to make target `w'. Stop


I am Trying to Build a project, Makefile written so that outer make file calls the inner Makefiles to Build,
I am invoking the Makefile as gmake depend at the perent directory of project (Makefile here digs in and executes inner Makefiles to build the project)

@for subdir in `ls */Makefile`; \
do \
echo "+ Making $@ in `dirname $$subdir` ..."; \
(cd `dirname $$subdir`; $(MAKE) $@); \

the automatic variable $@ is set to depend, till some inner directories make process is going well and good ,after some point after I could see the error Message as *** No rule to make target `w'. Stop.,
with google help I found reasons like

1.infinite recursion
2.The value of $@ is set to w, as target now is w that wont be found in the Makefile so causing such an error.

--> I have gmake output I could see make entering in to directories only once and leaving from directories only once, so error is not because of recursion.
-->I could see @ := wp when I issued gmake p depend.

Could you suggest me the approach to solve this issue

Old 12-06-2012, 03:42 PM   #2
Senior Member
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 & 7
Posts: 3,271

Rep: Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893Reputation: 893
The problem that you're having is most likely that ls can give weird results. It's better to use file globbing in the shell. Also, use the -C option rather than cd.
        for i in */Makefile ; do      /
            SUBDIR=`dirname "$$i"`;   /
            echo Entering $(SUBDIR) ; /
            $(MAKE) -C $(SUBDIR) $(TARGET) ; /


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
*** No rule to make target `modules'. Stop. Help heffo_j Linux - Hardware 7 06-05-2011 12:44 PM
No rule to make target `menuconfig'. Stop skaj Linux - Kernel 1 02-11-2011 05:52 AM
Belkin Wirless G RTL8185L make[1]: *** No rule to make target `Makefile'. Stop. SilverRock Linux - Wireless Networking 2 02-11-2007 08:25 AM
Error: *** No rule to make target 'all'. Stop aa2bi Linux - Newbie 6 06-08-2004 01:55 PM > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 08:33 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration