I'm really confused at the moment.
So I have 5 files: main.c, flight.c, flight.h, passenger.c, and passenger.h
flight.h has function prototypes for flight.c, and passenger.h has function prototypes for passenger.c
flight.c and passenger.c have definitions for these functions.
main.c is the program I'll interact with, calling functions from both .c files
I'm not really sure what .o files are for, somebody please care to explain? Here is my Makefile:
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
EDIT: I then use the command "make Makefile", and get an error: make: Nothing to be done for `Makefile'.
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.