-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (63 loc) · 2.21 KB
/
Makefile
File metadata and controls
68 lines (63 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# SPDX-License-Identifier: MIT
# Top-level Makefile for MyCPU projects
# Include common build utilities
include common/build.mk
# Project directories
PROJECTS := 1-single-cycle 2-mmio-trap 3-pipeline 4-soc
ALL_MODULES := common $(PROJECTS)
TEST_DIR := tests
.PHONY: clean distclean
# Clean build artifacts from all projects
clean:
@echo "Cleaning build artifacts from all projects..."
@for project in $(PROJECTS); do \
if [ -f $$project/Makefile ]; then \
echo "Cleaning $$project..."; \
$(MAKE) -C $$project clean 2>/dev/null || true; \
fi; \
done
@echo "Clean complete."
# Deep clean: remove test results and all generated files
distclean: clean
@echo "Performing deep clean..."
@echo "Removing test work directories and artifacts..."
@rm -rf $(TEST_DIR)/riscof_work
@rm -rf $(TEST_DIR)/riscof_work_1sc
@rm -rf $(TEST_DIR)/riscof_work_2mt
@rm -rf $(TEST_DIR)/riscof_work_3pl
@rm -rf $(TEST_DIR)/rv32emu
@rm -rf $(TEST_DIR)/riscv-arch-test
@echo "Removing RISCOF generated ISA/platform YAML files..."
@rm -f $(TEST_DIR)/riscof_work/*.yaml
@echo "Removing sbt build artifacts from all modules (common + projects)..."
@for module in $(ALL_MODULES); do \
echo " Cleaning $$module build artifacts..."; \
rm -rf $$module/target; \
rm -rf $$module/project/target; \
rm -rf $$module/project/project; \
rm -rf $$module/.bloop; \
rm -rf $$module/.metals; \
rm -rf $$module/.vscode; \
rm -f $$module/*.log; \
done
@echo "Removing auto-generated compliance test files..."
@for project in $(PROJECTS); do \
rm -f $$project/src/test/scala/riscv/compliance/ComplianceTest.scala; \
done
@echo "Removing temporary test resources..."
@for project in $(PROJECTS); do \
rm -f $$project/src/main/resources/test.asmbin; \
done
@echo "Removing Verilator generated files..."
@for project in $(PROJECTS); do \
rm -rf $$project/generated; \
rm -f $$project/*.vcd; \
rm -f $$project/*.fst; \
done
@echo "Removing sbt output logs from test directories..."
@find $(TEST_DIR)/riscof_work -name "sbt_output.log" -delete 2>/dev/null || true
@echo "Removing ChiselTest artifacts..."
@rm -rf test_run_dir
@echo ""
@echo "Deep clean complete. All generated files removed."
@echo "Source files and configuration preserved."