2011-05-11 23:40:47 +04:00
# simple logging switch inspired by netch@'s advice:
# you can add plain $(LOG) to a rule recipe line to moderate it
# (logfile is automatically truncated during profile/init)
2011-10-06 12:46:31 +04:00
i f n d e f M K I M A G E _ P R O F I L E S
$( error this makefile is designed to be included in toplevel one )
e n d i f
2012-04-03 17:26:25 +04:00
# 1.3.22 fixes http://bugzilla.altlinux.org/26217
HSH_VER_OPTIMAL = 1.3.22
HSH_VERSION := $( shell hsh -V | sed -n 's/^.* version \([0-9.]\+\).*$$/\1/p' )
2012-11-29 15:52:43 +04:00
i f e q ( - , $( shell rpmvercmp $ ( HSH_VERSION ) $ ( HSH_VER_OPTIMAL ) | tr -d '[0-9]') )
2012-04-03 17:26:25 +04:00
$(info warning : hasher -$( HSH_VERSION ) is suboptimal , consider upgrading )
e n d i f
2012-04-18 23:22:29 +04:00
BUILDLOG ?= $( BUILDDIR) /$( BUILD_LOG)
2011-05-11 23:40:47 +04:00
2011-12-30 14:46:58 +04:00
# LOG holds a redirecting postprocessor
2011-05-11 23:40:47 +04:00
i f d e f D E B U G
2011-08-16 00:30:20 +04:00
# 1) makefile target; 2) also passed to script hooks
GLOBAL_DEBUG := debug
2011-05-11 23:40:47 +04:00
GLOBAL_VERBOSE ?= $( DEBUG)
i f e q ( 2 , $( DEBUG ) )
SHELL += -x
e n d i f
LOG = >>$( BUILDLOG) 2>& 1
e l s e
MAKE += -s
LOG = 2>>$( BUILDLOG) >/dev/null
e n d i f
2021-06-22 17:19:03 +03:00
i f e q ( , $( filter -out $ ( DIRECT_TARGETS ) ,$ ( MAKECMDGOALS ) ) )
LOG = >/dev/null 2>& 1
e n d i f
2011-11-04 15:26:31 +04:00
# in build.mk, naive TIME gets expanded a bit too early (no need to export btw)
2011-07-15 01:00:46 +04:00
DATE = $( shell date +%Y%m%d)
2011-11-04 15:26:31 +04:00
TIME = ` date +%H:%M:%S`
2011-07-15 01:00:46 +04:00
2011-11-04 18:51:11 +04:00
export BUILDLOG DATE GLOBAL_DEBUG GLOBAL_VERBOSE LOG MAKE SHELL