mirror of
https://github.com/facebook/zstd
synced 2026-08-22 22:32:07 -04:00
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.
This commit is contained in:
parent
155d6a58a2
commit
c0b46738b4
5 changed files with 49 additions and 30 deletions
|
|
@ -66,9 +66,10 @@ test: example fitblk example_zstd fitblk_zstd zwrapbench minigzip minigzip_zstd
|
|||
./zwrapbench -qi1b3B1K $(TEST_FILE)
|
||||
./zwrapbench -rqi1b1e3 ../lib
|
||||
|
||||
#valgrindTest: ZSTDLIBRARY = $(ZSTDLIBDIR)/libzstd.so
|
||||
valgrindTest: VALGRIND = LD_LIBRARY_PATH=$(ZSTDLIBDIR) valgrind --track-origins=yes --leak-check=full --error-exitcode=1
|
||||
valgrindTest: clean example fitblk example_zstd fitblk_zstd zwrapbench
|
||||
.PHONY: test-valgrind
|
||||
#test-valgrind: ZSTDLIBRARY = $(ZSTDLIBDIR)/libzstd.so
|
||||
test-valgrind: VALGRIND = LD_LIBRARY_PATH=$(ZSTDLIBDIR) valgrind --track-origins=yes --leak-check=full --error-exitcode=1
|
||||
test-valgrind: clean example fitblk example_zstd fitblk_zstd zwrapbench
|
||||
@echo "\n ---- valgrind tests ----"
|
||||
$(VALGRIND) ./example
|
||||
$(VALGRIND) ./example_zstd
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue