diff options
-rw-r--r-- | GNUmakefile | 19 | ||||
-rwxr-xr-x | build-aux/lint-generic | 5 | ||||
-rwxr-xr-x | build-aux/lint-unknown | 5 |
3 files changed, 13 insertions, 16 deletions
diff --git a/GNUmakefile b/GNUmakefile index e5e59b2..9836b33 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -57,12 +57,19 @@ generate/files += build-aux/sources.mk ifeq ($(INNER),) nonsource/files = $(generate/files) nonsource/files += 3rd-party/COPYING.wiznet-dhcp.txt +# 100644 blob/regular file +# 100755 blob/executable file +# 120000 blob/symlink +# 160000 commit (submodule) +# 040000 tree (directory) build-aux/sources.mk: $(if $(wildcard .git),FORCE) - git ls-files | grep -vFx $(foreach f,$(nonsource/files),-e $f) \ - | sed 's,^,$(CURDIR)/,' | xargs editorconfig \ - | sed -nE -e 's,\[$(CURDIR)/(.*)\],\1,p' -e 's/^_mode=//p' \ - | sed -E '{N;s/(.*)\n(.*)/sources_\2 += \1/;}' \ - | sort \ + git ls-files --format='%(objectmode) %(path)' \ + | sed -n 's/^100... //p' \ + | grep -vFx $(foreach f,$(nonsource/files),-e $f) \ + | sed 's,^,$(CURDIR)/,' | xargs editorconfig \ + | sed -nE -e 's,\[$(CURDIR)/(.*)\],\1,p' -e 's/^_mode=//p' \ + | sed -E '{N;s/(.*)\n(.*)/sources_\2 += \1/;}' \ + | sort \ >$@.tmp if ! cmp -s $@.tmp $@; then mv $@.tmp $@; fi @echo '################################################################################' @@ -117,7 +124,7 @@ lint: lint/bin: build build-aux/lint-bin ./build-aux/lint-bin $(foreach t,$(build_types),build/rp2040-$t/cmd/sbc_harness/sbc_harness.elf) lint/all: lint/%: build-aux/lint-generic build-aux/get-dscname - ./build-aux/lint-generic '%s\n' $(sources_$*) + ./build-aux/lint-generic $(sources_$*) lint/unknown: lint/%: build-aux/lint-unknown ./build-aux/lint-unknown $(sources_$*) .PHONY: lint lint/% diff --git a/build-aux/lint-generic b/build-aux/lint-generic index 70e814a..d982527 100755 --- a/build-aux/lint-generic +++ b/build-aux/lint-generic @@ -14,11 +14,6 @@ err() { r=0 for filename in "$@"; do - if ! { [ -f "$filename" ] && ! [ -h "$filename" ]; }; then - # Ignore non-files - continue - fi - # File header ########################################################## shebang="$(sed -n '1{/^#!/{/^#!\/hint\//q; p;};}' "$filename")" diff --git a/build-aux/lint-unknown b/build-aux/lint-unknown index dda9541..bc23a81 100755 --- a/build-aux/lint-unknown +++ b/build-aux/lint-unknown @@ -14,11 +14,6 @@ err() { r=0 for filename in "$@"; do - if ! { [ -f "$filename" ] && ! [ -h "$filename" ]; }; then - # Ignore non-files - continue - fi - err "$filename" 'cannot lint unknown file type' done exit $r |