I know that I can copy paste this command in my terminal, but how do I type this?
make ex1
cc ex1.c -o ex1
Typing it all on one line produces the following:
make: Nothing to be done for ex1.
make: *** No rule to make target cc. Stop.
You should type only make ex1
do not add cc ex1.c -o ex1
, make
will run that command.
If you are getting make: Nothing to be done for ex1
error means you already have a ex1 compiled file in your directory where ex1.c is present. You need to delete/move/rename that file because make
will try to create file named ex1
(same name) if file with same name is already there it gives error. That why its giving error.
You can use directly cc filename.c -o filename(anyname)
which is the same.