Skip to content

Commit

Permalink
Merge pull request s-matyukevich#197 from SimplyAhmazing/patch-1
Browse files Browse the repository at this point in the history
Fix spelling typo
  • Loading branch information
s-matyukevich authored Jul 4, 2020
2 parents 3fe67b6 + 33d6c97 commit f8369bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/lesson01/linux/build-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ After we examined Linux kernel structure, it worth spending some time investigat
* `targets` are file names, separated by spaces. Targets are generated after the rule is executed. Usually, there is only one target per rule.
* `prerequisites` are files that `make` trackes to see whether it needs to update the targets.
* `recipe` is a bash script. Make calls it when some of the prerequisites have been updated. The recipe is responsible for generating the targets.
* Both targets and prerequisites can include wildcards (`%`). When wildcards are used the recipe is executed for each of the mached prerequisites separately. In this case, you can use `$<` and `$@` variables to refer to the prerequisite and the target inside the recipe. We already did it in the [RPi OS makefile](https://github.com/s-matyukevich/raspberry-pi-os/blob/master/src/lesson01/Makefile#L14).
* Both targets and prerequisites can include wildcards (`%`). When wildcards are used the recipe is executed for each of the matched prerequisites separately. In this case, you can use `$<` and `$@` variables to refer to the prerequisite and the target inside the recipe. We already did it in the [RPi OS makefile](https://github.com/s-matyukevich/raspberry-pi-os/blob/master/src/lesson01/Makefile#L14).
For additional information about make rules, please refer to the [official documentation](https://www.gnu.org/software/make/manual/html_node/Rule-Syntax.html#Rule-Syntax).

* `make` is very good in detecting whether any of the prerequisites have been changed and updating only targets that need to be rebuilt. However, if a recipe is dynamically updated, `make` is unable to detect this change. How can this happen? Very easily. One good example is when you change some configuration variable, which results in appending an additional option to the recipe. By default, in this case, `make` will not recompile previously generated object files, because their prerequisites haven't been changed, only the recipe have been updated. To overcome this behavior Linux introduces [if_changed](https://github.com/torvalds/linux/blob/v4.14/scripts/Kbuild.include#L264) function. To see how it works let's consider the following example.
Expand Down

0 comments on commit f8369bf

Please sign in to comment.