title: Makefile: no rule to make target
body: <p>I'm following this guide about <a href="http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/" rel="nofollow noreferrer">makefile</a>, but I didn't understand at all the last example and I can't get my makefile work, as I obtain the error <code>make: ***  No rule to make target "obj/date.o", needed by "Whatsapp".  Stop.</code>  </p>
  
  <p>Here is my makefile:  </p>
  
  <pre><code>IDIR = ../include
  CC = gcc
  CFLAGS = -I$(IDIR)
  
  ODIR = obj
  LDIR = ../lib
  
  LIBS = -lncurses
  
  # Keep the alphabetical order!
  _DEPS = \
  constants.h\
  date.h\
  inOut.h\
  languages.h\
  message.h\
  mycurses.h\
  mysocket.h\
  text.h\
  time.h\
  user.h\
  
  DEPS = $(patsubst %,$(IDIR)/%,$(_DEPS))
  
  # Keep the alphabetical order!
  _OBJ = \
  date.o\
  inOut.o\
  languages.o\
  main.o\
  message.o\
  mycurses.o\
  mysocket.o\
  text.o\
  time.o\
  user.o\
  
  OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))
  
  # these two lines should tell the compilator that my .o files depend by .c files, don't they?
  $(ODIR)/%.o: %.c $(DEPS)
      $(CC) -c -o $@ $&lt; $(CFLAGS)
  
  Whatsapp:   $(OBJ)
      $(CC) -o $@ $^ $(CFLAGS) $(LIBS)
  
  .PHONY: clean
  
  clean:
      rm -f $(ODIR)/*.o *~ core $(INCDIR)/*~ 
  </code></pre>
  
  <p>Obviously, all my <code>*.c</code> are in the current folder, so really I don't know what I am missing.</p>
  
  <p>Just for more clarity, here is the content of the current folder:  </p>
  
  <pre><code>urbijr@urbijr-VirtualBox:/media/sf_Whatsapp_CLIENT$ ls
  constants.h  indexbook.txt  languages.c  makefile              message.h    mycurses.h  text.c  time.h
  date.c       inOut.c        languages.h  message.c             message.txt  mysocket.c  text.h  user.c
  date.h       inOut.h        main.c       message_for_user.txt  mycurses.c   mysocket.h  time.c  user.h
  </code></pre>