50

I wonder in the installation process of configure, make, make check and make install, what does make check do? Thanks!

JoSSte
  • 2,953
  • 6
  • 34
  • 54
Tim
  • 1
  • 141
  • 372
  • 590

4 Answers4

54

Strictly speaking, it doesn't necessarily do anything.

If a Makefile has a target named check, then make check will "build" that target. It's typically a phony target, meaning that it is a make-scripted command rather than a file named "check" that gets created.

The gnu project advises that all gnu software should include a make check target that runs post-build tests in the build directory, so make check can be used frequently on packages distributed from the FSF. Other projects will sometimes follow this convention as well.

DigitalRoss
  • 143,651
  • 25
  • 248
  • 329
16

According to the GNU Make manual, it performs self tests on the program this makefile builds.

Blair McMillan
  • 5,299
  • 2
  • 25
  • 45
11

make check is a command to a makefile. It does whatever the makefile defines it to do.

It sounds like a little background on makefiles would be good. This is a tutorial that my school uses for a programming course. Here are some good quotes:

Make can be used to automatically execute the many Linux commands that are needed to compile, link, and test a large C++ program. Since these commands will be executed hundreds of times during a program's development, automating these tasks is essential.
Black Frog
  • 11,595
  • 1
  • 35
  • 66
Jamison Dance
  • 19,896
  • 25
  • 97
  • 99
0

The most common place that you will see this is when automake is used. Automake has features that make (no pun intended) it relatively simple to generate a series of test cases and produce a pretty summary of the results. For more info, see here:

John K
  • 1