-
Notifications
You must be signed in to change notification settings - Fork 45
/
Makefile.esp32
49 lines (37 loc) · 1.51 KB
/
Makefile.esp32
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
ESPPORT = $(PORT)
export ESPPORT
IDF_PATH = $(ROOT)/lib/esp-idf
export IDF_PATH
PARTITIONS_TABLE_CSV := $(PLATFORMS_DIR)/esp32/partitions.csv
PARTITION_TABLE_CSV_PATH := $(PARTITIONS_TABLE_CSV)
export PARTITION_TABLE_CSV_PATH
SDKCONFIG_BASE := $(PLATFORMS_DIR)/esp32/sdkconfig.base
SDKCONFIG_PLATFORM := $(PLATFORMS_DIR)/$(PLATFORM)/sdkconfig
SDKCONFIG_VARIANT := $(VARIANTS_DIR)/$(VARIANT)/sdkconfig
BUILD_DIR_BASE = $(PROJECT_PATH)/build-$(TARGET)
SDKCONFIG = $(ROOT)/build-$(TARGET)/sdkconfig
SDKCONFIG_DIR = $(dir $(SDKCONFIG))
SDKCONFIG_DEFAULTS = $(SDKCONFIG).defaults
CPPFLAGS += -DESP32
CPPFLAGS += -DHAVE_SDKCONFIG_H
PLATFORM_SOURCES = esp32
export PLATFORM_SOURCES
REAL_MAKECMDGOALS = $(MAKECMDGOALS)
ifeq ("$(wildcard $(SDKCONFIG))","")
# This tricks the project_config.mk in esp-idf v3.0 to not run menuconfig
# unconditionally when the SDKCONFIG doesn't exist yet.
# XXX: Might need adjustment when upgrading
MAKECMDGOALS += defconfig
dummy := $(shell mkdir -p $(SDKCONFIG_DIR) && cat $(SDKCONFIG_BASE) $(SDKCONFIG_PLATFORM) $(SDKCONFIG_VARIANT) >> $(SDKCONFIG))
endif
include $(IDF_PATH)/make/project.mk
MAKECMDGOALS = $(REAL_MAKECMDGOALS)
erase: erase_flash
release: all_binaries
$(PLATFORMS_DIR)/esp32/make_release.py \
--esptool-write-flash-options "$(ESPTOOL_WRITE_FLASH_OPTIONS)" \
--esptool-all-flash-args "$(ESPTOOL_ALL_FLASH_ARGS)" \
--partitions-csv "$(PARTITIONS_TABLE_CSV)" \
--basename "$(RELEASE_BASENAME)" \
--output-dir "$(RELEASES_DIR)"
$(TARGET): $(SDKCONFIG) all