2021-01-26 05:12:54 +00:00
|
|
|
ifdef IS_BOOTLOADER_BUILD
|
2021-01-20 07:18:55 +00:00
|
|
|
|
|
|
|
ifndef CONFIG_IDF_ENV_FPGA
|
2021-01-26 05:12:54 +00:00
|
|
|
COMPONENT_CONFIG_ONLY := 1
|
2021-01-20 07:18:55 +00:00
|
|
|
else
|
|
|
|
COMPONENT_SRCDIRS := .
|
|
|
|
COMPONENT_OBJS += fpga_overrides.o
|
|
|
|
endif
|
|
|
|
|
2021-01-26 05:12:54 +00:00
|
|
|
else
|
2020-02-02 15:23:16 +00:00
|
|
|
SOC_NAME := $(IDF_TARGET)
|
|
|
|
|
|
|
|
COMPONENT_SRCDIRS := .
|
2021-03-10 13:55:49 +00:00
|
|
|
COMPONENT_ADD_INCLUDEDIRS := include port/public_compat
|
2021-01-26 05:12:54 +00:00
|
|
|
COMPONENT_PRIV_INCLUDEDIRS := port/include port
|
2021-03-10 11:33:24 +00:00
|
|
|
COMPONENT_ADD_LDFRAGMENTS += linker.lf app.lf
|
2021-05-24 11:39:39 +00:00
|
|
|
COMPONENT_DEPENDS := esp_phy
|
2020-02-02 15:23:16 +00:00
|
|
|
|
2021-01-20 07:18:55 +00:00
|
|
|
ifndef CONFIG_IDF_ENV_FPGA
|
|
|
|
COMPONENT_OBJEXCLUDE += fpga_overrides.o
|
|
|
|
endif
|
|
|
|
|
2020-11-21 02:15:59 +00:00
|
|
|
# Force linking UBSAN hooks. If UBSAN is not enabled, the hooks will ultimately be removed
|
|
|
|
# due to -ffunction-sections -Wl,--gc-sections options.
|
|
|
|
COMPONENT_ADD_LDFLAGS += -u __ubsan_include
|
|
|
|
|
2020-10-08 05:18:16 +00:00
|
|
|
include $(COMPONENT_PATH)/port/soc/$(SOC_NAME)/component.mk
|
2020-07-21 10:11:22 +00:00
|
|
|
|
|
|
|
# disable stack protection in files which are involved in initialization of that feature
|
2021-01-26 03:37:25 +00:00
|
|
|
startup.o stack_check.o: CFLAGS := $(filter-out -fstack-protector%, $(CFLAGS))
|
2021-04-08 02:27:21 +00:00
|
|
|
|
|
|
|
ld_input := $(COMPONENT_PATH)/ld/esp32/memory.ld.in
|
|
|
|
ld_output := $(COMPONENT_BUILD_DIR)/ld/memory.ld
|
|
|
|
|
|
|
|
sections_ld := $(COMPONENT_BUILD_DIR)/ld/sections.ld
|
|
|
|
|
|
|
|
#Linker scripts used to link the final application.
|
|
|
|
#Warning: These linker scripts are only used when the normal app is compiled; the bootloader
|
|
|
|
#specifies its own scripts.
|
|
|
|
LINKER_SCRIPTS += $(ld_output) $(sections_ld)
|
|
|
|
|
2021-10-24 09:08:40 +00:00
|
|
|
#ld_include_highint_hdl is added as an undefined symbol because otherwise the
|
|
|
|
#linker will ignore highint_hdl.S as it has no other files depending on any
|
2021-04-08 02:27:21 +00:00
|
|
|
#symbols in it.
|
2021-10-24 09:08:40 +00:00
|
|
|
COMPONENT_ADD_LDFLAGS += -u ld_include_highint_hdl \
|
2021-04-08 02:27:21 +00:00
|
|
|
$(addprefix -T ,$(LINKER_SCRIPTS)) \
|
|
|
|
|
|
|
|
# Preprocess memory.ld.in linker script into memory.ld
|
|
|
|
#
|
|
|
|
# The library doesn't really depend on memory.ld, but it
|
|
|
|
# saves us from having to add the target to a Makefile.projbuild
|
|
|
|
$(COMPONENT_LIBRARY): $(ld_output)
|
|
|
|
|
|
|
|
$(ld_output): $(ld_input) ../include/sdkconfig.h
|
|
|
|
mkdir -p $(COMPONENT_BUILD_DIR)/ld
|
2021-08-06 15:18:19 +00:00
|
|
|
$(CC) -I ../include -I $(COMPONENT_PATH)/ld -C -P -x c -E $< -o $@
|
2021-04-08 02:27:21 +00:00
|
|
|
|
|
|
|
COMPONENT_EXTRA_CLEAN := $(ld_output) $(sections_ld)
|
2021-01-26 05:12:54 +00:00
|
|
|
endif
|