@@ -82,6 +82,8 @@ ifeq ($(INCLUDE), true)
82
82
# INFO : Message to display at LOG=info level when running command (optional)
83
83
# WARN : Message to display at LOG=warn level when running command (optional)
84
84
# DEPS : Dependencies for the execution to take place
85
+ # DRYRUN : Set to true to perform everything but executing the command \
86
+ # (defaults to false, primarily intended for debugging)
85
87
#
86
88
87
89
# Setup make rules for copying files, with an option to do more complex
@@ -161,8 +163,13 @@ define SetupExecuteBody
161
163
$$(TOUCH) $$@
162
164
163
165
$$($1_EXEC_RESULT): $$($1_PRE_MARKER)
164
- $$(call ExecuteWithLog, $$($1_BASE)_exec, \
165
- cd $$($1_WORKING_DIR) && $$($1_COMMAND))
166
+ ifneq ($$($1_DRYRUN), true)
167
+ $$(call ExecuteWithLog, $$($1_BASE)_exec, \
168
+ cd $$($1_WORKING_DIR) && $$($1_COMMAND))
169
+ else
170
+ $$(call LogWarn, DRYRUN enabled for $1, not actually running command)
171
+ $$(TOUCH) $$@
172
+ endif
166
173
ifeq ($$($1_EXEC_RESULT), $$($1_EXEC_MARKER))
167
174
$$(TOUCH) $$@
168
175
endif
@@ -177,8 +184,13 @@ define SetupExecuteBody
177
184
$$(call LogInfo, $$($1_INFO))
178
185
endif
179
186
$$(call MakeDir, $$(call EncodeSpace, $$($1_WORKING_DIR)) $$(call EncodeSpace, $$($1_SUPPORT_DIR)) $$(call EncodeSpace, $$($1_OUTPUT_DIR)))
180
- $$(call ExecuteWithLog, $$($1_BASE)_exec, \
181
- cd $$($1_WORKING_DIR) && $$($1_COMMAND))
187
+ ifneq ($$($1_DRYRUN), true)
188
+ $$(call ExecuteWithLog, $$($1_BASE)_exec, \
189
+ cd $$($1_WORKING_DIR) && $$($1_COMMAND))
190
+ else
191
+ $$(call LogWarn, DRYRUN enabled for $1, not actually running command)
192
+ $$(TOUCH) $$@
193
+ endif
182
194
ifeq ($$($1_EXEC_RESULT), $$($1_EXEC_MARKER))
183
195
$$(TOUCH) $$@
184
196
endif
0 commit comments