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?

enter image description hereThanks


The command is make hello, not make hello.c.


| improve this answer | |
  • great answer! @Cliff B – linghwan Nov 19 '19 at 15:37

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).

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .