1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/pkg/esp8266_sdk/Makefile
Gunar Schorcht cc2a36581d pkg/esp8266_sdk: fix version string generation
Patching a package creates a new HEAD of the package repository. Using `git describe --tag` to generate a version string used for the ESP8266 bootloader therefore generates a different version string for each new compilation, which in turn results in different hash values of the binaries for the same application in subsequent compilations in CI. To use the commit in `git describe --tag` for commit used by the package, the commit has to specified in the command.
2023-01-10 20:22:40 +01:00

41 lines
1.5 KiB
Makefile

PKG_NAME=esp8266_sdk
PKG_URL=https://github.com/espressif/ESP8266_RTOS_SDK
# This is a version in the v3.1 release branch, between 3.1 and 3.1.1.
PKG_VERSION=913a06a9ac3b2f18009e8fee8f092ca9ffeccd38
PKG_LICENSE=Apache-2.0
include $(RIOTBASE)/pkg/pkg.mk
# This directory is shared across all apps since there's no need to replicate
# these libraries on each app.
ESP8266_SDK_BUILD_DIR = $(PKG_SOURCE_DIR)/build-libs
# We need to replace some symbols in the binary libraries shipped with the SDK
# to avoid collisions with RIOT symbols.
ESP_SDK_COMPONENT_LIBS = \
libcore.a libespnow.a libgcc.a libhal.a libnet80211.a libphy.a libpp.a \
libsmartconfig.a libssc.a libwpa.a libwps.a
ESP_SDK_LIBS = $(addprefix $(ESP8266_SDK_BUILD_DIR)/, $(ESP_SDK_COMPONENT_LIBS))
all: $(ESP_SDK_LIBS) $(ESP8266_SDK_BUILD_DIR)/esp8266_idf_version.h
$(PKG_PREPARED): $(ESP8266_SDK_BUILD_DIR)
$(ESP8266_SDK_BUILD_DIR): $(PKG_PATCHED)
$(Q)mkdir -p $(ESP8266_SDK_BUILD_DIR)
# Set the SDK version from the SDK hash/tag. For example "v3.1-51-g913a06a9".
$(ESP8266_SDK_BUILD_DIR)/esp8266_idf_version.h: | $(ESP8266_SDK_BUILD_DIR)
$(Q)echo -n "#define IDF_VER" \
"\"$(shell git -C $(PKG_SOURCE_DIR) describe --tags $(PKG_VERSION))\"" \
> $@
$(ESP8266_SDK_BUILD_DIR)/lib%.a: \
$(PKG_SOURCE_DIR)/components/esp8266/lib/lib%.a | $(ESP8266_SDK_BUILD_DIR)
$(Q)$(OBJCOPY) \
--redefine-syms $(CURDIR)/symbol_renames.txt \
--redefine-sym printf=$(patsubst lib%.a,%,$(notdir $@))_printf \
--redefine-sym ets_printf=$(patsubst lib%.a,%,$(notdir $@))_ets_printf \
$< $@