make: Testing
1
1 9.6 Testing the Compilation of a Program
1 ========================================
1
1 Normally, when an error happens in executing a shell command, 'make'
1 gives up immediately, returning a nonzero status. No further recipes
1 are executed for any target. The error implies that the goal cannot be
1 correctly remade, and 'make' reports this as soon as it knows.
1
1 When you are compiling a program that you have just changed, this is
1 not what you want. Instead, you would rather that 'make' try compiling
1 every file that can be tried, to show you as many compilation errors as
1 possible.
1
1 On these occasions, you should use the '-k' or '--keep-going' flag.
1 This tells 'make' to continue to consider the other prerequisites of the
1 pending targets, remaking them if necessary, before it gives up and
1 returns nonzero status. For example, after an error in compiling one
1 object file, 'make -k' will continue compiling other object files even
1 though it already knows that linking them will be impossible. In
1 addition to continuing after failed shell commands, 'make -k' will
1 continue as much as possible after discovering that it does not know how
1 to make a target or prerequisite file. This will always cause an error
11 message, but without '-k', it is a fatal error (⇒Summary of
Options Options Summary.).
1
1 The usual behavior of 'make' assumes that your purpose is to get the
1 goals up to date; once 'make' learns that this is impossible, it might
1 as well report the failure immediately. The '-k' flag says that the
1 real purpose is to test as much as possible of the changes made in the
1 program, perhaps to find several independent problems so that you can
1 correct them all before the next attempt to compile. This is why Emacs'
1 'M-x compile' command passes the '-k' flag by default.
1