1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

makefile: add additional context to output when building all_* targets

When building the various all_* targets, it was hard to tell which
board/build-type that each line of output applied to.  Now, the
all_* target types will include something like:
 CC        [fw|cc  ]  flight/PiOS/STM32F10x/pios_gpio.c
which includes the necessary additional context.

This will help with identifying the context for warnings and errors
when building a group of targets.
This commit is contained in:
Stacey Sheldon 2012-06-02 20:31:57 -04:00
parent c5b1522f6a
commit e3393bb255
3 changed files with 43 additions and 27 deletions

View File

@ -626,6 +626,13 @@ ef_$(1)_clean:
$(V1) $(RM) -fr $(BUILD_DIR)/ef_$(1)
endef
# When building any of the "all_*" targets, tell all sub makefiles to display
# additional details on each line of output to describe which build and target
# that each line applies to.
ifneq ($(strip $(filter all_%,$(MAKECMDGOALS))),)
export ENABLE_MSG_EXTRA := yes
endif
# $(1) = Canonical board name all in lower case (e.g. coptercontrol)
define BOARD_PHONY_TEMPLATE
.PHONY: all_$(1)

View File

@ -35,13 +35,13 @@ bin: $(OUTDIR)/$(TARGET).bin
FW_PAD = $(shell echo $$[$(FW_BANK_BASE)-$(BL_BANK_BASE)-$(BL_BANK_SIZE)])
$(OUTDIR)/$(TARGET).pad:
$(V0) @echo " PADDING $@"
$(V0) @echo $(MSG_PADDING) $@
$(V1) dd status=noxfer if=/dev/zero count=$(FW_PAD) bs=1 2>/dev/null | tr '\000' '\377' > $@
BL_BIN = $(TOP)/build/bl_$(BOARD_NAME)/bl_$(BOARD_NAME).bin
FW_BIN = $(TOP)/build/fw_$(BOARD_NAME)/fw_$(BOARD_NAME).bin
$(OUTDIR)/$(TARGET).bin: $(BL_BIN) $(FW_BIN) $(OUTDIR)/$(TARGET).pad
$(V0) @echo " FLASH IMG $@"
$(V0) @echo $(MSG_FLASH_IMG) $@
$(V1) cat $(BL_BIN) $(OUTDIR)/$(TARGET).pad $(FW_BIN) > $@
.PHONY: dfu

View File

@ -23,32 +23,41 @@ else
quote =
endif
# Add a board designator to the terse message text
ifeq ($(ENABLE_MSG_EXTRA),yes)
MSG_EXTRA := [$(BUILD_TYPE)|$(BOARD_SHORT_NAME)]
else
MSG_BOARD :=
endif
# Define Messages
# English
MSG_FORMATERROR := ${quote} Can not handle output-format${quote}
MSG_MODINIT := ${quote} MODINIT ${quote}
MSG_SIZE := ${quote} SIZE ${quote}
MSG_LOAD_FILE := ${quote} BIN/HEX ${quote}
MSG_BIN_OBJ := ${quote} BINO ${quote}
MSG_STRIP_FILE := ${quote} STRIP ${quote}
MSG_EXTENDED_LISTING := ${quote} LIS ${quote}
MSG_SYMBOL_TABLE := ${quote} NM ${quote}
MSG_LINKING := ${quote} LD ${quote}
MSG_COMPILING := ${quote} CC ${quote}
MSG_COMPILING_ARM := ${quote} CC-ARM ${quote}
MSG_COMPILINGCPP := ${quote} CXX ${quote}
MSG_COMPILINGCPP_ARM := ${quote} CXX-ARM ${quote}
MSG_ASSEMBLING := ${quote} AS ${quote}
MSG_ASSEMBLING_ARM := ${quote} AS-ARM ${quote}
MSG_CLEANING := ${quote} CLEAN ${quote}
MSG_ASMFROMC := ${quote} AS(C) ${quote}
MSG_ASMFROMC_ARM := ${quote} AS(C)-ARM ${quote}
MSG_PYMITEINIT := ${quote} PY ${quote}
MSG_INSTALLING := ${quote} INSTALL ${quote}
MSG_OPFIRMWARE := ${quote} OPFW ${quote}
MSG_FWINFO := ${quote} FWINFO ${quote}
MSG_JTAG_PROGRAM := ${quote} JTAG-PGM ${quote}
MSG_JTAG_WIPE := ${quote} JTAG-WIPE ${quote}
MSG_FORMATERROR = ${quote} Can not handle output-format${quote}
MSG_MODINIT = ${quote} MODINIT $(MSG_EXTRA) ${quote}
MSG_SIZE = ${quote} SIZE $(MSG_EXTRA) ${quote}
MSG_LOAD_FILE = ${quote} BIN/HEX $(MSG_EXTRA) ${quote}
MSG_BIN_OBJ = ${quote} BINO $(MSG_EXTRA) ${quote}
MSG_STRIP_FILE = ${quote} STRIP $(MSG_EXTRA) ${quote}
MSG_EXTENDED_LISTING = ${quote} LIS $(MSG_EXTRA) ${quote}
MSG_SYMBOL_TABLE = ${quote} NM $(MSG_EXTRA) ${quote}
MSG_LINKING = ${quote} LD $(MSG_EXTRA) ${quote}
MSG_COMPILING = ${quote} CC ${MSG_EXTRA} ${quote}
MSG_COMPILING_ARM = ${quote} CC-ARM $(MSG_EXTRA) ${quote}
MSG_COMPILINGCPP = ${quote} CXX $(MSG_EXTRA) ${quote}
MSG_COMPILINGCPP_ARM = ${quote} CXX-ARM $(MSG_EXTRA) ${quote}
MSG_ASSEMBLING = ${quote} AS $(MSG_EXTRA) ${quote}
MSG_ASSEMBLING_ARM = ${quote} AS-ARM $(MSG_EXTRA) ${quote}
MSG_CLEANING = ${quote} CLEAN $(MSG_EXTRA) ${quote}
MSG_ASMFROMC = ${quote} AS(C) $(MSG_EXTRA) ${quote}
MSG_ASMFROMC_ARM = ${quote} AS(C)-ARM $(MSG_EXTRA) ${quote}
MSG_PYMITEINIT = ${quote} PY $(MSG_EXTRA) ${quote}
MSG_INSTALLING = ${quote} INSTALL $(MSG_EXTRA) ${quote}
MSG_OPFIRMWARE = ${quote} OPFW $(MSG_EXTRA) ${quote}
MSG_FWINFO = ${quote} FWINFO $(MSG_EXTRA) ${quote}
MSG_JTAG_PROGRAM = ${quote} JTAG-PGM $(MSG_EXTRA) ${quote}
MSG_JTAG_WIPE = ${quote} JTAG-WIPE $(MSG_EXTRA) ${quote}
MSG_PADDING = ${quote} PADDING $(MSG_EXTRA) ${quote}
MSG_FLASH_IMG = ${quote} FLASH_IMG $(MSG_EXTRA) ${quote}
toprel = $(subst $(realpath $(TOP))/,,$(abspath $(1)))