forked from eerotal/LibreSignage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile.common
37 lines (34 loc) · 897 Bytes
/
makefile.common
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#
# Utility functions and targets for LibreSignage makefiles.
#
# Print a status message.
#
# $(1) = The program doing the work. (cp, rm, etc.)
# $(2) = The source file.
# $(3) = The destination file.
VERBOSE ?= Y
status = \
if [ "`printf '$(VERBOSE)'|cut -c1|sed 's/\n//g'|\
tr '[:upper:]' '[:lower:]'`" = "y" ]; then \
printf "$(1): $(2) >> $(3)\n"|tr -s ' '|sed 's/^ *$///g'; \
fi
# Recursively create the directory path for a file.
#
# $(1) = The filepath to use.
makedir = mkdir -p $(dir $(1))
# Print the initialization check info/warning.
#
# $(1) = The status code of the initialization checks.
INITCHK_WARN ?= N
initchk_warn =\
if [ ! "$(1)" = "0" ]; then\
case "$(INITCHK_WARN)" in \
[nN]*)\
echo "[Info] To continue anyway, pass INITCHK_WARN=Y to make.";\
exit 1;\
;;\
*)\
echo "[Warning] Continuing anyway. You're on your own.";\
;;\
esac;\
fi