@@ -115,6 +115,16 @@ $(PROG):
115
115
Note how we declare variables in ``make``, you should always declare your local
116
116
variables with ``:=``. To access the content of a variable we use the ``$(...)``,
117
117
note that we have to enclose the variable name in parenthesis.
118
+
119
+ {% capture note %}
120
+
121
+ The declaration of variables is usually done with ``:=``, but ``make`` does
122
+ support *recursively expanded* variables as well with ``=``.
123
+ Normally, the first kind of declaration is wanted, as they are more predictable
124
+ and do not have a runtime overhead from the recursive expansion.
125
+ {% endcapture %}
126
+ {% include note.html title="Note" content=note %}
127
+
118
128
We introduced a dependency of the rule all, namely the content of the variable
119
129
``PROG``, also we modified the printout, we want to see all the dependencies
120
130
of this rule, which are stored in the variable ``$^``.
@@ -260,24 +270,18 @@ Now you know enough about ``make`` to use it for building small projects.
260
270
261
271
{% capture note %}
262
272
263
- You might have noticed that ``make`` is not particularly easy to use and
264
- it can be from time to time difficult to understand what is going
265
- on under the hood.
266
273
In this guide, we avoided and disabled a lot of the commonly used ``make``
267
274
features that can be particularly troublesome if not used correctly, we highly
268
- recommend staying away from them if you do not feel confident working with
269
- ``make``.
270
-
271
- While ``make`` is indeed a handy tool to automate short interdependent
272
- workflows and to build small projects, it should *never* be used to build
273
- larger projects, like scientific programs.
274
- In particular modern Fortran programs can hardly be handled by a ``make``
275
- build system.
276
-
277
- To use ``make`` in a larger project, you cannot rely on ``make`` alone, usually
278
- other tools are used to generate the ``Makefile`` completely or in parts.
275
+ recommend staying away from the buildin rules and variables if you do not feel
276
+ confident working with ``make``, but explicitly declare all variables and rules.
277
+
278
+ You will find that ``make`` is capable tool to automate short interdependent
279
+ workflows and to build small projects. But for larger projects, you will
280
+ probably soon run against some of it limitations. Usually, ``make`` is therefore
281
+ not used alone but combined with other tools to generate the ``Makefile``
282
+ completely or in parts.
279
283
{% endcapture %}
280
- {% include tip .html title="Important " content=note %}
284
+ {% include note .html title="Note " content=note %}
281
285
282
286
283
287
# # The meson build system
0 commit comments