Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Did you specify the output file of compilation (likely the <code>-o</code> option)? By default (for most toolchains), compiling a <code>.c</code> file produces an <code>.o</code> file, not an <code>.obj</code> one.</p> <h2>UPD.</h2> <p>To get Make updating targets when some prerequisites change you have to provide an <strong>exact</strong> dependencies <strong>between files</strong> as far as Make use timestamps to determine whether a file has been changed.</p> <p>That is, <code>all</code> and <code>init</code> could remain as so-called <a href="http://www.gnu.org/software/make/manual/make.html#Phony-Targets" rel="nofollow"><code>.PHONY</code> targets</a>, but it is a good practice to make the rest targets to be files.</p> <pre><code>OUT_DIR := ./output SRC_DIR := ./src OBJ_DIR := ./obj MYBIN := $(OUT_DIR)/myapp.bin OBJS := $(addprefix $(OBJ_DIR)/, \ first.obj \ second.obj \ third.obj \ four.obj \ five.obj \ six.obj \ seven.obj \ eight.obj \ nine.obj) .PHONY : all mkdir-output mkdir-obj all : $(MYBIN) mkdir-output : @mkdir -p $(OUT_DIR) mkdir-obj : @mkdir -p $(OBJ_DIR) $(MYBIN) : $(OBJS) | mkdir-output $(LK) $^ -o $@ $(OBJS) : | mkdir-out $(OBJS) : $(OBJ_DIR)/%.obj : $(SRC_DIR)/%.c $(CC) $&lt; -object=$@ $(CC_OPT) </code></pre> <p>The last rule is GNU Make's <a href="http://www.gnu.org/software/make/manual/make.html#Static-Pattern" rel="nofollow">static pattern rule</a>. And the <code>mkdir-xxx</code> prerequisites after a pipe sign <code>|</code> are <a href="http://www.gnu.org/software/make/manual/make.html#Prerequisite-Types" rel="nofollow">order-only</a> ones.</p>
    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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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