mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
app_update: Fix a handling of version as string
This commit is contained in:
parent
3d1e064e1a
commit
00c1a40006
@ -35,22 +35,22 @@ PROJECT_VER:= $(PROJECT_VER)
|
||||
endif
|
||||
|
||||
# cut PROJECT_VER and PROJECT_NAME to required 32 characters.
|
||||
PROJECT_VER_CUT := $(shell echo $(PROJECT_VER) | cut -c 1-31)
|
||||
PROJECT_NAME_CUT := $(shell echo $(PROJECT_NAME) | cut -c 1-31)
|
||||
PROJECT_VER_CUT := $(shell echo "$(PROJECT_VER)" | cut -c 1-31)
|
||||
PROJECT_NAME_CUT := $(shell echo "$(PROJECT_NAME)" | cut -c 1-31)
|
||||
|
||||
$(info App "$(PROJECT_NAME_CUT)" version: $(PROJECT_VER_CUT))
|
||||
|
||||
NEW_DEFINES:= $(PROJECT_VER_CUT) $(PROJECT_NAME_CUT) $(IDF_VER)
|
||||
NEW_DEFINES:= "$(PROJECT_VER_CUT) $(PROJECT_NAME_CUT) $(IDF_VER)"
|
||||
ifeq ("$(wildcard ${TMP_DEFINES})","")
|
||||
OLD_DEFINES:=
|
||||
OLD_DEFINES:= ""
|
||||
else
|
||||
OLD_DEFINES:= $(shell cat $(TMP_DEFINES))
|
||||
OLD_DEFINES:= "$(shell cat $(TMP_DEFINES))"
|
||||
endif
|
||||
|
||||
# If NEW_DEFINES (PROJECT_VER, PROJECT_NAME) were changed then rebuild only esp_app_desc.
|
||||
ifneq ("${NEW_DEFINES}", "${OLD_DEFINES}")
|
||||
ifneq (${NEW_DEFINES}, ${OLD_DEFINES})
|
||||
$(shell echo $(NEW_DEFINES) > $(TMP_DEFINES); rm -f esp_app_desc.o;)
|
||||
endif
|
||||
|
||||
esp_app_desc.o: CPPFLAGS += -D PROJECT_VER=\"$(PROJECT_VER_CUT)\" -D PROJECT_NAME=\"$(PROJECT_NAME_CUT)\"
|
||||
esp_app_desc.o: CPPFLAGS += -D PROJECT_VER=\""$(PROJECT_VER_CUT)"\" -D PROJECT_NAME=\""$(PROJECT_NAME_CUT)"\"
|
||||
endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user