@@ -9,6 +9,11 @@ MAKEFLAGS += --no-builtin-variables
9
9
10
10
OBJDIR: =$(BASEDIR ) /$(BUILDDIR )
11
11
12
+ # Grab all the Local.mk files in the source tree, save to a variable so that
13
+ # other rules can depend on this list. We will include these files later on.
14
+ # Don't use "-L" if source code directory structure has symlink loops
15
+ LOCAL_MKS := $(shell $(FIND ) -L src -type f -name Local.mk)
16
+
12
17
CPPFLAGS+=-DFD_BUILD_INFO =\"$(OBJDIR ) /info\"
13
18
CPPFLAGS+ =$(EXTRA_CPPFLAGS )
14
19
@@ -221,17 +226,19 @@ unit-test: $(OBJDIR)/unit-test/automatic.txt
221
226
define _run-unit-test
222
227
RUN_UNIT_TEST+=$(OBJDIR ) /unit-test/$(1 )
223
228
endef
224
- $(OBJDIR ) /unit-test/automatic.txt :
229
+ $(OBJDIR ) /unit-test/automatic.txt : $( LOCAL_MKS )
225
230
$(MKDIR ) " $( OBJDIR) /unit-test"
231
+ $(RM ) $@
226
232
@$(foreach test,$(RUN_UNIT_TEST ) ,echo $(test ) >>$@ ;)
227
233
228
234
# Generate list of automatic integration tests from $(call run-integration-test,...)
229
235
integration-test : $(OBJDIR ) /integration-test/automatic.txt
230
236
define _run-integration-test
231
237
RUN_INTEGRATION_TEST+=$(OBJDIR ) /integration-test/$(1 )
232
238
endef
233
- $(OBJDIR ) /integration-test/automatic.txt :
239
+ $(OBJDIR ) /integration-test/automatic.txt : $( LOCAL_MKS )
234
240
$(MKDIR ) " $( OBJDIR) /integration-test"
241
+ $(RM ) $@
235
242
@$(foreach test,$(RUN_INTEGRATION_TEST ) ,echo $(test ) >>$@ ;)
236
243
$(TOUCH ) " $@ "
237
244
@@ -402,8 +409,8 @@ include $(1)
402
409
MKPATH:=
403
410
endef
404
411
405
- # Don't use "-L" if source code directory structure has symlink loops
406
- $(foreach mk,$(shell $(FIND) -L src -type f -name Local.mk ),$(eval $(call _include-mk,$(mk))))
412
+ # Include all of the Local.mk files we found earlier
413
+ $(foreach mk,$(LOCAL_MKS ),$(eval $(call _include-mk,$(mk))))
407
414
408
415
# Include all the dependencies. Must be after the make fragments
409
416
# include so that DEPFILES is fully populated (similarly for the
0 commit comments