Skip to content

Commit e3d366b

Browse files
committed
make: print-FOO fixes
Signed-off-by: Øyvind Harboe <[email protected]>
1 parent 669e62e commit e3d366b

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

flow/scripts/variables.mk

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,15 @@ vars:
215215
.PHONY: print-%
216216
# Print any variable, for instance: make print-DIE_AREA
217217
print-%:
218-
$(file >$(OBJECTS_DIR)/print_tmp_$$,$($*))
218+
# HERE BE DRAGONS!
219+
#
220+
# We have to use /tmp. $(OBJECTS_DIR) may not exist
221+
# at $(file) expansion time, which is before commands are run
222+
# here, so we can't mkdir -p $(OBJECTS_DIR) either
223+
#
224+
# We have to use $(file ...) because we want to be able
225+
# to print variables that contain newlines.
226+
$(file >/tmp/print_tmp$$,$($*))
219227
@echo -n "$* = "
220-
@cat $(OBJECTS_DIR)/print_tmp_$$
221-
@rm $(OBJECTS_DIR)/print_tmp_$$
228+
@cat /tmp/print_tmp$$
229+
@rm /tmp/print_tmp$$

0 commit comments

Comments
 (0)