title: No rule to make something.o even though %.o is defined
body: <p>I'm new to the forum, so I hope I'm doing things right.</p>
  
  <p>I'm writing from scratch a Makefile for a C project. It was working at some point, then I tried to improve it a little (including separate folders), and I got the well-known error "No rule to make target "obj/autresFonctions.o", needed for "CUR"". Or similar, since it's not in english and I translated.</p>
  
  <p>That seems quite weird since the rule I'm expecting to work is using %.o and should match anyhting. Thus I don't think it could be a typo.</p>
  
  <p>Here is the Makefile : </p>
  
  <pre><code>EXE=prgm
  CC=gcc
  
  SRC_DIR=src
  OBJ_DIR=obj
  INCLUDE_DIR=include
  
  _FICHIERS_H = autresFonctions.h calculPrealable.h constantes.h fonctionsAnnexes.h fonctionBoucles.h lectureFichiers.h main.h
  FICHIERS_H = $(patsubst %, $(INCLUDE_DIR)/%, $(_FICHIERS_H))
  
  _OBJ = autresFonctions.o calculPrealable.o fonctionsAnnexes.o fonctionsBoucles.o lectureFichiers.o main.o
  OBJ = $(patsubst %, $(OBJ_DIR)/%, $(_OBJ))
  
  
  FLAGS=-Wall -Wextra
  
  
  
  CUR: $(OBJ)
      $(CC) -o $(EXE) $^
  
  $(OBJ_DIR)/%.o: $(SRC_DIR)/%.c $(FICHIERS_H)
      $(CC) $(FLAGS) -c -o $@ $&lt; 
  
  clean:
      rm $(OBJ) $(EXE) 
  </code></pre>
  
  <p>I'm assuming it's the same for the others .o, because I also tried switching the first two .o in _OBJ , and I got the same error with calculPrealable.o</p>
  
  <p>I'm just typing "make" when compiling, in order to get CUR, the main target. I'm located in the main directory, which contains include/ (with the .h), src/ (with the .c) and obj/ (empty).</p>
  
  <p>EDIT : I forgot to say, but I'm using the usual GNU make.</p>