[verible] Add Verible to lint makefile targets
Signed-off-by: Michael Schaffner <msf@opentitan.org>
diff --git a/hw/lint/Makefile b/hw/lint/Makefile
index 7bcd64f..215e9db 100644
--- a/hw/lint/Makefile
+++ b/hw/lint/Makefile
@@ -2,7 +2,8 @@
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
#
-# Makefile with ascentlint and verilator-lint targets for OpenTitan
+# Makefile with ascentlint, verilator-lint and verible style lint
+# targets for OpenTitan
#
# TODO: currently we cannot support parallel builds since some fusesoc cores
# define filesets with files outside the current folder (e.g. using relative
@@ -42,6 +43,7 @@
ips_lint = $(addsuffix _lint, $(IPS))
ips_vlint = $(addsuffix _vlint, $(IPS))
+ips_slint = $(addsuffix _slint, $(IPS))
######################
# ascentlint targets #
@@ -80,7 +82,6 @@
# verilator targets #
#####################
-# lint all discovered targets and make a report
vall: vlint
$(MAKE) vreport
@@ -93,12 +94,31 @@
rm -rf build
mkdir -p ${REPORT_DIR}
-fusesoc --cores-root ${CORE_ROOT} run --target=lint lowrisc:$(subst -,:,$(patsubst %_vlint,%,$@))
-# cp build/lowrisc_*$(patsubst %_vlint,%,$@)*/vlint-verilator/verilator-lint.rpt ${REPORT_DIR}/$@.rpt
-# TODO: add a verilator summary report function
-# add a summary report option for verilator
+# TODO: add summary reporting
vreport:
+##############################
+# verible style lint targets #
+##############################
+
+sall: slint
+ $(MAKE) sreport
+
+slint: clean
+ @echo Discovered vlint targets:
+ @echo -e "\n $(patsubst %,%\\n,$(strip $(ips_vlint)))"
+ $(MAKE) $(ips_vlint)
+
+# TODO(#1727): pass Verible config file to FuseSoC, once supported by Verible
+$(ips_slint):
+ rm -rf build
+ mkdir -p ${REPORT_DIR}
+ -fusesoc --cores-root ${CORE_ROOT} run --target=lint --tool=veriblelint lowrisc:$(subst -,:,$(patsubst %_slint,%,$@))
+
+# TODO: add summary reporting
+sreport:
+
##################
# common targets #
##################
@@ -107,4 +127,5 @@
rm -rf build
rm -rf ${REPORT_DIR}/*
-.PHONY: all lint $(ips_lint) report vall vlint $(ips_vlint) clean
+.PHONY: all lint $(ips_lint) report vall vlint $(ips_vlint) \
+ vreport sall slint $(ips_slint) clean sreport