I saved the file as hello.c, and I think I'm inside /workspace/pset1/hello
However, I get the message "Nothing to be done for hello c.
Any idea what I'm doing wrong?
The command is make hello
, not make hello.c
.
If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)
tl;dr: make
's correct usage in this context is make outfile
, not make infile
.
Without a Makefile (which just tells make how to compile more complicated programmes - covered in pset3),
the command make
infers the source file to compile from the output filename.
That is, make foo
finds the file foo.c
in the present working directory, and if it exists and can be compiled, make creates the file foo
.
By calling make hello.c
, make
searches for hello.c.c, which doesn't exist (In reality, this wouldn't work either due to make
's built-in rules regarding C programmes, but you get it).