mirror of
https://github.com/ipxe/ipxe
synced 2025-12-24 06:22:59 +03:00
[debug] Allow debug message colours to be customised via DBGCOL=...
When multiple iPXE binaries are running concurrently (e.g. in the case of undionly.kpxe using an underlying iPXE driver via the UNDI interface) it would be helpful to be able to visually distinguish debug messages from each binary. Allow the range of debug colours used to be customised via the DBGCOL=... build parameter. For example: # Restrict to colours 31-33 (red, green, yellow) make DBGCOL=31-33 # Restrict to colours 34-36 (blue, magenta, cyan) make DBGCOL=34-36 Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -710,6 +710,31 @@ $(BIN)/version.o : ../.git/index
|
||||
endif
|
||||
endif
|
||||
|
||||
# Debug message autocolourisation range
|
||||
#
|
||||
DBGCOL_LIST := $(BIN)/.dbgcol.list
|
||||
ifeq ($(wildcard $(DBGCOL_LIST)),)
|
||||
DBGCOL_OLD := <invalid>
|
||||
else
|
||||
DBGCOL_OLD := $(shell cat $(DBGCOL_LIST))
|
||||
endif
|
||||
ifneq ($(DBGCOL_OLD),$(DBGCOL))
|
||||
$(shell $(ECHO) "$(DBGCOL)" > $(DBGCOL_LIST))
|
||||
endif
|
||||
|
||||
$(DBGCOL_LIST) : $(MAKEDEPS)
|
||||
|
||||
VERYCLEANUP += $(DBGCOL_LIST)
|
||||
|
||||
DBGCOL_COLOURS := $(subst -, ,$(DBGCOL))
|
||||
DBGCOL_MIN := $(word 1,$(DBGCOL_COLOURS))
|
||||
DBGCOL_MAX := $(word 2,$(DBGCOL_COLOURS))
|
||||
|
||||
debug_DEPS += $(DBGCOL_LIST)
|
||||
|
||||
CFLAGS_debug += $(if $(DBGCOL_MIN),-DDBGCOL_MIN=$(DBGCOL_MIN))
|
||||
CFLAGS_debug += $(if $(DBGCOL_MAX),-DDBGCOL_MAX=$(DBGCOL_MAX))
|
||||
|
||||
# We automatically generate rules for any file mentioned in AUTO_SRCS
|
||||
# using the following set of templates. We use $(eval ...) if
|
||||
# available, otherwise we generate separate Makefile fragments and
|
||||
|
||||
Reference in New Issue
Block a user