|
26 | 26 | # Boards default to all modules enabled (with exceptions)
|
27 | 27 | # Manually disable by overriding in #mpconfigboard.mk
|
28 | 28 |
|
| 29 | +# These Makefile variables are used to implement the "any" and "all" functions. |
| 30 | +# Make's "sort" will transform a mixed sequence of 0s and 1s to "0 1" (because |
| 31 | +# it also eliminates duplicates), or a non-mixed sequence of "0" or "1" to just |
| 32 | +# itself. Thus, if all the inputs are 1 then the first word will be 1; if any |
| 33 | +# of the inputs are 1, then the last word will be 1. |
29 | 34 | enable-if-any=$(lastword $(sort $(1) 0))
|
30 | 35 | enable-if-all=$(firstword $(sort $(1) 1))
|
31 | 36 |
|
32 |
| -#$(info enable-if-any 0 1 -> $(call enable-if-any,0 1)) |
33 |
| -#$(info enable-if-any 1 0 -> $(call enable-if-any,1 0)) |
34 |
| -#$(info enable-if-any 1 1 -> $(call enable-if-any,1 1)) |
35 |
| -#$(info enable-if-any 0 0 -> $(call enable-if-any,0 0)) |
36 |
| -#$(info enable-if-all 0 1 -> $(call enable-if-all,0 1)) |
37 |
| -#$(info enable-if-all 1 0 -> $(call enable-if-all,1 0)) |
38 |
| -#$(info enable-if-all 1 1 -> $(call enable-if-all,1 1)) |
39 |
| -#$(info enable-if-all 0 0 -> $(call enable-if-all,0 0)) |
| 37 | +# To use any/all, you "$(call)" it, with the values to test after a comma. |
| 38 | +# Usually the values are other $(CIRCUITPY_foo) variables. The definition |
| 39 | +# of CIRCUITPY_AUDIOCORE and CIRCUITPY_AUDIOMP3 below are typical of how |
| 40 | +# any/all are expected to be used. |
40 | 41 |
|
41 | 42 | # Always on. Present here to help generate documentation module support matrix for "builtins".
|
42 | 43 | CIRCUITPY = 1
|
|
0 commit comments