forked from chipsalliance/yosys-f4pga-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
79 lines (62 loc) · 2.24 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
# Copyright 2020-2022 F4PGA Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
PLUGIN_LIST := fasm xdc params sdc ql-iob design_introspection integrateinv ql-qlf systemverilog uhdm dsp-ff
PLUGINS := $(foreach plugin,$(PLUGIN_LIST),$(plugin).so)
PLUGINS_INSTALL := $(foreach plugin,$(PLUGIN_LIST),install_$(plugin))
PLUGINS_CLEAN := $(foreach plugin,$(PLUGIN_LIST),clean_$(plugin))
PLUGINS_TEST := $(foreach plugin,$(PLUGIN_LIST),test_$(plugin))
.PHONY: all
all: plugins
TOP_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))
REQUIREMENTS_FILE ?= requirements.txt
ENVIRONMENT_FILE ?= environment.yml
-include third_party/make-env/conda.mk
define install_plugin =
.PHONY: $(1).so
$(1).so:
$$(MAKE) -C $(1)-plugin $$@
.PHONY: install_$(1)
install_$(1):
$$(MAKE) -C $(1)-plugin install
.PHONY: clean_$(1)
clean_$(1):
$$(MAKE) -C $(1)-plugin clean
.PHONY: test_$(1)
test_$(1):
@$$(MAKE) --no-print-directory -C $(1)-plugin test
endef
$(foreach plugin,$(PLUGIN_LIST),$(eval $(call install_plugin,$(plugin))))
pmgen.py:
wget -nc -O $@ https://raw.githubusercontent.com/YosysHQ/yosys/master/passes/pmgen/pmgen.py
.PHONY: plugins
plugins: $(PLUGINS)
.PHONY: install
install: $(PLUGINS_INSTALL)
.PHONY: test
test: $(PLUGINS_TEST)
.PHONY: plugins_clean
plugins_clean: $(PLUGINS_CLEAN)
.PHONY: clean
clean:: plugins_clean
rm -rf pmgen.py
CLANG_FORMAT ?= clang-format-8
.PHONY: format
format:
find . \( -name "*.h" -o -name "*.cc" \) -and -not -path '*/third_party/*' -print0 | xargs -0 -P $$(nproc) ${CLANG_FORMAT} -style=file -i
VERIBLE_FORMAT ?= verible-verilog-format
.PHONY: format-verilog
format-verilog:
find */tests \( -name "*.v" -o -name "*.sv" \) -and -not -path '*/third_party/*' -print0 | xargs -0 $(VERIBLE_FORMAT) --inplace