title: How to write a Makefile with separate source and header directories?
body: <p>Following <a href="http://www.cs.colby.edu/maxwell/courses/tutorials/maketutor/" rel="noreferrer">this tutorial</a>...</p>
  <p>I have 2 source files and 1 header file. I want to have them in separate directories like in the tutorial.</p>
  <p>So I set this project up:</p>
  <pre><code>.
  ├── include
  │   └── hellomake.h
  ├── Makefile
  └── src
      ├── hellofunc.c
      └── hellomake.c
  </code></pre>
  <p>Makefile:</p>
  <pre><code>IDIR =../include
  CC=gcc
  CFLAGS=-I$(IDIR)
  
  ODIR=obj
  LDIR =../lib
  
  _DEPS = hellomake.h
  DEPS = $(patsubst %,$(IDIR)/%,$(_DEPS))
  
  _OBJ = hellomake.o hellofunc.o 
  OBJ = $(patsubst %,$(ODIR)/%,$(_OBJ))
  
  $(ODIR)/%.o: %.c $(DEPS)
      $(CC) -c -o $@ $&lt; $(CFLAGS)
  
  hellomake: $(OBJ)
      gcc -o $@ $^ $(CFLAGS)
  
  .PHONY: clean
  
  clean:
      rm -f $(ODIR)/*.o *~ core $(INCDIR)/*~ 
  </code></pre>
  <p>The error I generate says:</p>
  <pre><code>gcc -o hellomake  -I../include
  gcc: fatal error: no input files
  compilation terminated.
  make: *** [hellomake] Error 4
  </code></pre>
  <p>What's happening?</p>