mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
build examples: Only build verbose on failure, save on log output
This commit is contained in:
parent
c15024e629
commit
c04f05ee84
@ -15,16 +15,15 @@ RESULT=0
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
for example in ${IDF_PATH}/examples/*; do
|
for example in ${IDF_PATH}/examples/*; do
|
||||||
[ -f ${example}/Makefile ] || continue
|
[ -f ${example}/Makefile ] || continue
|
||||||
echo "Building ${example} as ${EXAMPLE_NUM}..."
|
echo "Building ${example} as ${EXAMPLE_NUM}..."
|
||||||
mkdir ${EXAMPLE_NUM}
|
mkdir ${EXAMPLE_NUM}
|
||||||
cp -r ${example} ${EXAMPLE_NUM}
|
cp -r ${example} ${EXAMPLE_NUM}
|
||||||
pushd ${EXAMPLE_NUM}/`basename ${example}`
|
pushd ${EXAMPLE_NUM}/`basename ${example}`
|
||||||
# can't do "make defconfig all" as this will trip menuconfig
|
# build non-verbose first, only build verbose if there's an error
|
||||||
# sometimes
|
make defconfig all || (RESULT=$?; make V=1)
|
||||||
make defconfig V=1 && make V=1 || RESULT=$?
|
popd
|
||||||
popd
|
EXAMPLE_NUM=$(( $EXAMPLE_NUM + 1 ))
|
||||||
EXAMPLE_NUM=$(( $EXAMPLE_NUM + 1 ))
|
|
||||||
done
|
done
|
||||||
|
|
||||||
exit $RESULT
|
exit $RESULT
|
||||||
|
@ -41,8 +41,9 @@ COMPONENT_LIBRARY = lib$(COMPONENT_NAME).a
|
|||||||
# Source dirs a component has. Default to root directory of component.
|
# Source dirs a component has. Default to root directory of component.
|
||||||
COMPONENT_SRCDIRS = .
|
COMPONENT_SRCDIRS = .
|
||||||
|
|
||||||
#Names of binary files to embed as symbols in the component library
|
#Names of binary & text files to embed as raw content in the component library
|
||||||
COMPONENT_EMBED_FILES ?=
|
COMPONENT_EMBED_FILES ?=
|
||||||
|
COMPONENT_EMBED_TXTFILES ?=
|
||||||
|
|
||||||
# By default, include only the include/ dir.
|
# By default, include only the include/ dir.
|
||||||
COMPONENT_ADD_INCLUDEDIRS = include
|
COMPONENT_ADD_INCLUDEDIRS = include
|
||||||
@ -72,6 +73,11 @@ COMPONENT_OBJS += $(foreach compsrcdir,$(COMPONENT_SRCDIRS),$(patsubst %.S,%.o,$
|
|||||||
COMPONENT_OBJS := $(patsubst $(COMPONENT_PATH)/%,%,$(COMPONENT_OBJS))
|
COMPONENT_OBJS := $(patsubst $(COMPONENT_PATH)/%,%,$(COMPONENT_OBJS))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Object files with embedded binaries to add to the component library
|
||||||
|
# Correspond to the files named in COMPONENT_EMBED_FILES & COMPONENT_EMBED_TXTFILES
|
||||||
|
COMPONENT_EMBED_OBJS ?= $(addsuffix .bin.o,$(COMPONENT_EMBED_FILES)) $(addsuffix .txt.o,$(COMPONENT_EMBED_TXTFILES))
|
||||||
|
|
||||||
|
|
||||||
# If we're called to compile something, we'll get passed the COMPONENT_INCLUDES
|
# If we're called to compile something, we'll get passed the COMPONENT_INCLUDES
|
||||||
# variable with all the include dirs from all the components in random order. This
|
# variable with all the include dirs from all the components in random order. This
|
||||||
# means we can accidentally grab a header from another component before grabbing our own.
|
# means we can accidentally grab a header from another component before grabbing our own.
|
||||||
@ -133,7 +139,7 @@ build: $(COMPONENT_LIBRARY)
|
|||||||
$(COMPONENT_LIBRARY): $(COMPONENT_OBJS) $(COMPONENT_EMBED_OBJS)
|
$(COMPONENT_LIBRARY): $(COMPONENT_OBJS) $(COMPONENT_EMBED_OBJS)
|
||||||
$(summary) AR $@
|
$(summary) AR $@
|
||||||
rm -f $@
|
rm -f $@
|
||||||
$(AR) cru $@ $(COMPONENT_OBJS)
|
$(AR) cru $@ $^
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# If COMPONENT_OWNCLEANTARGET is not set, define a phony clean target
|
# If COMPONENT_OWNCLEANTARGET is not set, define a phony clean target
|
||||||
@ -187,11 +193,11 @@ OBJCOPY_EMBED_ARGS := --input binary --output elf32-xtensa-le --binary-architect
|
|||||||
# path to the input file.
|
# path to the input file.
|
||||||
define GenerateEmbedTarget
|
define GenerateEmbedTarget
|
||||||
$(1).$(2).o: $(call resolvepath,$(1),$(COMPONENT_PATH)) | $$(dir $(1))
|
$(1).$(2).o: $(call resolvepath,$(1),$(COMPONENT_PATH)) | $$(dir $(1))
|
||||||
$$(summary) EMBED $$@
|
$(summary) EMBED $$@
|
||||||
$$(Q) $(if $(filter-out $$(notdir $$(abspath $$<)),$$(abspath $$(notdir $$<))), cp $$< $$(notdir $$<) ) # copy input file to build dir, unless already in build dir
|
$$(if $$(filter-out $$(notdir $$(abspath $$<)),$$(abspath $$(notdir $$<))), cp $$< $$(notdir $$<) ) # copy input file to build dir, unless already in build dir
|
||||||
$$(Q) $(if $(subst bin,,$(2)),echo -ne '\0' >> $$(notdir $$<) ) # trailing NUL byte on text output
|
$$(if $$(subst bin,,$(2)),echo -ne '\0' >> $$(notdir $$<) ) # trailing NUL byte on text output
|
||||||
$$(Q) $$(OBJCOPY) $(OBJCOPY_EMBED_ARGS) $$(notdir $$<) $$@
|
$(OBJCOPY) $(OBJCOPY_EMBED_ARGS) $$(notdir $$<) $$@
|
||||||
$$(Q) rm $$(notdir $$<)
|
rm $$(notdir $$<)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# generate targets to embed binary & text files
|
# generate targets to embed binary & text files
|
||||||
|
Loading…
Reference in New Issue
Block a user