Skip to content

Commit df5f6af

Browse files
authored
Merge pull request #3328 from Pinata-Consulting/make-print-fixes
make: print-FOO fixes
2 parents f084b07 + e3d366b commit df5f6af

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)