forked from 256dpi/esp-mqtt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
57 lines (40 loc) · 2.13 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
UNAME := $(shell uname)
XTENSA_TOOLCHAIN := "xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz"
ifeq ($(UNAME), Darwin)
XTENSA_TOOLCHAIN := "xtensa-esp32-elf-osx-1.22.0-80-g6c4433a-5.2.0.tar.gz"
endif
ESP_IDF_VERSION := "v3.0.1"
fmt:
clang-format -i ./*.c ./*.h -style="{BasedOnStyle: Google, ColumnLimit: 120}"
clang-format -i ./test/main/*.c -style="{BasedOnStyle: Google, ColumnLimit: 120}"
test/xtensa-esp32-elf:
wget https://dl.espressif.com/dl/$(XTENSA_TOOLCHAIN)
cd test; tar -xzf ../$(XTENSA_TOOLCHAIN)
rm *.tar.gz
test/esp-idf:
git clone --recursive https://github.com/espressif/esp-idf.git test/esp-idf
cd test/esp-idf; git fetch; git checkout $(ESP_IDF_VERSION)
cd test/esp-idf/; git submodule update --recursive
update:
cd test/esp-idf; git fetch; git checkout $(ESP_IDF_VERSION)
cd test/esp-idf/; git submodule update --recursive
defconfig: test/xtensa-esp32-elf test/esp-idf
export PATH=$(shell pwd)/test/xtensa-esp32-elf/bin:$$PATH; cd ./test; make defconfig
menuconfig: test/xtensa-esp32-elf test/esp-idf
export PATH=$(shell pwd)/test/xtensa-esp32-elf/bin:$$PATH; cd ./test; make menuconfig
erase: test/xtensa-esp32-elf test/esp-idf
export PATH=$(shell pwd)/test/xtensa-esp32-elf/bin:$$PATH; cd ./test; make erase_flash
clean: test/xtensa-esp32-elf test/esp-idf
export PATH=$(shell pwd)/test/xtensa-esp32-elf/bin:$$PATH; cd ./test; make clean
build: test/xtensa-esp32-elf test/esp-idf
export PATH=$(shell pwd)/test/xtensa-esp32-elf/bin:$$PATH; cd ./test; make
flash: test/xtensa-esp32-elf test/esp-idf
export PATH=$(shell pwd)/test/xtensa-esp32-elf/bin:$$PATH; cd ./test; make flash
monitor: test/xtensa-esp32-elf test/esp-idf
@clear
miniterm.py /dev/cu.SLAB_USBtoUART 115200 --rts 0 --dtr 0 --raw --exit-char 99
idf-monitor: test/xtensa-esp32-elf test/esp-idf test/components/esp-mqtt
export PATH=$(shell pwd)/test/xtensa-esp32-elf/bin:$$PATH; cd ./test; make monitor
debug:
export PATH=$(shell pwd)/test/xtensa-esp32-elf/bin:$$PATH; export IDF_PATH=$(shell pwd)/test/esp-idf; ./test/esp-idf/components/espcoredump/espcoredump.py info_corefile -t b64 -c ./test/dump.txt ./test/build/esp-mqtt.elf
run: build flash monitor