131 Week 12 - Build Automation Flashcards

1
Q

Build automation systems

A

Automate the process of compiling source code (from multiple source files) into binary executable code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Build script generation tools

A

Generate files for build automation systems.
Do not build executable code directly.
Users can set up a high-level configuration and generate build scripts for a specific operating system.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Need for build automation systems

A

Build automation is crucial for collaboration and faster compilation through incremental builds.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Make

A

Build automation system reads a script, called makefile.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Makefile

A

The project structure (e.g., files and dependencies between files).
Instructions for the creation of binary files (e.g., object files and executable files).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Makefile target

A

Is the name for the ACTIONS that follow the target.
Can be a filename, variable or string.
To execute the actions of target targetName, type:
“make targetName”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Makefile dependencies

A

A list of the requirements for a target such as filenames or other targets.
If target and the dependencies are filenames, their timestamps are compared, and if the target does not exist or if it is older than the dependencies, the actions are executed only .
If a dependency is the name of another target , control will descend to the actions of the other target.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Makefile actions

A

Shell commands that are executed when “make targetName” is run.
Use tab to indent an action.
backslash can be used to split an action over multiple lines

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Makefile rule

A

Formed of the target, dependencies and actions.
A rule contains the actions to meet a target when the dependencies are fulfilled.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Makefile variables

A

Variables are defined using variableName = variableContent.
Variables are used by starting with a dollar sign and then including the variable name in brackets. E.g.,
CC = gcc
$(CC) code.c -o code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Automatic variables

A

$@ - The filename of the target.
$* - The filename of the target without the file extension.
$^ - The filenames of all dependencies.
$< - The filename of the first dependency.
$? - The filenames of all dependencies that are newer than the target.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Pattern matching character

A

If you have 2 rules with the same action for different filenames you can use the pattern matching character % which matches a dependency filename without the extension.
e.g.,
%.o: %.c mylib.h
gcc -c $< -o $@

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Phony targets

A

Targets that do not represent filenames but are instead names that are always treated as out of date so will always run.
Common examples are “all” and “clean”.
all establishes a default rule which will be run if just make is typed instead of a specified rule.
clean is often used to remove files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly