Bug 870891 - move DIST_FILES to moz.build; r=mshal
authorNathan Froyd <froydnj@mozilla.com>
Wed, 15 Apr 2015 16:04:49 -0400
changeset 239531 399f25e8643a5b21153a4d591c6af24ff6fbf3d9
parent 239530 5c83a36d9eba38de74317594c80ed503b19cc074
child 239532 3920b67e97a3f426335edfe6514b1f494b0bc291
push id12423
push userryanvm@gmail.com
push dateThu, 16 Apr 2015 20:24:37 +0000
treeherderfx-team@7d8051a8dd01 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs870891
milestone40.0a1
Bug 870891 - move DIST_FILES to moz.build; r=mshal
build/Makefile.in
build/moz.build
dom/indexedDB/test/extensions/Makefile.in
dom/indexedDB/test/extensions/moz.build
dom/workers/test/extensions/bootstrap/Makefile.in
dom/workers/test/extensions/bootstrap/moz.build
dom/workers/test/extensions/traditional/Makefile.in
dom/workers/test/extensions/traditional/moz.build
layout/tools/reftest/Makefile.in
layout/tools/reftest/moz.build
mobile/android/base/Makefile.in
mobile/android/base/moz.build
python/mozbuild/mozbuild/backend/recursivemake.py
python/mozbuild/mozbuild/frontend/context.py
python/mozbuild/mozbuild/frontend/data.py
python/mozbuild/mozbuild/frontend/emitter.py
python/mozbuild/mozbuild/test/backend/data/dist-files/install.rdf
python/mozbuild/mozbuild/test/backend/data/dist-files/main.js
python/mozbuild/mozbuild/test/backend/data/dist-files/moz.build
python/mozbuild/mozbuild/test/backend/test_recursivemake.py
python/mozbuild/mozbuild/test/frontend/data/dist-files-missing/install.rdf
python/mozbuild/mozbuild/test/frontend/data/dist-files-missing/moz.build
python/mozbuild/mozbuild/test/frontend/data/dist-files/install.rdf
python/mozbuild/mozbuild/test/frontend/data/dist-files/main.js
python/mozbuild/mozbuild/test/frontend/data/dist-files/moz.build
python/mozbuild/mozbuild/test/frontend/test_emitter.py
testing/mochitest/Makefile.in
testing/mochitest/moz.build
testing/specialpowers/Makefile.in
testing/specialpowers/moz.build
tools/quitter/Makefile.in
tools/quitter/moz.build
xulrunner/examples/simple/Makefile.in
xulrunner/examples/simple/moz.build
--- a/build/Makefile.in
+++ b/build/Makefile.in
@@ -2,24 +2,16 @@
 # 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/.
 
 USE_RCS_MK := 1
 include $(topsrcdir)/config/makefiles/makeutils.mk
 
 ifdef MOZ_APP_BASENAME
-DIST_FILES = $(srcdir)/application.ini
-
-ifneq (android,$(MOZ_WIDGET_TOOLKIT))
-ifdef MOZ_UPDATER
-DIST_FILES += update-settings.ini
-endif
-endif
-
 ifdef LIBXUL_SDK
 APP_INI_DEPS = $(LIBXUL_DIST)/bin/platform.ini
 else
 APP_INI_DEPS = $(topsrcdir)/config/milestone.txt
 endif
 
 APP_BUILDID := $(shell cat $(DEPTH)/config/buildid)
 APP_INI_DEPS += $(DEPTH)/config/buildid
--- a/build/moz.build
+++ b/build/moz.build
@@ -65,8 +65,13 @@ if CONFIG['MOZ_DMD']:
 
 # Put a useful .gdbinit in the bin directory, to be picked up automatically
 # by GDB when we debug executables there.
 FINAL_TARGET_FILES += [TOPSRCDIR + '/.gdbinit']
 
 # Install the clang-cl runtime library for ASAN next to the binaries we produce.
 if CONFIG['MOZ_ASAN'] and CONFIG['CLANG_CL']:
     FINAL_TARGET_FILES += [CONFIG['MOZ_CLANG_RT_ASAN_LIB_PATH']]
+
+if CONFIG['MOZ_APP_BASENAME']:
+    DIST_FILES += ['application.ini']
+    if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android' and CONFIG['MOZ_UPDATER']:
+        DIST_FILES += ['update-settings.ini']
--- a/dom/indexedDB/test/extensions/Makefile.in
+++ b/dom/indexedDB/test/extensions/Makefile.in
@@ -1,17 +1,12 @@
 # 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/.
 
-DIST_FILES = \
-  bootstrap.js \
-  install.rdf \
-  $(NULL)
-
 TEST_EXTENSIONS_DIR = $(DEPTH)/_tests/testing/mochitest/extensions
 
 GENERATED_DIRS = $(TEST_EXTENSIONS_DIR)
 
 include $(topsrcdir)/config/rules.mk
 
 libs::
 	@(cd $(DIST)/xpi-stage && tar $(TAR_CREATE_FLAGS) - $(XPI_NAME)) | (cd $(TEST_EXTENSIONS_DIR) && tar -xf -)
--- a/dom/indexedDB/test/extensions/moz.build
+++ b/dom/indexedDB/test/extensions/moz.build
@@ -1,7 +1,12 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 XPI_NAME = 'indexedDB'
+
+DIST_FILES += [
+    'bootstrap.js',
+    'install.rdf',
+]
--- a/dom/workers/test/extensions/bootstrap/Makefile.in
+++ b/dom/workers/test/extensions/bootstrap/Makefile.in
@@ -1,18 +1,12 @@
 # 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/.
 
-DIST_FILES = \
-  bootstrap.js \
-  install.rdf \
-  worker.js \
-  $(NULL)
-
 TEST_EXTENSIONS_DIR = $(DEPTH)/_tests/testing/mochitest/extensions
 
 GENERATED_DIRS = $(TEST_EXTENSIONS_DIR)
 
 include $(topsrcdir)/config/rules.mk
 
 libs::
 	@(cd $(DIST)/xpi-stage && tar $(TAR_CREATE_FLAGS) - $(XPI_NAME)) | (cd $(TEST_EXTENSIONS_DIR) && tar -xf -)
--- a/dom/workers/test/extensions/bootstrap/moz.build
+++ b/dom/workers/test/extensions/bootstrap/moz.build
@@ -1,7 +1,13 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # 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/.
 
 XPI_NAME = 'workerbootstrap'
+
+DIST_FILES += [
+    'bootstrap.js',
+    'install.rdf',
+    'worker.js',
+]
--- a/dom/workers/test/extensions/traditional/Makefile.in
+++ b/dom/workers/test/extensions/traditional/Makefile.in
@@ -1,17 +1,12 @@
 # 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/.
 
-DIST_FILES = \
-  install.rdf \
-  worker.js \
-  $(NULL)
-
 TEST_EXTENSIONS_DIR = $(DEPTH)/_tests/testing/mochitest/extensions
 
 GENERATED_DIRS = $(TEST_EXTENSIONS_DIR)
 
 include $(topsrcdir)/config/rules.mk
 
 libs::
 	@(cd $(DIST)/xpi-stage && tar $(TAR_CREATE_FLAGS) - $(XPI_NAME)) | (cd $(TEST_EXTENSIONS_DIR) && tar -xf -)
--- a/dom/workers/test/extensions/traditional/moz.build
+++ b/dom/workers/test/extensions/traditional/moz.build
@@ -11,8 +11,13 @@ XPIDL_SOURCES += [
 XPIDL_MODULE = 'WorkerTest'
 
 EXTRA_COMPONENTS += [
     'WorkerTest.js',
     'WorkerTest.manifest',
 ]
 
 XPI_NAME = 'worker'
+
+DIST_FILES += [
+    'install.rdf',
+    'worker.js',
+]
--- a/layout/tools/reftest/Makefile.in
+++ b/layout/tools/reftest/Makefile.in
@@ -1,19 +1,13 @@
 # vim: set shiftwidth=8 tabstop=8 autoindent noexpandtab copyindent:
 # 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/.
 
-DIST_FILES = install.rdf
-
-ifeq ($(MOZ_BUILD_APP),mobile/android)
-DIST_FILES += bootstrap.js
-endif
-
 # Used in install.rdf
 USE_EXTENSION_MANIFEST=1
 
 _DEST_DIR = $(DEPTH)/_tests/reftest
 
 _HARNESS_FILES = \
   $(srcdir)/runreftest.py \
   $(srcdir)/remotereftest.py \
--- a/layout/tools/reftest/moz.build
+++ b/layout/tools/reftest/moz.build
@@ -15,8 +15,13 @@ else:
     EXTRA_PP_COMPONENTS += [
         'reftest-cmdline.js',
         'reftest-cmdline.manifest',
     ]
 
 JAR_MANIFESTS += ['jar.mn']
 
 XPI_NAME = 'reftest'
+
+DIST_FILES += ['install.rdf']
+
+if CONFIG['MOZ_BUILD_APP'] == 'mobile/android':
+    DIST_FILES += ['bootstrap.js']
--- a/mobile/android/base/Makefile.in
+++ b/mobile/android/base/Makefile.in
@@ -1,16 +1,12 @@
 # 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/.
 
-DIST_FILES := \
-  package-name.txt.in \
-  $(NULL)
-
 ifneq (,$(findstring -march=armv7,$(OS_CFLAGS)))
 MIN_CPU_VERSION=7
 else
 MIN_CPU_VERSION=5
 endif
 
 MOZ_APP_BUILDID=$(shell cat $(DEPTH)/config/buildid)
 
--- a/mobile/android/base/moz.build
+++ b/mobile/android/base/moz.build
@@ -883,8 +883,10 @@ if CONFIG['MOZ_CRASHREPORTER']:
 
 if CONFIG['MOZ_ANDROID_MLS_STUMBLER']:
     main.included_projects += ['../FennecStumbler']
     main.referenced_projects += ['../FennecStumbler']
 
 if CONFIG['MOZ_ANDROID_SEARCH_ACTIVITY']:
     # The Search Activity code is built as part of Fennec, so we follow suit in Eclipse.
     main.add_classpathentry('search', TOPSRCDIR + '/mobile/android/search/java', dstdir='search')
+
+DIST_FILES += ['package-name.txt.in']
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -27,16 +27,17 @@ import mozpack.path as mozpath
 
 from .common import CommonBackend
 from ..frontend.data import (
     AndroidEclipseProjectData,
     ConfigFileSubstitution,
     ContextDerived,
     ContextWrapped,
     Defines,
+    DistFiles,
     DirectoryTraversal,
     Exports,
     ExternalLibrary,
     FinalTargetFiles,
     GeneratedFile,
     GeneratedInclude,
     GeneratedSources,
     HostLibrary,
@@ -552,16 +553,25 @@ class RecursiveMakeBackend(CommonBackend
             self._process_linked_libraries(obj, backend_file)
 
         elif isinstance(obj, HostLibrary):
             self._process_host_library(obj, backend_file)
             self._process_linked_libraries(obj, backend_file)
 
         elif isinstance(obj, FinalTargetFiles):
             self._process_final_target_files(obj, obj.files, obj.target)
+
+        elif isinstance(obj, DistFiles):
+            # We'd like to install these via manifests as preprocessed files.
+            # But they currently depend on non-standard flags being added via
+            # some Makefiles, so for now we just pass them through to the
+            # underlying Makefile.in.
+            for f in obj.files:
+                backend_file.write('DIST_FILES += %s\n' % f)
+
         else:
             return
         obj.ack()
 
     def _fill_root_mk(self):
         """
         Create two files, root.mk and root-deps.mk, the first containing
         convenience variables, and the other dependency definitions for a
--- a/python/mozbuild/mozbuild/frontend/context.py
+++ b/python/mozbuild/mozbuild/frontend/context.py
@@ -725,16 +725,22 @@ VARIABLES = {
            FINAL_TARGET_FILES.images['do-not-use'] += ['bar.svg']
         """, None),
 
     'DISABLE_STL_WRAPPING': (bool, bool,
         """Disable the wrappers for STL which allow it to work with C++ exceptions
         disabled.
         """, None),
 
+    'DIST_FILES': (StrictOrderingOnAppendList, list,
+        """Additional files to place in ``FINAL_TARGET`` (typically ``dist/bin``).
+
+        Unlike ``FINAL_TARGET_FILES``, these files are preprocessed.
+        """, 'libs'),
+
     'EXTRA_COMPONENTS': (StrictOrderingOnAppendList, list,
         """Additional component files to distribute.
 
        This variable contains a list of files to copy into
        ``$(FINAL_TARGET)/components/``.
         """, 'misc'),
 
     'EXTRA_JS_MODULES': (HierarchicalStringList, list,
--- a/python/mozbuild/mozbuild/frontend/data.py
+++ b/python/mozbuild/mozbuild/frontend/data.py
@@ -848,16 +848,32 @@ class FinalTargetFiles(ContextDerived):
     __slots__ = ('files', 'target')
 
     def __init__(self, sandbox, files, target):
         ContextDerived.__init__(self, sandbox)
         self.files = files
         self.target = target
 
 
+class DistFiles(ContextDerived):
+    """Sandbox container object for FINAL_TARGET_FILES, which is a
+    HierarchicalStringList.
+
+    We need an object derived from ContextDerived for use in the backend, so
+    this object fills that role. It just has a reference to the underlying
+    HierarchicalStringList, which is created when parsing DIST_FILES.
+    """
+    __slots__ = ('files', 'target')
+
+    def __init__(self, sandbox, files, target):
+        ContextDerived.__init__(self, sandbox)
+        self.files = files
+        self.target = target
+
+
 class GeneratedFile(ContextDerived):
     """Represents a generated file."""
 
     __slots__ = (
         'script',
         'method',
         'output',
         'inputs',
--- a/python/mozbuild/mozbuild/frontend/emitter.py
+++ b/python/mozbuild/mozbuild/frontend/emitter.py
@@ -23,16 +23,17 @@ import mozpack.path as mozpath
 import manifestparser
 import reftest
 import mozinfo
 
 from .data import (
     ConfigFileSubstitution,
     ContextWrapped,
     Defines,
+    DistFiles,
     DirectoryTraversal,
     Exports,
     FinalTargetFiles,
     GeneratedEventWebIDLFile,
     GeneratedFile,
     GeneratedInclude,
     GeneratedSources,
     GeneratedWebIDLFile,
@@ -636,16 +637,26 @@ class TreeMetadataEmitter(LoggingMixin):
                 raise SandboxValidationError('Path specified in LOCAL_INCLUDES '
                     'does not exist: %s (resolved to %s)' % (local_include, actual_include), context)
             yield LocalInclude(context, local_include)
 
         final_target_files = context.get('FINAL_TARGET_FILES')
         if final_target_files:
             yield FinalTargetFiles(context, final_target_files, context['FINAL_TARGET'])
 
+        dist_files = context.get('DIST_FILES')
+        if dist_files:
+            for f in dist_files:
+                path = os.path.join(context.srcdir, f)
+                if not os.path.exists(path):
+                    raise SandboxValidationError('File listed in DIST_FILES '
+                        'does not exist: %s' % f, context)
+
+            yield DistFiles(context, dist_files, context['FINAL_TARGET'])
+
         self._handle_libraries(context)
 
         for obj in self._process_test_manifests(context):
             yield obj
 
         for obj in self._process_jar_manifests(context):
             yield obj
 
new file mode 100644
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/python/mozbuild/mozbuild/test/backend/data/dist-files/moz.build
@@ -0,0 +1,8 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# Any copyright is dedicated to the Public Domain.
+# http://creativecommons.org/publicdomain/zero/1.0/
+
+DIST_FILES += [
+    'install.rdf',
+    'main.js',
+]
--- a/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
+++ b/python/mozbuild/mozbuild/test/backend/test_recursivemake.py
@@ -622,16 +622,31 @@ class TestRecursiveMakeBackend(BackendTe
         for key, expected_rules in expected.iteritems():
             backend_path = mozpath.join(key, 'backend.mk')
             lines = [l.strip() for l in open(backend_path, 'rt').readlines()[2:]]
             found = [str for str in lines if
                 str.startswith('FINAL_TARGET') or str.startswith('XPI_NAME') or
                 str.startswith('DIST_SUBDIR')]
             self.assertEqual(found, expected_rules)
 
+    def test_dist_files(self):
+        """Test that DIST_FILES is written to backend.mk correctly."""
+        env = self._consume('dist-files', RecursiveMakeBackend)
+
+        backend_path = mozpath.join(env.topobjdir, 'backend.mk')
+        lines = [l.strip() for l in open(backend_path, 'rt').readlines()[2:]]
+
+        expected = [
+            'DIST_FILES += install.rdf',
+            'DIST_FILES += main.js',
+        ]
+
+        found = [str for str in lines if str.startswith('DIST_FILES')]
+        self.assertEqual(found, expected)
+
     def test_config(self):
         """Test that CONFIGURE_SUBST_FILES and CONFIGURE_DEFINE_FILES are
         properly handled."""
         env = self._consume('test_config', RecursiveMakeBackend)
 
         self.assertEqual(
             open(os.path.join(env.topobjdir, 'file'), 'r').readlines(), [
                 '#ifdef foo\n',
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/python/mozbuild/mozbuild/test/frontend/data/dist-files-missing/moz.build
@@ -0,0 +1,8 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# Any copyright is dedicated to the Public Domain.
+# http://creativecommons.org/publicdomain/zero/1.0/
+
+DIST_FILES += [
+    'install.rdf',
+    'main.js',
+]
new file mode 100644
new file mode 100644
new file mode 100644
--- /dev/null
+++ b/python/mozbuild/mozbuild/test/frontend/data/dist-files/moz.build
@@ -0,0 +1,8 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# Any copyright is dedicated to the Public Domain.
+# http://creativecommons.org/publicdomain/zero/1.0/
+
+DIST_FILES += [
+    'install.rdf',
+    'main.js',
+]
--- a/python/mozbuild/mozbuild/test/frontend/test_emitter.py
+++ b/python/mozbuild/mozbuild/test/frontend/test_emitter.py
@@ -7,16 +7,17 @@ from __future__ import unicode_literals
 import os
 import unittest
 
 from mozunit import main
 
 from mozbuild.frontend.data import (
     ConfigFileSubstitution,
     Defines,
+    DistFiles,
     DirectoryTraversal,
     Exports,
     GeneratedFile,
     GeneratedInclude,
     GeneratedSources,
     HostSources,
     IPDLFile,
     JARManifest,
@@ -806,10 +807,31 @@ class TestEmitterBasic(unittest.TestCase
             '.mm': ['objc1.mm', 'objc2.mm'],
             '.c': ['c1.c', 'c2.c'],
         }
         for suffix, files in expected.items():
             sources = suffix_map[suffix]
             self.assertEqual(sources.files, files)
             self.assertFalse(sources.have_unified_mapping)
 
+    def test_dist_files(self):
+        """Test that DIST_FILES works properly."""
+        reader = self.reader('dist-files')
+        objs = self.read_topsrcdir(reader)
+
+        self.assertEqual(len(objs), 1)
+        self.assertIsInstance(objs[0], DistFiles)
+
+        self.assertEqual(len(objs[0].files), 2)
+
+        expected = {'install.rdf', 'main.js'}
+        for f in objs[0].files:
+            self.assertTrue(f in expected)
+
+    def test_missing_dist_files(self):
+        """Test that DIST_FILES with missing files throws errors."""
+        with self.assertRaisesRegexp(SandboxValidationError, 'File listed in '
+            'DIST_FILES does not exist'):
+            reader = self.reader('dist-files-missing')
+            self.read_topsrcdir(reader)
+
 if __name__ == '__main__':
     main()
--- a/testing/mochitest/Makefile.in
+++ b/testing/mochitest/Makefile.in
@@ -1,16 +1,15 @@
 #
 # 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/.
 
 NO_JS_MANIFEST = 1
 MOZ_CHROME_FILE_FORMAT = jar
-DIST_FILES = install.rdf
 
 # Used in install.rdf
 USE_EXTENSION_MANIFEST = 1
 
 _DEST_DIR = $(DEPTH)/_tests/$(relativesrcdir)
 
 include $(topsrcdir)/config/rules.mk
 # We're installing to _tests/testing/mochitest, so this is the depth
--- a/testing/mochitest/moz.build
+++ b/testing/mochitest/moz.build
@@ -13,16 +13,18 @@ DIRS += [
 
 if CONFIG['MOZ_BUILD_APP'] == 'mobile/android':
     DIRS += ['roboextender']
 
 XPI_NAME = 'mochijar'
 
 JAR_MANIFESTS += ['jar.mn']
 
+DIST_FILES += ['install.rdf']
+
 MOCHITEST_MANIFESTS += [
     'dynamic/mochitest.ini',
     'MochiKit/mochitest.ini',
     'static/mochitest.ini',
     'tests/MochiKit-1.4.2/MochiKit/mochitest.ini',
     'tests/MochiKit-1.4.2/tests/mochitest.ini',
 ]
 MOCHITEST_CHROME_MANIFESTS += ['chrome/chrome.ini']
--- a/testing/specialpowers/Makefile.in
+++ b/testing/specialpowers/Makefile.in
@@ -1,18 +1,15 @@
 #
 # 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/.
 
 NO_JS_MANIFEST = 1
 MOZ_CHROME_FILE_FORMAT = flat
-DIST_FILES = \
-  install.rdf \
-  $(NULL)
 
 # Used in install.rdf
 USE_EXTENSION_MANIFEST=1
 
 TEST_EXTENSIONS_DIR = $(DEPTH)/testing/specialpowers
 
 include $(topsrcdir)/config/rules.mk
 
--- a/testing/specialpowers/moz.build
+++ b/testing/specialpowers/moz.build
@@ -5,9 +5,11 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 EXTRA_COMPONENTS += [
     'components/SpecialPowersObserver.js',
 ]
 
 XPI_NAME = 'specialpowers'
 
-JAR_MANIFESTS += ['jar.mn']
\ No newline at end of file
+JAR_MANIFESTS += ['jar.mn']
+
+DIST_FILES += ['install.rdf']
--- a/tools/quitter/Makefile.in
+++ b/tools/quitter/Makefile.in
@@ -1,15 +1,10 @@
 #
 # 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/.
 
 XPI_PKGNAME = quitter@mozilla.org
 NO_JS_MANIFEST = 1
 
-DIST_FILES = \
-  install.rdf \
-  chrome.manifest \
-  $(NULL)
-
 # Used in install.rdf
 USE_EXTENSION_MANIFEST=1
--- a/tools/quitter/moz.build
+++ b/tools/quitter/moz.build
@@ -5,9 +5,14 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 EXTRA_COMPONENTS += [
     'QuitterObserver.js',
 ]
 
 XPI_NAME = 'quitter'
 
-JAR_MANIFESTS += ['jar.mn']
\ No newline at end of file
+JAR_MANIFESTS += ['jar.mn']
+
+DIST_FILES += [
+    'chrome.manifest',
+    'install.rdf',
+]
--- a/xulrunner/examples/simple/Makefile.in
+++ b/xulrunner/examples/simple/Makefile.in
@@ -1,15 +1,13 @@
 # vim:set ts=8 sw=8 sts=8 noet:
 # 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/.
 
-DIST_FILES	= application.ini
-
 ifneq (,$(filter windows,$(MOZ_WIDGET_TOOLKIT)))
 ICONS		= icons/simple.ico
 endif
 
 include $(topsrcdir)/config/rules.mk
 
 ifneq (,$(ICONS))
 libs:: $(ICONS)
--- a/xulrunner/examples/simple/moz.build
+++ b/xulrunner/examples/simple/moz.build
@@ -9,8 +9,11 @@ DIRS += ['components']
 XPI_NAME = 'simple'
 
 JAR_MANIFESTS += ['jar.mn']
 
 JS_PREFERENCE_FILES += [
     'simple-prefs.js',
 ]
 
+DIST_FILES += [
+    'application.ini',
+]