Commit e03fcd9
committed
Avoid infinite dry-run loop with automake projects
The top makefile in projects that use autotools and automake contains a
rule to remake the makefile itself when the configuration changes
(configure.ac).
Even when dry-running, GNU make regenerates the makefile, in a bid to
generate a 'correct' dry-run output.
VScode needs to add --always-make in order to get a complete view of the
dry-run. Without it, it would only get the commands needed for outdated
targets.
These two behaviours combined cause a naive 'make --dry-run --always-make'
to continuously remake the Makefile. In order to avoid this infinite loop,
make must be instructed as in the "Remaking Makefiles" man page, to
avoid remaking the makefile. This is done by adding two options:
--assume-old=Makefile, and
Makefile (ie, target).
Make requires the Makefile to be explicitly specified as target, otherwise
it ignores the --assume-old=Makefile option.
Furthermore, Makefiles generated by automake cause the top invocation to
be a recursive sub-make invocation. On recursive makes, make itself calls
submake without passing the --assume-old option, thus breaking the combo
required for the sub-make to avoid remaking the makefile. As a result,
automake Makefiles need one more workaround. The --assume-old option must
be manually passed to sub-make via the AM_MAKEFLAGS, which is always
appended to sub-make's command line.
This commit implements the above incantation to enable automake Makefiles
to be dry-run without an infinite loop.
Additionally, the makefilePath, makeDirectory, updatedMakefilePath and
updatedMakeDirectory variables are made to store the respective setting,
rather then re-purposing them to store the corresponding resolved,
absolute paths. makefilePath cannot be undefined because for dry-running
the name of the makefile must always be supplied on the make commandline.1 parent aeb59ee commit e03fcd9
3 files changed
Lines changed: 18 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
198 | | - | |
199 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | 204 | | |
205 | | - | |
206 | | - | |
| 205 | + | |
| 206 | + | |
207 | 207 | | |
| 208 | + | |
208 | 209 | | |
209 | | - | |
| 210 | + | |
210 | 211 | | |
211 | 212 | | |
212 | 213 | | |
213 | 214 | | |
214 | 215 | | |
215 | | - | |
| 216 | + | |
216 | 217 | | |
217 | 218 | | |
218 | 219 | | |
219 | 220 | | |
220 | 221 | | |
221 | | - | |
222 | | - | |
| 222 | + | |
| 223 | + | |
223 | 224 | | |
| 225 | + | |
224 | 226 | | |
225 | | - | |
| 227 | + | |
226 | 228 | | |
227 | 229 | | |
228 | 230 | | |
| |||
806 | 808 | | |
807 | 809 | | |
808 | 810 | | |
809 | | - | |
| 811 | + | |
810 | 812 | | |
811 | 813 | | |
812 | 814 | | |
| |||
1305 | 1307 | | |
1306 | 1308 | | |
1307 | 1309 | | |
1308 | | - | |
1309 | | - | |
1310 | | - | |
1311 | 1310 | | |
1312 | 1311 | | |
1313 | 1312 | | |
| |||
1319 | 1318 | | |
1320 | 1319 | | |
1321 | 1320 | | |
1322 | | - | |
1323 | | - | |
1324 | | - | |
1325 | 1321 | | |
1326 | 1322 | | |
1327 | 1323 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
467 | 467 | | |
468 | 468 | | |
469 | 469 | | |
| 470 | + | |
470 | 471 | | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
471 | 475 | | |
472 | 476 | | |
473 | 477 | | |
| |||
0 commit comments