-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
48 lines (44 loc) · 1.28 KB
/
Makefile
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
# Makefile
SHELL := /usr/bin/bash
# Help
.PHONY: help
help:
@echo "Commands:"
@echo "style : executes style formatting."
@echo "clean : cleans all unnecessary files."
@echo "clean_tt : cleans all unnecessary Tesntorrent model files."
# Styling
.ONESHELL:
.PHONY: style
style:
@echo "Running styling..."
@black .
@flake8
@python3 -m isort .
# Cleaning
.ONESHELL:
.PHONY: clean
clean: style
@echo "Cleaning files..."
@find . | grep -E "(__pycache__|\.pyc|\.pyo)" | xargs rm -rf
@find . | grep -E ".pytest_cache" | xargs rm -rf
@find . | grep -E ".ipynb_checkpoints" | xargs rm -rf
@find . | grep -E ".trash" | xargs rm -rf
@rm -f .coverage
@echo "All done cleaning!"
# Cleaning PyBUDA artifacts
.ONESHELL:
.PHONY: clean_tt
clean_tt:
@echo "Cleaning TT files..."
@find . | grep -E ".hlkc_cache" | xargs rm -rf
@find . | grep -E "*netlist.yaml" | xargs rm -rf
@find . | grep -E ".pkl_memoize_py3" | xargs rm -rf
@find . | grep -E "generated_modules" | xargs rm -rf
@find . | grep -E "tt_build" | xargs rm -rf
@find . | grep -E "device_images" | xargs rm -rf
@find . -type f -name "*.onnx" | xargs rm -f
@find . -type f -name "*.tflite" | xargs rm -f
@find . -type f -name "*.h5" | xargs rm -f
@find . -type f -name "*.png" | xargs rm -f
@echo "All done cleaning TT files!"