5

suppose that you have a program which you installed that from source by make command . That program include files a.cc, b.cc, c.cc, d.cc and ... .

Now I changed a.cc a bit. In order to enable the changes I should compile the program again by make command.

My question: Is make command just recompile the changed files or recompile all of the files.

ps :all of the files are define on as .o on the Makefile.

1 Answers1

1

In general way, You don't need recompile all of .cc files according to modify a .cc file.

The a .cc file is related with other .cc by using .h file.

For example:

Let's guess b.h is a header about b.cc.

And a.cc use b.h.

You don't need recompile a.cc due to modify and compile b.cc.

But You need to recompile about b.h.

If the makefile is created as well(based on autotools), make command will process the dependencies as well.

xiaodongjie
  • 2,874