mkimage-profiles/log.mk
Michael Shigorin faafaf12e5 README updates
...and some more cosmetic fixes
2011-11-04 16:15:29 +02:00

27 lines
647 B
Makefile

# this makefile is designed to be included in toplevel one
ifndef BUILDDIR
$(error BUILDDIR not defined)
endif
# 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)
BUILDLOG ?= $(BUILDDIR)/build.log
# LOG holds a postprocessor
ifdef DEBUG
GLOBAL_VERBOSE ?= $(DEBUG)
ifeq (2,$(DEBUG))
SHELL += -x
endif
LOG = >>$(BUILDLOG) 2>&1
else
MAKE += -s
LOG = 2>>$(BUILDLOG) >/dev/null
# 1) makefile target; 2) also passed to script hooks
GLOBAL_DEBUG := debug
endif
export BUILDLOG DEBUG GLOBAL_DEBUG GLOBAL_VERBOSE LOG MAKE SHELL