Skip to content

Commit 2e8d043

Browse files
dpzmickripatel-fd
authored andcommitted
update makefiles to rebuild the test listing files upon changes to Local.mk
1 parent 65b1641 commit 2e8d043

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

config/everything.mk

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ MAKEFLAGS += --no-builtin-variables
99

1010
OBJDIR:=$(BASEDIR)/$(BUILDDIR)
1111

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+
1217
CPPFLAGS+=-DFD_BUILD_INFO=\"$(OBJDIR)/info\"
1318
CPPFLAGS+=$(EXTRA_CPPFLAGS)
1419

@@ -221,17 +226,19 @@ unit-test: $(OBJDIR)/unit-test/automatic.txt
221226
define _run-unit-test
222227
RUN_UNIT_TEST+=$(OBJDIR)/unit-test/$(1)
223228
endef
224-
$(OBJDIR)/unit-test/automatic.txt:
229+
$(OBJDIR)/unit-test/automatic.txt: $(LOCAL_MKS)
225230
$(MKDIR) "$(OBJDIR)/unit-test"
231+
$(RM) $@
226232
@$(foreach test,$(RUN_UNIT_TEST),echo $(test)>>$@;)
227233

228234
# Generate list of automatic integration tests from $(call run-integration-test,...)
229235
integration-test: $(OBJDIR)/integration-test/automatic.txt
230236
define _run-integration-test
231237
RUN_INTEGRATION_TEST+=$(OBJDIR)/integration-test/$(1)
232238
endef
233-
$(OBJDIR)/integration-test/automatic.txt:
239+
$(OBJDIR)/integration-test/automatic.txt: $(LOCAL_MKS)
234240
$(MKDIR) "$(OBJDIR)/integration-test"
241+
$(RM) $@
235242
@$(foreach test,$(RUN_INTEGRATION_TEST),echo $(test)>>$@;)
236243
$(TOUCH) "$@"
237244

@@ -402,8 +409,8 @@ include $(1)
402409
MKPATH:=
403410
endef
404411

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))))
407414

408415
# Include all the dependencies. Must be after the make fragments
409416
# include so that DEPFILES is fully populated (similarly for the

0 commit comments

Comments
 (0)