Bug 1242074 - Reorder pattern rules to placate GNU Make 3.81; r?glandium
Recent changes in
bug 1239217 added the faster backend to the default
build mechanism for artifact builds. This seems to have uncovered a
difference in behavior between GNU Make 3.81 and newer. Starting with
GNU Make 3.82, pattern rules are selected according to shortest stem.
Before, they are used in definition order.
So, we change the order of the pattern rules so the longest prefixes are
first. This should result in the same behavior on various GNU Make
implementations.
--- a/config/faster/rules.mk
+++ b/config/faster/rules.mk
@@ -63,31 +63,31 @@ endif
.PHONY: FORCE
# Extra define to trigger some workarounds. We should strive to limit the
# use of those. As of writing the only ones are in
# toolkit/content/buildconfig.html and browser/locales/jar.mn.
ACDEFINES += -DBUILD_FASTER
-# Generic rule to fall back to the recursive make backend
-$(TOPOBJDIR)/%: FORCE
- $(MAKE) -C $(dir $@) $(notdir $@)
-
# Files under the faster/ sub-directory, however, are not meant to use the
# fallback
$(TOPOBJDIR)/faster/%: ;
# And files under dist/ are meant to be copied from their first dependency
# if there is no other rule.
$(TOPOBJDIR)/dist/%:
rm -f $@
mkdir -p $(@D)
cp $< $@
+# Generic rule to fall back to the recursive make backend
+$(TOPOBJDIR)/%: FORCE
+ $(MAKE) -C $(dir $@) $(notdir $@)
+
# Install files using install manifests
#
# The list of base directories is given in INSTALL_MANIFESTS. The
# corresponding install manifests are named correspondingly, with forward
# slashes replaced with underscores, and prefixed with `install_`. That is,
# the install manifest for `dist/bin` would be `install_dist_bin`.
$(addprefix install-,$(INSTALL_MANIFESTS)): install-%: $(TOPOBJDIR)/config/buildid
@# For now, force preprocessed files to be reprocessed every time.