Update with more iOS details.
[pwl6.git] / rules / programs.mk
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.
4
5 ZIPFLAGS ?= -q
6 UNZIPFLAGS ?= -q
7
8 UNZIP = unzip $(UNZIPFLAGS)
9 ZIP = zip $(ZIPFLAGS)
10
11 ifneq ($(OS),Windows_NT)
12 WINE ?= wine
13 endif
14
15 find-files = $(shell find $1 -type f $2 -print $3)
16
17 rmdir-r = [ ! -e $1 ] || find -d $1 -type d -delete
18
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
26 # installed.
27 command-v = $(firstword $(shell command -v $1) $2 $1)
28
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
31 # silenced itself.
32 MKDIR = @$(SHELL) -c '[ -d "$$0" ] || echo mkdir -p "$$0" && mkdir -p "$$0"'