Note that there are some explanatory texts on larger screens.

plurals
  1. POGNU make dependency issue
    primarykey
    data
    text
    <p>To make it simple, say I have the following folders:</p> <ul> <li><code>./src/</code> with many .c files</li> <li><code>./obj/</code> with many .obj files</li> <li><code>./output/</code> with my binaries I want to build</li> </ul> <p>My makefile is as follows:</p> <pre><code>all: init mybin # init commands init: mkdir obj mkdir output mybin: project1 project2 project3 $(CC) src/misc.c ... etc $(LK) obj/first.obj obj/second.obj obj/third.obj obj/four.obj obj/five.obj obj/six.obj obj/seven.obj obj/eight.obj obj/nine.obj -o output/myapp.bin project1: obj/first.obj obj/second.obj obj/third.obj obj/first.obj: src/first.c $(CC) first.c ... etc obj/second.obj: src/second.c $(CC) obj/second.c ... etc obj/third.obj: src/third.c $(CC) obj/third.c ... etc project2: obj/four.obj obj/five.obj obj/six.obj obj/four.obj: src/four.c $(CC) four.c ... etc obj/five.obj: src/five.c $(CC) obj/five.c ... etc obj/six.obj: src/six.c $(CC) obj/six.c ... etc project3: obj/seven.obj obj/eight.obj obj/nine.obj obj/seven.obj: src/seven.c $(CC) seven.c ... etc obj/eight.obj: src/eight.c $(CC) obj/eight.c ... etc obj/nine.obj: src/nine.c $(CC) obj/nine.c ... etc </code></pre> <p>The first time I ran <code>make all</code>, everything compiled find. Then I did:</p> <pre><code>$ touch src/four.c $ make all $ </code></pre> <p>But <code>make</code> exits without compiling anything. I guess it did not detect that one of the .c files had changed, however I don't see what's wrong with my dependencies.</p> <p>What I expected:<br> <code>touch</code>ing <code>src/four.c</code> should have marked <code>obj/four.obj</code> obsolete, and <code>project2</code> aswell, hence marking <code>mybin</code> obsolete too. This chain should trigger a new compilation of <code>src/four.c</code> to <code>obj/four.obj</code> and then a new linkage of the whole project.</p>
    singulars
    1. This table or related slice is empty.
    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.
    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