I am going through an eg pgm to create a make file.
http://mrbook.org/tutorials/make/
My folder eg_make_creation contains the following files,
desktop:~/eg_make_creation$ ls
factorial.c functions.h hello hello.c main.c Makefile
Makefile
all:gcc -c main.c hello.c factorial.c -o hello
error:
desktop:~/eg_make_creation$ make all
make: *** No rule to make target `gcc', needed by `all'. Stop.
Please help me understand to compile this program.
The syntax of makefiles is very strict:
What you wrote makes
alldepend ongcc,-c, … which are not valid targets.What you need is something like:
(If you want to compile and link in one step, don’t use the
-cswitch).