+.PHONY: check-dirs
+check-dirs: $(BUILT_SOURCES)
+ @set -e; \
+ find . -type d \( \( -name . \) -o \( \
+ -name .git -o \
+ -name autom4te.cache \
+ \) -prune -o -print \) | { \
+ error=; \
+ while read dir; do \
+ case "$$dir" in \
+ $(strip $(patsubst %,(./%) ;;,$(DIRCHECK_EXCLUDE) $(DIRS))) \
+ *) error=1; echo "Directory $$dir not listed in Makefile" >&2 ;; \
+ esac; \
+ done; \
+ for dir in $(DIRS); do \
+ if ! test -d "$$dir"; then \
+ echo "Directory $$dir listed in DIRS does not exist" >&2; \
+ error=1; \
+ fi \
+ done; \
+ if test -n "$$error"; then exit 1; else exit 0; fi; \
+ }
+
+check-local: check-dirs