make: 'make all' default target builds everything, 'make flash' flashes everything

Also added 'make help' target which prints some useful usage summary.
This commit is contained in:
Angus Gratton
2016-08-18 17:11:27 +08:00
parent 73001bcda2
commit 14eb490bb3
7 changed files with 78 additions and 47 deletions

View File

@@ -10,7 +10,6 @@
#
BOOTLOADER_COMPONENT_PATH := $(COMPONENT_PATH)
EXTRA_CLEAN_TARGETS += bootloader-clean
BOOTLOADER_BUILD_DIR=$(BUILD_DIR_BASE)/bootloader
BOOTLOADER_BIN=$(BOOTLOADER_BUILD_DIR)/bootloader.bin
@@ -23,7 +22,7 @@ $(BOOTLOADER_BIN): $(COMPONENT_PATH)/src/sdkconfig
LDFLAGS= \
CFLAGS= \
BUILD_DIR_BASE=$(BOOTLOADER_BUILD_DIR) \
make -C $(BOOTLOADER_COMPONENT_PATH)/src MAKEFLAGS= V=$(V) TARGET_BIN_LAYOUT="$(BOOTLOADER_TARGET_BIN_LAYOUT)"
make -C $(BOOTLOADER_COMPONENT_PATH)/src MAKEFLAGS= V=$(V) TARGET_BIN_LAYOUT="$(BOOTLOADER_TARGET_BIN_LAYOUT)" $(BOOTLOADER_BIN)
bootloader-clean:
$(Q) PROJECT_PATH= \
@@ -34,10 +33,16 @@ bootloader-clean:
BUILD_DIR_BASE=$(BOOTLOADER_BUILD_DIR) \
make -C $(BOOTLOADER_COMPONENT_PATH)/src clean MAKEFLAGS= V=$(V)
clean: bootloader-clean
bootloader: $(BOOTLOADER_BIN)
@echo "Bootloader built. Default flash command is:"
@echo "$(ESPTOOLPY_SERIAL) write_flash 0x1000 $(BOOTLOADER_BIN)"
all_binaries: $(BOOTLOADER_BIN)
ESPTOOL_ALL_FLASH_ARGS += 0x1000 $(BOOTLOADER_BIN)
# synchronise the project level config to the component's
# config
$(COMPONENT_PATH)/src/sdkconfig: $(PROJECT_PATH)/sdkconfig

View File

@@ -10,6 +10,3 @@ COMPONENTS := esptool_py
#adding it in the main/Makefile directory.
include $(SDK_PATH)/make/project.mk
# override configured app offset, as bootloader "app" is at 0x1000
CONFIG_APP_OFFSET := 0x1000