From 680acef72a84b1d3810ffd88c06639bafd1d4b3a Mon Sep 17 00:00:00 2001 From: Robert Norton Date: Wed, 9 May 2018 16:30:46 +0100 Subject: Add targets for counting lines in mips, cheri and riscv. Can use either sloccount or cloc. sloccount seems to be reliable but lacks a way to tell it that sail files can be treated like ocaml without renaming the files. cloc has a nicer interface is lower quality in other regards like broken ocaml support in versions shipped with Ubuntu (e.g. treats {...} as comment, no nested comments support). For sail2 syntax this is OK because we use the C parser instead which gives the same results as sloccount. --- mips/Makefile | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mips/Makefile') diff --git a/mips/Makefile b/mips/Makefile index 00703f62..6e3ef49e 100644 --- a/mips/Makefile +++ b/mips/Makefile @@ -28,5 +28,11 @@ M%.thy: m%.lem m%_types.lem mips_extras.lem lem -isa -outdir . -lib $(SAIL_DIR)/src/gen_lib -lib $(SAIL_DIR)/src/lem_interp $^ sed -i 's/datatype ast/datatype (plugins only: size) ast/' M$*_types.thy +LOC_FILES:=$(MIPS_PRE) $(MIPS_TLB) $(MIPS_SAILS) $(MIPS_MAIN) +include ../etc/loc.mk + +cloc: $(LOC_FILES) + cloc --by-file --force-lang C,sail $^ + clean: rm -rf mips Mips.thy mips.lem _sbuild -- cgit v1.2.3