Skip to content

Commit 2b672f1

Browse files
committed
make: print-FOO race condition global env var fix
avoid race conditions for global variables and temp files Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent a4e0906 commit 2b672f1

1 file changed

Lines changed: 2 additions & 13 deletions

File tree

flow/scripts/variables.mk

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -217,16 +217,5 @@ vars:
217217

218218
.PHONY: print-%
219219
print-%:
220-
# HERE BE DRAGONS!
221-
#
222-
# We have to use /tmp. $(OBJECTS_DIR) may not exist
223-
# at $(file) expansion time, which is before commands are run
224-
# here, so we can't mkdir -p $(OBJECTS_DIR) either
225-
#
226-
# We have to use $(file ...) because we want to be able
227-
# to print variables that contain newlines.
228-
$(eval TEMP_FILE := $(shell mktemp /tmp/print_tmp.XXXXXX))
229-
@$(file >$(TEMP_FILE),$($*))
230-
@echo -n "$*: "
231-
@cat $(TEMP_FILE)
232-
@rm -f $(TEMP_FILE)
220+
$(info $*: $($*))
221+
@true

0 commit comments

Comments
 (0)