summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-16 19:42:08 -0600
committerLuke T. Shumaker <lukeshu@lukeshu.com>2024-10-16 21:52:32 -0600
commit3cd39827ec2d2aa8d69762de8fbf72322ca85038 (patch)
tree4a92d5736df1c620413f656b2ea6771aec94cf98 /Makefile
parentc60b3a96cf9bfedbfc402a50e0b85f22d231d67b (diff)
copyright statements
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 20 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index fc4ebea..23de7d0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,8 @@
+# Makefile - Main build script for sbc-harness project
+#
+# Copyright (C) 2024 Luke T. Shumaker <lukeshu@lukeshu.com>
+# SPDX-Licence-Identifier: AGPL-3.0-or-later
+
linux.git = $(HOME)/src/github.com/torvalds/linux
all: build
@@ -54,6 +59,21 @@ lint:
mypy --strict --scripts-are-modules $(sources_py)
black --check $(sources_py)
isort --check $(sources_py)
+ r=0; find $$(git ls-files -- $(foreach f,$(generate/files),:!$f) :!cmd/*/static/*) -maxdepth 0 -type f | while read -r filename; do \
+ grep -q 'Copyright (C) 2024 Luke T. Shumaker' $$filename || \
+ { echo "$$filename is missing a copyright statement"; r=1; continue; }; \
+ dscname=$$(sed -n '1,3{ /^#!/d; /^<!--$$/d; /-\*- .* -\*-/d; s,[/*# ]*,,; s/ - .*//;p; q; }' $$filename); \
+ filename_alt1=$$(echo "$$filename" | sed \
+ -e 's,^cmd/,,' \
+ -e 's,.*/include/,,' \
+ -e 's,^lib9p/idl/,,' \
+ -e 's/\.wip$$//'); \
+ filename_alt2=$$(echo "$$filename_alt1" | sed \
+ -e 's,^sbc_harness/,,' \
+ -e 's,^srv9p/,,'); \
+ [ "$$dscname" == "$$filename" ] || [ "$$dscname" == "$$filename_alt1" ] || [ "$$dscname" == "$$filename_alt2" ] || \
+ { echo "$$filename self-identifies as $$dscname"; r=1; continue; }; \
+ done; exit $$r
format:
black $(sources_py)
isort $(sources_py)