I've written a makefile and saved it under the name "MakeFile" (provided below) for my program. It's in the same folder as my programs.
all: main
main.o: main.cc Greetings.cc
g++ -c -Werror main.cc
Greetings.o: Greetings.cc Greetings.h
g++ -c -Werror Greetings.cc
main: main.o Greetings.o
g++ -0 main main.o Greetings.o
Now how do I actually use the makefile? I read that you should type in make [options] [target1 target2 ...]. What are options and target? As an experiment, I tried typing "make MakeFile" and I got an error as shown below.
Conrados-MBP:~ conrados$ make MakeFile
make: *** No rule to make target `MakeFile'. Stop.
all: main
main.o: main.cc Greetings.cc
g++ -c -Werror main.cc
Greetings.o: Greetings.cc Greetings.h
g++ -c -Werror Greetings.cc
main: main.o Greetings.o
g++ -0 main main.o Greetings.o
Now how do I actually use the makefile? I read that you should type in make [options] [target1 target2 ...]. What are options and target? As an experiment, I tried typing "make MakeFile" and I got an error as shown below.
Conrados-MBP:~ conrados$ make MakeFile
make: *** No rule to make target `MakeFile'. Stop.