]> git.ipfire.org Git - thirdparty/zstd.git/commit
streamline `make clean` list maintenance
authorYann Collet <cyan@fb.com>
Wed, 7 Sep 2022 23:10:13 +0000 (16:10 -0700)
committerYann Collet <cyan@fb.com>
Wed, 7 Sep 2022 23:36:03 +0000 (16:36 -0700)
commitc0b46738b4bae20ff0c316fa3f1c4b02c9c2b088
tree38de8d041db68ebd1d43347382f0b42f98a3748b
parent155d6a58a2a6290710194fd6367d720fca94a923
streamline `make clean` list maintenance

When creating a new `Makefile` target to build,
it's also necessary to update the `clean` target,
which purpose is to remove built targets when they are present.

This process is simple, but it's also easy to forget :
since there is a large distance between the position in the `Makefile` where the new built target is added,
and the place where the list of files to `clean` is defined.
Moreover, the list of files becomes pretty long over time,
hence it's difficult to visually ensure that all built targets are present there,
or that no old target (no longer produced) is no longer in the list

This PR tries to improve this process by adding a CLEAN variable.
Now, when a new built target is added to the `Makefile`,
it should preceded by :
```
CLEAN += newTarget
newTarget:
<TAB> ...recipe...
```

This new requirement is somewhat similar to `.PHONY: newTarget` for non-built targets.

This new method offers the advantage of locality :
there is no separate place in the file to maintain a list of files to clean.
This makes maintenance of `make clean` easier.
.github/workflows/dev-long-tests.yml
.github/workflows/dev-short-tests.yml
TESTING.md
tests/Makefile
zlibWrapper/Makefile