1 # This is free and unencumbered software released into the public
2 # domain. To the extent possible under law, the author of this file
3 # waives all copyright and related or neighboring rights to it.
8 UNZIP
= unzip
$(UNZIPFLAGS
)
11 ifneq ($(OS
),Windows_NT
)
15 find-files
= $(shell find
$1 -type f
$2 -print $3)
17 rmdir-r
= [ ! -e
$1 ] || find
-d
$1 -type d
-delete
19 # Use to find the best command to execute out of a series of possible
20 # equivalent ones, or provide a fallback. If a second argument is
21 # supplied it is used as the fallback, otherwise the first element of
22 # the checked executables is used. e.g.
23 # PYLINTER := $(call command-v,flake8 pyflakes,python -mpy_compile)
24 # will pick flake8 if it's installed, or pyflakes if it isn't,
25 # or python -mpy_compile (a syntax check) if neither is
27 command-v
= $(firstword $(shell command
-v
$1) $2 $1)
29 # Use in place of 'mkdir -p' to avoid littering every other line of
30 # output with a redundant mkdir call; the downside is that it can't be
32 MKDIR
= @
$(SHELL
) -c
'[ -d "$$0" ] || echo mkdir -p "$$0" && mkdir -p "$$0"'