]> git.sesse.net Git - bcachefs-tools-debian/commit
Makefile: avoid recursively expanding expensive variables
authorIvan Shapovalov <intelfx@intelfx.name>
Fri, 22 Dec 2023 06:51:17 +0000 (09:51 +0300)
committerIvan Shapovalov <intelfx@intelfx.name>
Fri, 22 Dec 2023 08:41:54 +0000 (11:41 +0300)
commitae818d9579bc521f2281237986ceb4fdb8827ede
treeeb5b38ac0ab81abad88f3ef7d5a73bc8a7dfb825
parenteaca023d5379bcf8f31a7a83ded985fe1565fc58
Makefile: avoid recursively expanding expensive variables

Specifically, do not recursively expand $(CFLAGS) because this leads to
repeatedly performing compile tests (e. g. cc-disable-warning) on every
recipe execution.

Without (nproc=32):
```
$ time env -i PATH=/usr/bin BCACHEFS_FUSE=1 NO_RUST=1 make -j$(nproc)
<...>
    [LD]     bcachefs
  72,48s user 11,29s system 190% cpu 44,036 total
```

With:
```
$ time env -i PATH=/usr/bin BCACHEFS_FUSE=1 NO_RUST=1 make -j$(nproc)
<...>
    [LD]     bcachefs
  66,79s user 5,17s system 1955% cpu 3,679 total
```
Makefile