Note that there are some explanatory texts on larger screens.

plurals
  1. POrecursive makefile not building
    primarykey
    data
    text
    <p>I have a bunch of C files in different directories and I'm getting a <code>make: nothing to be done for 'all'</code> error with my recursive Makefile; however if I tweak the dependences I can get it to work... but I don't understand why I have to. </p> <p>Here's my original Makefile:</p> <pre><code>APP_DIRS=rescoco ressys resvm .PHONY: all all: $(APP_DIRS) $(APP_DIRS): $(MAKE) --directory $@ clean: $(RM) *~ </code></pre> <p>Now if I change my line: <code>.PHONY</code> to <code>.PHONY: all $(APP_DIRS)</code> it builds fine. </p> <p>Another possibility is if I change the line: <code>$(APP_DIRS):</code> to <code>$(APP_DIRS): clean</code> it builds fine.</p> <p>(NOTE: removing .PHONY target doesn't change anything) <br><br><br> So what's going on here? Is the Makefile trying to tell me I haven't listed dependencies correctly? I was thinking <code>make</code> would do something like:</p> <ul> <li>to build <code>.PHONY</code> I first have to build <code>all</code></li> <li>to build <code>all</code> I first have to build <code>$(APP_DIRS)</code> </li> <li><code>$(APP_DIRS)</code> has no prereqs so execute the command for that (which would cause the recursive makes to run). </li> </ul> <p>Clearly I am wrong; but why? </p> <hr> <p>FYI, if it matters my files are structured something like this:</p> <pre><code>Makefile #top level makefile as seen above /rescoco rescoco.c Makefile #builds rescoco src and moves archive to ../lib directory /ressys ressys.c Makefile #same as above but for ressys /resvm resvm.c Makefile #same as above but for resvm /lib </code></pre> <p>and my build command is simply <code>make</code>. When I run with <code>make -n</code> or <code>make -n all</code> I get no output at all:</p> <pre><code>:~/proj$ make -n all make: Nothing to be done for 'all'. :~/proj$ </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload