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.
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)- A76% (25)
- B3% (1)
- C6% (2)
- D15% (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.
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.
make all compiles all defined targets but does not remove old artifacts first, risking stale object files being linked into the new binary.
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.
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
Community Discussion
No community discussion yet for this question.