summaryrefslogtreecommitdiff
path: root/examples/rules.mk
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2021-01-23 23:28:35 +0700
committerGitHub <[email protected]>2021-01-23 23:28:35 +0700
commit469ca2f1559800f4b1eabc860336ff33ed118718 (patch)
treea6b68799030fd5cdc41881ebdbd259a8ee97b1e6 /examples/rules.mk
parentedd91d28f5afa175d7f52ec1bf1845ff29aabab9 (diff)
parente6ce18b01990d5e06f12e0aeb57d53ce365ba7b7 (diff)
Merge pull request #600 from hathach/refactor-bsp
Refactor bsp
Diffstat (limited to 'examples/rules.mk')
-rw-r--r--examples/rules.mk28
1 files changed, 20 insertions, 8 deletions
diff --git a/examples/rules.mk b/examples/rules.mk
index fb1fe76c2..ab0373bac 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) -DBOARD=$(BOARD) -DPICO_BUILD_DOCS=0
+ $(MAKE) -C $(BUILD)
+
+clean:
+ $(RM) -rf $(BUILD)
else
# GNU Make build system