esp-idf/components/esp_phy/Makefile.projbuild
Shu Chen 6061a547e5 esp_phy: decouple esp_phy component from esp_wifi and bt
* add esp-phy-lib submodule
* move libphy.a and phy_init.c from esp_wifi to esp_phy
* move librtc.a from esp_wifi to esp_phy
* move libbtbb.a from bt to esp_phy
* corresponding updates to build system
2021-06-03 16:17:31 +08:00

41 lines
1.4 KiB
Makefile

ifdef CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION
ESP_PHY_COMPONENT_PATH := $(COMPONENT_PATH)
ifdef CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN
PHY_INIT_DATA_BIN = $(ESP_PHY_COMPONENT_PATH)/phy_multiple_init_data.bin
else
PHY_INIT_DATA_OBJ = $(BUILD_DIR_BASE)/phy_init_data.o
PHY_INIT_DATA_BIN = $(BUILD_DIR_BASE)/phy_init_data.bin
$(PHY_INIT_DATA_OBJ): $(ESP_PHY_COMPONENT_PATH)/$(IDF_TARGET)/include/phy_init_data.h $(BUILD_DIR_BASE)/include/sdkconfig.h
$(summary) CC $(notdir $@)
printf "#include \"phy_init_data.h\"\n" | $(CC) -I $(BUILD_DIR_BASE)/include -I $(ESP_PHY_COMPONENT_PATH)/../esp_common/include -I $(ESP_PHY_COMPONENT_PATH)/include -I $(ESP_PHY_COMPONENT_PATH)/$(IDF_TARGET)/include -c -o $@ -xc -
$(PHY_INIT_DATA_BIN): $(PHY_INIT_DATA_OBJ)
$(summary) BIN $(notdir $@)
$(OBJCOPY) -O binary $< $@
endif
# Command to flash PHY init data partition
PHY_INIT_DATA_FLASH_CMD = $(ESPTOOLPY_SERIAL) write_flash $(PHY_DATA_OFFSET) $(PHY_INIT_DATA_BIN)
ESPTOOL_ALL_FLASH_ARGS += $(PHY_DATA_OFFSET) $(PHY_INIT_DATA_BIN)
phy_init_data: $(PHY_INIT_DATA_BIN)
phy_init_data-flash: $(PHY_INIT_DATA_BIN)
@echo "Flashing PHY init data..."
$(PHY_INIT_DATA_FLASH_CMD)
ifndef CONFIG_ESP32_SUPPORT_MULTIPLE_PHY_INIT_DATA_BIN
phy_init_data-clean:
rm -f $(PHY_INIT_DATA_BIN) $(PHY_INIT_DATA_OBJ)
clean: phy_init_data-clean
endif
all: phy_init_data
flash: phy_init_data
endif # CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION