title: How to add additional source files in Makefile
body: <p>I have a Makefile that I use to build executable on mac os x, using mpicc compiler, linking mkl_lapack.h library.
  Now this Makefile is perfectly working, the only problem is that I don't know what to add if I want to compile Eigenvalues.c linking other .c files, if I want to link myfile.c where do I have to write it in Makefile?</p>
  
  <pre><code>MKL_INCLUDE=/opt/intel/mkl/include
  MKLROOT=/opt/intel/mkl/lib
  
  CC = mpicc
  LD = mpicc
  IFLAGS = -I$(MKL_INCLUDE)
  CFLAGS = -Wall -O2 $(IFLAGS) -std=c99
  
  LFLAGS =  $(MKLROOT)/libmkl_intel_lp64.a $(MKLROOT)/libmkl_sequential.a    $(MKLROOT)/libmkl_core.a  -lpthread -lm 
  
  PROGRAMS = Eigenvalues
  
  all: $(PROGRAMS)
  
  Eigenvalues: 
      $(CC) $(CFLAGS) -o $@ $^ $(LFLAGS) 
  
  %.o: %.c
      @echo C compiling $@
      $(CC) -c $(CFLAGS) -o $@ $&lt;
  
  clean:
      rm -rf *.o $(PROGRAMS)
  
  Eigenvalues: Eigenvalues.c
  </code></pre>