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' )
i f e q ( - , $( shell rpmvercmp $ ( HSH_VERSION ) $ ( HSH_VER_OPTIMAL ) | tr -d [0-9]) )
$(info warning : hasher -$( HSH_VERSION ) is suboptimal , consider upgrading )
e n d i f
2011-05-11 23:40:47 +04:00
BUILDLOG ?= $( BUILDDIR) /build.log
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
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
2011-12-30 14:46:58 +04:00
# brevity postprocessor; not exported, for toplevel use only
SHORTEN = $( shell \
echo -n "| sed" ; \
if [ -s " $( SYMLINK) " ] ; then \
echo -n " -e 's, $( BUILDDIR) , $( SYMLINK) ,' " ; \
fi ; \
echo -n " -e 's, $( TMP) ,\$ $TMP ,' -e 's, $( HOME) ,~,' " ; \
)