1

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

2 Answers 2

1

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

1
  • great answer! @Cliff B
    – linghwan
    Commented Nov 19, 2019 at 15:37
0

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

You must log in to answer this question.

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