summaryrefslogtreecommitdiff
path: root/global.mk
diff options
context:
space:
mode:
authorJasmin Jessich <jasmin@anw.at>2017-05-25 20:21:13 (GMT)
committerJasmin Jessich <jasmin@anw.at>2017-05-25 20:30:31 (GMT)
commit260f2cf0cb7b724c9ca3f662529e7b6bbb9cbbb6 (patch)
tree5b5775965847c369148065e7456a3a58c1d60a02 /global.mk
parent3e0774c0968dc38178cadb41558302c8a888b875 (diff)
downloadvdr-plugin-live-260f2cf0cb7b724c9ca3f662529e7b6bbb9cbbb6.tar.gz
vdr-plugin-live-260f2cf0cb7b724c9ca3f662529e7b6bbb9cbbb6.tar.bz2
Improve Makefile printing
- Added global.mk with common makefile print macros. Use VERBOSE=1 on the command line to show executed commands. - Removed recursion printing of make. - Suppress “nothing to be done for 'all'” message from make. - gen_version_suffix.h is now always created.
Diffstat (limited to 'global.mk')
-rw-r--r--global.mk38
1 files changed, 38 insertions, 0 deletions
diff --git a/global.mk b/global.mk
new file mode 100644
index 0000000..1c74f37
--- /dev/null
+++ b/global.mk
@@ -0,0 +1,38 @@
+#
+# Add macros and definitions which shall be available for all Makefiles
+# This might be added to VDR main directory in the future
+
+# build mode (0 - non-verbose, 1 - verbose)
+VERBOSE ?= 0
+
+# Desplay percentage (0 - no percentage, 1 - print xxx% (not 100% accurate!))
+#WITH_PERCENT ?= 0
+# does not work currently
+override WITH_PERCENT := 0
+
+# pretty print macros
+
+ifeq ($(WITH_PERCENT),1)
+ ifndef ECHO
+ I := i
+ TARGET_COUNTER = $(words $(I)) $(eval I += i)
+ TOTAL_TARGETS := $(shell $(MAKE) $(MAKECMDGOALS) --dry-run --file=$(firstword $(MAKEFILE_LIST)) \
+ --no-print-directory --no-builtin-rules --no-builtin-variables ECHO="COUNTTHIS" | grep -c "COUNTTHIS")
+ ECHO = echo "[$(shell expr " $(shell echo $$((${TARGET_COUNTER} * 100 / ${TOTAL_TARGETS})))" : '.*\(...\)$$')%]"
+ endif
+else
+ ECHO = echo
+endif
+
+ifeq ($(VERBOSE),0)
+ # Have a look to the VDR Makefile hw to use these macros in Plugins.
+
+ Q = @
+ PRETTY_PRINT = @$(ECHO) $(1)
+ AR_NUL = > /dev/null 2>&1
+else
+ Q =
+ PRETTY_PRINT =
+ AR_NUL =
+endif
+