-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (40 loc) · 1.22 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
# util for the project
.PHONY: help
.PHONY: init-folders unittest verilog verilog-dbg
.PHONY: apidoc html docs clean clean-docs
help:
@printf 'Project Make\n'
@printf 'Please use `make target' where target is one of\n'
@printf ' init to init the project, create some empty folders\n'
@printf ' unittest to run the unit test\n'
@printf ' verilog to generate verilog file for the top module\n'
@printf ' verilog-dbg to generate verilog file for the top module, with src info\n'
@printf ' docs to generate docs for the project\n'
@printf ' clean to clean the generated verilogs and docs\n'
@printf ' clean-docs to clean the generated docs\n'
# Run ONCE
# Make empty folders:
init:
mkdir -p ./hw/gen
mkdir -p ./tests/waveform
mkdir -p ./docs/source/_static
# Tests
unittest:
python -m unittest discover -t . -s tests -v
# Verilog gen
verilog:
python -m hw.project_name.Top --no-src
verilog-dbg:
python -m hw.project_name.Top
# Doc gen
apidoc:
sphinx-apidoc -f -e -o ./docs/source/apidoc ./hw/
html:
$(MAKE) -C ./docs/ html
docs: apidoc html
clean:
rm -f ./hw/gen/*
rm -f ./tests/waveform/*
rm -f ./docs/source/_static/*
clean-docs:
$(MAKE) -C ./docs/ clean