nerdexam
LPI

010-100 · Question #58

You have finished updating and resolving dependencies for some source code. What command should you run before recompiling the code into binary form?

The correct answer is A. make clean. Running make clean before recompiling removes stale object files and binaries so the build system recompiles all source files from scratch.

The Power of the Command Line

Question

You have finished updating and resolving dependencies for some source code. What command should you run before recompiling the code into binary form?

Options

  • Amake clean
  • Bmake all
  • Cmakedep
  • Dmake install

How the community answered

(33 responses)
  • A
    76% (25)
  • B
    3% (1)
  • C
    6% (2)
  • D
    15% (5)

Why each option

Running make clean before recompiling removes stale object files and binaries so the build system recompiles all source files from scratch.

Amake cleanCorrect

The make clean target invokes removal of previously compiled object files (.o files) and binaries generated by prior builds. After updating source code or resolving dependencies, old compiled artifacts may be incompatible with the new code, causing linking errors or stale code being included. Running make clean ensures the subsequent compilation starts from a clean state using only the updated source files.

Bmake all

make all compiles all defined targets but does not remove old artifacts first, risking stale object files being linked into the new binary.

Cmakedep

makedep is not a standard make target - dependency generation is typically handled by the compiler or by make -M flags, not a standalone makedep invocation before recompiling.

Dmake install

make install copies already-compiled binaries to system directories and does not perform any compilation or cleanup of build artifacts.

Concept tested: make clean to remove stale build artifacts

Source: https://www.gnu.org/software/make/manual/make.html#Cleaning-Up

Topics

#make clean#source compilation#build tools

Community Discussion

No community discussion yet for this question.

Full 010-100 Practice