-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
66 lines (47 loc) · 1.59 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# settings
PY := python3
ENV_NAME := venv
SFTW_DEP := graphviz graphviz-dev yosys opensta
# This will not be needed as the main.py already creates the folders
EXTRA_FOLDERS := test/ver test/z3
EXTRA_FOLDERS += output/aig output/area output/delay output/figure output/gv output/json output/log output/report output/ver output/z3
# computed
ACTIV_ENV := . $(ENV_NAME)/bin/activate
IN_ENV := $(ACTIV_ENV) &&
# includes
-include *.mk
# actions
help:
$(PY) main.py -h
activate:
# warning: will not work (limitation of `make`), you need to run it manually
. venv/bin/activate
py_init:
@echo "\n[[ creating python environment if absent ]]"
$(PY) -m venv $(ENV_NAME)
py_dep: py_init
@echo "\n[[ installing/upgrading python dependencies ]]"
$(IN_ENV) python3 -m pip install --upgrade pip
$(IN_ENV) pip install --upgrade -r requirements.txt
sftw_dep:
@echo "\n[[ installing/upgrading software dependencies ]]"
sudo apt install --yes --upgrade $(SFTW_DEP)
folders_dep:
@echo "\n[[ creating required folders ]]"
$(if $(strip $(EXTRA_FOLDERS)),mkdir -p $(EXTRA_FOLDERS),# nothing to create)
local_dep:
@echo "\n[[ generating local files ]]"
mkdir -p input/ver/ && cp -r input/ver.bak/* input/ver/
touch -a local.mk
setup: folders_dep py_init py_dep local_dep
setup-all: sftw_dep setup
rm_cache:
@echo "\n[[ removing all pycache folders ]]"
find . -name __pycache__ -prune -print -exec rm -rf {} \;
rm_temp:
@echo "\n[[ removing generated temporary files ]]"
rm -f yosys_graph.log
rm_pyenv:
@echo "\n[[ removing the virtual python environment ]]"
rm -rf $(ENV_NAME)
clean: rm_pyenv rm_cache rm_temp