Skip to content

Commit

Permalink
Bug 1320194 - Use 'wildcard' instead of dummy rules when re-generatin…
Browse files Browse the repository at this point in the history
…g build backends, r=glandium

Looking into the config.status path some more, the reason we always rebuild when it is not present is because of the way I implemented missing files in bug 1242663. However, I think an alternate solution there would be to use $(wildcard) instead of creating dummy rules on every file. so if our dependency file contains:

config.status
foo
bar

The current rules do:

backend.TestManifestBackend: config.status foo bar
    re-create backend
config.status foo bar:

Since config.status is missing, make runs the empty rule to try to create it (which does nothing), but that triggers the backend.TestManifestBackend rule. With wildcard this would look like:

backend.TestManifestBackend: $(wildcard config.status foo bar)
    re-create backend

Which means make only checks dependencies on the files that actually exist (presumably foo and bar in this case, but not config.status). But when config.status is later created, we'll know to recreate the TestManifestBackend then.

MozReview-Commit-ID: 6NTTmsnxTeT

--HG--
extra : rebase_source : 737c3021cbc26074ec54eafeca203ae95c37d8b8
  • Loading branch information
mshal committed Feb 10, 2017
1 parent e329d92 commit 6bbfcbc
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions build/rebuild-backend.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ $(subst .,%,$(BUILD_BACKEND_FILES)):
$(PYTHON) $(BACKEND_GENERATION_SCRIPT)

define build_backend_rule
$(1)_files := $$(shell cat $(1).in)
$(1): $$($(1)_files)
$$($(1)_files):
$(1): $$(wildcard $$(shell cat $(1).in))

endef
$(foreach file,$(BUILD_BACKEND_FILES),$(eval $(call build_backend_rule,$(file))))

0 comments on commit 6bbfcbc

Please sign in to comment.