-
Notifications
You must be signed in to change notification settings - Fork 52
/
Makefile
85 lines (60 loc) · 1.9 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Copyright 2023 ETH Zurich and University of Bologna.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
###############
# Executables #
###############
BENDER ?= bender
REGGEN = $(shell $(BENDER) path register_interface)/vendor/lowrisc_opentitan/util/regtool.py
#########################
# Files and directories #
#########################
ROOT = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
#######################
# Global Make targets #
#######################
.PHONY: all
.PHONY: clean
############
# Non-free #
############
NONFREE_REMOTE ?= [email protected]:pulp-restricted/snitch-cluster-nonfree.git
NONFREE_COMMIT ?= e30961e20a23a76442da27d2ba07c9fe20f3b575
NONFREE_DIR = $(ROOT)/nonfree
all: nonfree
clean: clean-nonfree
.PHONY: nonfree clean-nonfree
nonfree: $(NONFREE_DIR)
$(NONFREE_DIR):
git clone $(NONFREE_REMOTE) $(NONFREE_DIR)
cd $(NONFREE_DIR) && git checkout $(NONFREE_COMMIT)
clean-nonfree:
rm -rf $(NONFREE_DIR)
-include $(NONFREE_DIR)/Makefile
########
# Docs #
########
DOCS_DIR = docs
GENERATED_DOCS_DIR = $(DOCS_DIR)/generated
GENERATED_DOC_SRCS = $(GENERATED_DOCS_DIR)/peripherals.md
DOXYGEN_DOCS_DIR = $(DOCS_DIR)/doxygen
DOXYGEN_INPUTS = $(DOCS_DIR)/rm/snRuntime.md
DOXYGEN_INPUTS += $(shell find sw/snRuntime -name '*.c' -o -name '*.h')
DOXYFILE = $(DOCS_DIR)/Doxyfile
all: docs
clean: clean-docs
.PHONY: doc-srcs doxygen-docs docs clean-docs
doc-srcs: $(GENERATED_DOC_SRCS)
doxygen-docs: $(DOXYGEN_DOCS_DIR)
docs: doc-srcs doxygen-docs
mkdocs build
clean-docs:
rm -rf $(GENERATED_DOCS_DIR)
rm -rf $(DOXYGEN_DOCS_DIR)
rm -rf site
$(GENERATED_DOCS_DIR):
mkdir -p $@
$(GENERATED_DOCS_DIR)/peripherals.md: hw/snitch_cluster/src/snitch_cluster_peripheral/snitch_cluster_peripheral_reg.hjson | $(GENERATED_DOCS_DIR)
$(REGGEN) -d $< > $@
$(DOXYGEN_DOCS_DIR): $(DOXYFILE) $(DOXYGEN_INPUTS)
doxygen $<