1/16
Flashcards reviewing the lecture on build automation, focusing on Makefiles.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What is the purpose of build automation systems?
To automate the process of compiling source code into binary executable code.
List some examples of build automation systems.
GNU Make, MPW Make, Google Bazel, SCons.
What do build script generation tools do?
Generate files for build automation systems based on a high-level configuration.
Give some examples of build script generation tools.
GNU Build System (autotools), CMake, Apache Meson.
What is the purpose of a makefile?
contains the project structure and instructions for creating binary files
What are the main components of a Make RULE?
TARGET, DEPENDENCIES, and ACTIONS.
In a makefile, how are ACTIONS indented?
Using a tab character.
What is the function of the backslash () in a makefile ACTION?
To break a long ACTION into multiple lines.
What is the significance of comparing timestamps between a TARGET and its DEPENDENCIES?
ACTIONS are executed only if the TARGET does not exist or is older than the DEPENDENCIES.
What happens if you run 'make' without specifying a TARGET when multiple TARGETS are present?
It will execute the ACTIONS of TARGET all (if it has defined) or the first TARGET.
In makefile version 3, how are variables defined and used?
Variables are defined with a name and value. Use $ and parentheses or braces to expand variables, e.g., $(CC).
What is a 'phony' TARGET in a makefile?
TARGETS that do not represent filenames and are always treated as 'out of date'.
What is the function of the 'clean' TARGET?
Removes object files or other generated files to clean the project directory.
What does the automatic variable '$@' represent in a makefile?
The filename of the TARGET.
What does the automatic variable '$<' represent in a makefile?
The filename of the first DEPENDENCY.
What does the automatic variable '$^' represent in a makefile?
The filenames of all DEPENDENCIES.
What does the pattern matching character '%' do in a makefile?
Matches a DEPENDENCY filename without the extension.