title: How exactly do I use a makefile?
body: <p>I'm really confused at the moment.</p>
  
  <p>So I have 5 files: main.c, flight.c, flight.h, passenger.c, and passenger.h</p>
  
  <p>flight.h has function prototypes for flight.c, and passenger.h has function prototypes for passenger.c</p>
  
  <p>flight.c and passenger.c have definitions for these functions.</p>
  
  <p>main.c is the program I'll interact with, calling functions from both .c files</p>
  
  <p>I'm not really sure what .o files are for, somebody please care to explain? Here is my Makefile:</p>
  
  <pre><code>flight.o: flight.c flight.h
      gcc -Wall -g -c flight.c    
  passenger.o: passenger.c passenger.o
      gcc -Wall -g -c passenger.c    
  main.o: main.c
      gcc -Wall -g -c main.c     
  reservations.out: main.o flight.o passenger.o
      gcc -Wall -g flight.o passenger.o main.o -o reservations.out
  </code></pre>
  
  <p>EDIT: I then use the command "make Makefile", and get an error: make: Nothing to be done for `Makefile'.</p>
  
  <p>In my file there is a tab before gcc.
  I'd appreciate any help, I'm sure there are lots of things I'm doing wrong. Thanks.</p>