build/rebuild-backend.mk
author Drew Willcoxon <adw@mozilla.com>
Mon, 29 Oct 2018 16:13:49 +0000
changeset 443341 0cd201908c7d8d409478c5b95a66fb3ab42378c8
parent 343048 03804db09cf364ff228fc61409702d9a86d44ade
child 468486 5cc56532ff4a4b2b896f84e4b6e7889837acb42d
permissions -rw-r--r--
Bug 1498023 - Search shortcuts should hide all one-off UI when typed r=mak,Mardak * Disable or enable the one-offs per each new search based on whether the first char is "@". The patch does this in `onResultsAdded`, where other per-search initialization happens. * Remove the `disableOneOffButtons` option from the urlbar `search` method. It's not necessary anymore now that one-offs are automatically hidden for the only caller that uses this option (new tab with the "@engine" tiles). * Make the `oneOffSearchesEnabled` getter return the actual status of the one-off UI instead of relying on an `_oneOffSearchesEnabled` property. Differential Revision: https://phabricator.services.mozilla.com/D9883

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

BACKEND_GENERATION_SCRIPT ?= config.status

# A traditional rule would look like this:
#    backend.%:
#        @echo do stuff
#
# But with -j<n>, and multiple items in BUILD_BACKEND_FILES, the command would
# run multiple times in parallel.
#
# "Fortunately", make has some weird semantics for pattern rules: if there are
# multiple targets in a pattern rule and each of them is matched at most once,
# the command will only run once. So:
#     backend%RecursiveMakeBackend backend%FasterMakeBackend:
#         @echo do stuff
#     backend: backend.RecursiveMakeBackend backend.FasterMakeBackend
# would only execute the command once.
#
# Credit where due: http://stackoverflow.com/questions/2973445/gnu-makefile-rule-generating-a-few-targets-from-a-single-source-file/3077254#3077254
$(subst .,%,$(BUILD_BACKEND_FILES)):
	@echo 'Build configuration changed. Regenerating backend.'
	$(PYTHON) $(BACKEND_GENERATION_SCRIPT)

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

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