blob: 7ab4c4fda86bf144a80740fed5f5a39180931c9b [file] [log] [blame]
Joey Armstronga5278142023-06-28 16:56:54 -04001# -*- makefile -*-
2# -----------------------------------------------------------------------
3# Intent:
4# o Construct a find command able to gather python files with filtering.
5# o Used by library makefiles flake8.mk and pylint.mk for iteration.
6# -----------------------------------------------------------------------
7
8## -----------------------------------------------------------------------
9## Intent: Construct a string for invoking find \( excl-pattern \) -prune
10# -----------------------------------------------------------------------
11gen-python-find-excl = \
12 $(strip \
13 -name '__ignored__' \
14 $(foreach dir,$($(1)),-o -name $(dir)) \
15 )
16
17## -----------------------------------------------------------------------
18## Intent: Construct a find command to gather a list of python files
19## with exclusions.
20## -----------------------------------------------------------------------
21## Usage:
22# $(activate) & $(call gen-python-find-cmd) | $(args-n1) pylint
23## -----------------------------------------------------------------------
24gen-python-find-cmd = \
25 $(strip \
26 find . \
27 \( $(call gen-python-find-excl,onf-excl-dirs) \) -prune \
28 -o -name '*.py' \
29 -print0 \
30 )
31
32# [EOF]