make as wrapper to idf.py for consistency

update ci build script to only build esp32-s2 target with freertos
examples
This commit is contained in:
hathach
2020-04-03 12:08:06 +07:00
parent 2824e5c97a
commit 7c33a7127f
4 changed files with 55 additions and 53 deletions

View File

@@ -1,6 +1,25 @@
#
# Common make definition for all examples
#
# ---------------------------------------
# Common make rules for all examples
# ---------------------------------------
ifeq ($(CROSS_COMPILE),xtensa-esp32-elf-)
# Espressif IDF use CMake build system, this add wrapper target to call idf.py
.PHONY: all clean flash
.DEFAULT_GOAL := all
all:
idf.py -B$(BUILD) -DBOARD=$(BOARD) build
clean:
idf.py clean
flash:
@:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyUSB0)
idf.py -p $(SERIAL) flash
else
# GNU Make build system
# libc
LIBS += -lgcc -lm -lnosys
@@ -28,8 +47,9 @@ SRC_C += \
# TinyUSB stack include
INC += $(TOP)/src
#
CFLAGS += $(addprefix -I,$(INC))
# TODO Skip nanolib for MSP430
ifeq ($(BOARD), msp_exp430f5529lp)
LDFLAGS += $(CFLAGS) -fshort-enums -Wl,-T,$(TOP)/$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections
else
@@ -135,3 +155,5 @@ flash-jlink: $(BUILD)/$(BOARD)-firmware.hex
# flash STM32 MCU using stlink with STM32 Cube Programmer CLI
flash-stlink: $(BUILD)/$(BOARD)-firmware.elf
STM32_Programmer_CLI --connect port=swd --write $< --go
endif # Make target