From 00ce00c246766b8a2ce09b96cf23b812a04d03a4 Mon Sep 17 00:00:00 2001 From: "Lance R. Vick" Date: Fri, 13 Oct 2023 05:04:57 -0700 Subject: [PATCH] avoid breaking on targets with special chars --- Makefile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 25c849f..9ceb1fc 100644 --- a/Makefile +++ b/Makefile @@ -96,7 +96,7 @@ define toolchain-profile-untracked endef define toolchain-profile-start - printf "%s,$(call epochms),\n" "$@" >> $(TOOLCHAIN_PROFILE_FILE); + printf "%s,$(call epochms),\n" "$@" >> "$(TOOLCHAIN_PROFILE_FILE)" endef define toolchain-profile-stop @@ -104,9 +104,10 @@ define toolchain-profile-stop && cp $(TOOLCHAIN_PROFILE_FILE) $$tmpfile \ && awk \ -v ms="$(call epochms)" \ - '/^$(@),/ {$$0=$$0ms} 1' \ + -v target="$(@)" \ + '$$1 ~ "^" target {$$0=$$0ms} 1' \ $$tmpfile \ - > $(TOOLCHAIN_PROFILE_FILE) + > "$(TOOLCHAIN_PROFILE_FILE)" endef export