Joey Armstrong | 825114e | 2023-09-08 15:18:51 -0400 | [diff] [blame] | 1 | # -*- 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 | # ----------------------------------------------------------------------- |
| 11 | gen-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 | ## ----------------------------------------------------------------------- |
| 24 | gen-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] |