build dir fixes, report create_zip errors in a useful way

This commit is contained in:
Gordon Williams 2022-02-22 11:27:58 +00:00
parent 48875120c8
commit a1e952399b
4 changed files with 22 additions and 12 deletions

View File

@ -15,11 +15,11 @@ $(PROJ_NAME).bin: $(OBJS)
$(ESP_ZIP): $(PROJ_NAME).bin
$(Q)rm -rf build/$(basename $(ESP_ZIP))
$(Q)mkdir -p build/$(basename $(ESP_ZIP))
$(Q)cp $(PROJ_NAME).bin espruino_esp32.bin
$(Q)cp $(PROJ_NAME).bin $(BINDIR)/espruino_esp32.bin
@echo "** $(PROJ_NAME).bin uses $$( stat $(STAT_FLAGS) $(PROJ_NAME).bin) bytes of" $(ESP32_FLASH_MAX) "available"
@if [ $$( stat $(STAT_FLAGS) $(PROJ_NAME).bin) -gt $$(( $(ESP32_FLASH_MAX) )) ]; then echo "$(PROJ_NAME).bin is too big!"; false; fi
$(Q)cp $(ESP_APP_TEMPLATE_PATH)/build/bootloader/bootloader.bin \
espruino_esp32.bin \
$(BINDIR)/espruino_esp32.bin \
$(ESP_APP_TEMPLATE_PATH)/build/partitions_espruino.bin \
targets/esp32/README_flash.txt \
build/$(basename $(ESP_ZIP))

View File

@ -14,11 +14,11 @@
# user setting area that sits between the two 256KB partitions, so we can merrily use it for
# code.
ESP_ZIP = $(PROJ_NAME).tgz
USER1_BIN = espruino_esp8266_user1.bin
USER2_BIN = espruino_esp8266_user2.bin
USER1_ELF = espruino_esp8266_user1.elf
USER2_ELF = espruino_esp8266_user2.elf
PARTIAL = espruino_esp8266_partial.o
USER1_BIN = $(OBJDIR)/espruino_esp8266_user1.bin
USER2_BIN = $(OBJDIR)/espruino_esp8266_user2.bin
USER1_ELF = $(OBJDIR)/espruino_esp8266_user1.elf
USER2_ELF = $(OBJDIR)/espruino_esp8266_user2.elf
PARTIAL = $(OBJDIR)/espruino_esp8266_partial.o
ifdef FLASH_4MB
ESP_FLASH_ADDONS = $(ET_DEFAULTS) $(INIT_DATA) $(ET_BLANK) $(BLANK)

View File

@ -67,6 +67,7 @@ ESP8266_BOARD
ESP8266_4MB
ESP32
MICROBIT1
EOF
THREADS=16

View File

@ -31,11 +31,19 @@ if [ "$#" -ne 1 ]; then
fi
BOARDNAME=$1
if [ -z "$BOARDNAME" ]; then
echo "EMPTY BOARDNAME SUPPLIED"
exit
fi
VERSION=`sed -ne "s/^.*JS_VERSION.*\"\(.*\)\"/\1/p" src/jsutils.h | head -1`
echo "VERSION $VERSION"
DIR=`pwd`
ZIPDIR=$DIR/zipcontents
LOGFILE=$ZIPDIR/${BOARDNAME}.error
# We assume all setup has been done by create_zip
OBJDIR=obj_$BOARDNAME
rm -rf $OBJDIR
@ -115,14 +123,14 @@ echo "EXTRADEFS $EXTRADEFS"
echo
rm -f $BINARY_NAME
if [ "$BOARDNAME" == "ESPRUINOBOARD" ]; then
bash -c "$EXTRADEFS scripts/create_espruino_image_1v3.sh" || { echo "Build of '$EXTRADEFS BOARD=$BOARDNAME make' failed" ; exit 255; }
bash -c "$EXTRADEFS scripts/create_espruino_image_1v3.sh > $LOGFILE 2>&1" || { echo "Build of '$EXTRADEFS BOARD=$BOARDNAME make' failed" ; exit 255; }
elif [ "$BOARDNAME" == "PICO_R1_3" ]; then
bash -c "$EXTRADEFS scripts/create_pico_image_1v3.sh" || { echo "Build of '$EXTRADEFS BOARD=$BOARDNAME make' failed" ; exit 255; }
bash -c "$EXTRADEFS scripts/create_pico_image_1v3.sh > $LOGFILE 2>&1" || { echo "Build of '$EXTRADEFS BOARD=$BOARDNAME make' failed" ; exit 255; }
elif [ "$BOARDNAME" == "ESPRUINOWIFI" ]; then
bash -c "$EXTRADEFS scripts/create_espruinowifi_image.sh" || { echo "Build of '$EXTRADEFS BOARD=$BOARDNAME make' failed" ; exit 255; }
bash -c "$EXTRADEFS scripts/create_espruinowifi_image.sh > $LOGFILE 2>&1" || { echo "Build of '$EXTRADEFS BOARD=$BOARDNAME make' failed" ; exit 255; }
else
bash -c "$EXTRADEFS RELEASE=1 BOARD=$BOARDNAME make clean"
bash -c "$EXTRADEFS RELEASE=1 BOARD=$BOARDNAME make" || { echo "Build of '$EXTRADEFS BOARD=$BOARDNAME make' failed" ; exit 255; }
bash -c "$EXTRADEFS RELEASE=1 BOARD=$BOARDNAME make clean > $LOGFILE 2>&1"
bash -c "$EXTRADEFS RELEASE=1 BOARD=$BOARDNAME make > $LOGFILE 2>&1" || { echo "Build of '$EXTRADEFS BOARD=$BOARDNAME make' failed" ; exit 255; }
fi
# rename binary if needed
if [ -n "$EXTRANAME" ]; then
@ -153,4 +161,5 @@ if [ -n "$ESP_BINARY2_NAME" ]; then
cp bin/${ESP_BINARY2_NAME} $ZIPDIR || { echo "Build of 'BOARD=$BOARDNAME make' failed" ; exit 255; }
fi
rm $LOGFILE