I'm learning C Programming through "Learn C the Hard Way." I am currently (for quite a long time) on Exercise 2, which can be found here: http://c.learncodethehardway.org/book/ex2.html
In the extra credit section, there is a challenge which asks us to edit the Makefile so we can compile the .c file (ex1.c) using just the command "make". This is what the challenge exactly says:
Create an all: ex1 target that will build ex1 with just the command make.
Through looking here and a bunch of other places, this is the code I think is correct:
CFLAGS="-Wall" -g
all: ex1
CFLAGS="-Wall" -g
clean:
rm -f ex1
However, when I try to run this, I get the compiled file and keep getting an error:
cc "-Wall" -g ex1.c -o ex1
CFLAGS="-Wall" -g
/bin/sh: 1: -g: not found
make: *** [all] Error 127
What is happening here? What is the reason behind the error message? How can I fix this?
Thanks guys.