app_update: Fix a handling of version as string
@@ -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
