3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2026-07-30 16:14:01 +00:00

tests: Add clean_rules target

Calling `make clean` can fail if a test folder has been collected but the source no longer exists. `make clean_rules` bypasses this by skipping the `include make/rules/collect.mk` in the same way as `make help`.
This commit is contained in:
Krystine Sherwin 2026-07-16 11:45:17 +12:00
parent 948a2caacb
commit 6a71a74ed8
No known key found for this signature in database

View file

@ -47,7 +47,8 @@ make/rules/collect.mk: make/collect_tests.py
make/rules/test/%.mk:
python3 make/test_rules.py --rule $@ --source $<
ifneq (help,$(MAKECMDGOALS))
NO_COLLECT_TARGS := help clean_rules
ifneq ($(filter-out $(NO_COLLECT_TARGS),$(MAKECMDGOALS)),)
# This should run every time but only trigger anything depending on it whenever
# the script overwrites make/rules/found_tools. This doesn't really match how
@ -66,3 +67,7 @@ endif
include make/rules/collect.mk
endif
.PHONY: clean_rules
clean_rules:
@rm -rf make/rules