1#
2# This is a project Makefile. It is assumed the directory this Makefile resides in is a
3# project subdirectory.
4#
5ifeq ("$(MAKELEVEL)","0")
6$(error Bootloader makefile expects to be run as part of 'make bootloader' from a top-level project.)
7endif
8
9PROJECT_NAME := bootloader
10
11COMPONENTS := esp_hw_support esptool_py bootloader_support log spi_flash micro-ecc soc main efuse esp_rom hal xtensa
12
13# Clear C and CXX from top level project
14CFLAGS =
15CXXFLAGS =
16
17#We cannot include the some components like idf_target, esp_common directly but we need their includes.
18CFLAGS += -I $(IDF_PATH)/components/$(IDF_TARGET)/include
19CFLAGS += -I $(IDF_PATH)/components/esp_common/include
20CFLAGS += -I $(IDF_PATH)/components/newlib/platform_include
21CFLAGS += -I $(IDF_PATH)/components/xtensa/include -I $(IDF_PATH)/components/xtensa/$(IDF_TARGET)/include
22
23# The bootloader pseudo-component is also included in this build, for its Kconfig.projbuild to be included.
24#
25# IS_BOOTLOADER_BUILD tells the component Makefile.projbuild to be a no-op
26IS_BOOTLOADER_BUILD := 1
27export IS_BOOTLOADER_BUILD
28
29# BOOTLOADER_BUILD macro is the same, for source file changes
30CFLAGS += -D BOOTLOADER_BUILD=1
31
32# include the top-level "project" include directory, for sdkconfig.h
33CFLAGS += -I$(BUILD_DIR_BASE)/../include
34
35include $(IDF_PATH)/make/project.mk
36