Home > Articles > Programming > C/C++

  • Print
  • + Share This
This chapter is from the book

What You Should See

If that worked, then you should see this:

Exercise 2 Session

$ make clean
rm -f ex1
$ make ex1
cc -Wall -g    ex1.c   -o ex1
ex1.c: In function 'main':
ex1.c:3: warning: implicit declaration of function 'puts'
$

Here you can see that I’m running make clean, which tells make to run our clean target. Go look at the Makefile again and you’ll see that under this command, I indent and then put in the shell commands I want make to run for me. You could put as many commands as you wanted in there, so it’s a great automation tool.

Notice that even though we don’t mention ex1 in the Makefile, make still knows how to build it and use our special settings.

  • + Share This
  • 🔖 Save To Your Account