I'm working through Learn C The Hard Way
and in Ex2 Extra Credit they ask you to create an all: ex1
target that will build ex1 with just the command make
.
This is the code I've created:
CFLAGS=-Wall -g
all: ex1
clean:
rm -f ex1
It works.
When I run just make
from the command line it make
s the ex1 file. And when I run make clean
it removes the file.
What I don't understand is why:
all: ex1
isn't:
all:
make ex1
Where is it getting the make
command from? The command line I guess, but then why does make clean run rm -f ex1
and not make rm -f ex1
and fail. It seems inconsistent to me. Can somebody explain what's going on?