diff options
| author | hathach <[email protected]> | 2021-01-22 14:58:32 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2021-01-22 14:58:32 +0700 |
| commit | b6e9c42b0217124aaf47e1d65e4eac39c3d3d681 (patch) | |
| tree | 4dec4c9c6500f2b315a024076018a056d9756cc4 /examples/rules.mk | |
| parent | 67a9cdc35baf3767bd24c78c68e0b969d2d7c191 (diff) | |
update cmake build to work with esp32s2 and rp2040
Diffstat (limited to 'examples/rules.mk')
| -rw-r--r-- | examples/rules.mk | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/examples/rules.mk b/examples/rules.mk index fb1fe76c2..b61af1d55 100644 --- a/examples/rules.mk +++ b/examples/rules.mk @@ -2,34 +2,46 @@ # Common make rules for all examples # --------------------------------------- -ifeq ($(CROSS_COMPILE),xtensa-esp32s2-elf-) +ifeq ($(FAMILY),esp32s2) # 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 + idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) build build: all clean: - idf.py -B$(BUILD) -DBOARD=$(BOARD) clean + idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) clean + +fullclean: + idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) fullclean flash: - idf.py -B$(BUILD) -DBOARD=$(BOARD) flash + idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) flash bootloader-flash: - idf.py -B$(BUILD) -DBOARD=$(BOARD) bootloader-flash + idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) bootloader-flash app-flash: - idf.py -B$(BUILD) -DBOARD=$(BOARD) app-flash + idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) app-flash erase: - idf.py -B$(BUILD) -DBOARD=$(BOARD) erase_flash + idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) erase_flash monitor: - idf.py -B$(BUILD) -DBOARD=$(BOARD) monitor + idf.py -B$(BUILD) -DFAMILY=$(FAMILY) -DBOARD=$(BOARD) monitor + +else ifeq ($(FAMILY),rp2040) + +all: + [ -d $(BUILD) ] || cmake -S . -B $(BUILD) -DFAMILY=$(FAMILY) -DPICO_BUILD_DOCS=0 + $(MAKE) -C $(BUILD) + +clean: + $(RM) -rf $(BUILD) else # GNU Make build system |
