Bug 968856 - Move unconditional LOCAL_INCLUDES into moz.build; r=mshal
authorMs2ger <ms2ger@gmail.com>
Sat, 15 Feb 2014 21:24:59 +0100
changeset 175526 20d7a9037429b138123195e3e994a7ebbbf59459
parent 175516 509cfc636986025dbcdaaa14b3a623ea5690c331
child 175527 3a37d3be57fa1b014c8ed72ac2cdcb84f9c02f1e
push idunknown
push userunknown
push dateunknown
reviewersmshal
bugs968856
milestone30.0a1
Bug 968856 - Move unconditional LOCAL_INCLUDES into moz.build; r=mshal
extensions/spellcheck/hunspell/src/Makefile.in
extensions/spellcheck/hunspell/src/moz.build
ipc/ipdl/test/cxx/app/Makefile.in
ipc/ipdl/test/cxx/app/moz.build
ipc/testshell/Makefile.in
ipc/testshell/moz.build
media/mtransport/test/Makefile.in
media/mtransport/test/moz.build
memory/mozjemalloc/Makefile.in
memory/mozjemalloc/moz.build
modules/libmar/sign/Makefile.in
modules/libmar/sign/moz.build
modules/libmar/verify/Makefile.in
modules/libmar/verify/moz.build
other-licenses/bsdiff/Makefile.in
other-licenses/bsdiff/moz.build
profile/dirserviceprovider/standalone/Makefile.in
profile/dirserviceprovider/standalone/moz.build
security/manager/ssl/tests/gtest/Makefile.in
security/manager/ssl/tests/gtest/moz.build
security/manager/ssl/tests/unit/tlsserver/cmd/Makefile.in
security/manager/ssl/tests/unit/tlsserver/cmd/moz.build
security/sandbox/win/src/sandboxbroker/Makefile.in
security/sandbox/win/src/sandboxbroker/moz.build
testing/gtest/Makefile.in
testing/gtest/moz.build
toolkit/components/alerts/Makefile.in
toolkit/components/ctypes/tests/Makefile.in
toolkit/components/ctypes/tests/moz.build
toolkit/components/downloads/Makefile.in
toolkit/components/downloads/moz.build
toolkit/components/maintenanceservice/Makefile.in
toolkit/components/maintenanceservice/moz.build
toolkit/components/telemetry/Makefile.in
toolkit/components/telemetry/moz.build
toolkit/crashreporter/Makefile.in
toolkit/crashreporter/client/Makefile.in
toolkit/crashreporter/client/moz.build
toolkit/crashreporter/google-breakpad/src/client/Makefile.in
toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/Makefile.in
toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/moz.build
toolkit/crashreporter/google-breakpad/src/client/linux/handler/Makefile.in
toolkit/crashreporter/google-breakpad/src/client/linux/handler/moz.build
toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/Makefile.in
toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/moz.build
toolkit/crashreporter/google-breakpad/src/client/mac/handler/Makefile.in
toolkit/crashreporter/google-breakpad/src/client/mac/handler/moz.build
toolkit/crashreporter/google-breakpad/src/client/moz.build
toolkit/crashreporter/google-breakpad/src/client/solaris/handler/Makefile.in
toolkit/crashreporter/google-breakpad/src/client/solaris/handler/moz.build
toolkit/crashreporter/google-breakpad/src/common/Makefile.in
toolkit/crashreporter/google-breakpad/src/common/linux/Makefile.in
toolkit/crashreporter/google-breakpad/src/common/linux/moz.build
toolkit/crashreporter/google-breakpad/src/common/mac/Makefile.in
toolkit/crashreporter/google-breakpad/src/common/mac/moz.build
toolkit/crashreporter/google-breakpad/src/common/moz.build
toolkit/crashreporter/google-breakpad/src/common/solaris/Makefile.in
toolkit/crashreporter/google-breakpad/src/common/solaris/moz.build
toolkit/crashreporter/google-breakpad/src/processor/Makefile.in
toolkit/crashreporter/google-breakpad/src/processor/moz.build
toolkit/crashreporter/google-breakpad/src/tools/linux/dump_syms/Makefile.in
toolkit/crashreporter/google-breakpad/src/tools/linux/dump_syms/moz.build
toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/Makefile.in
toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/moz.build
toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/Makefile.in
toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/moz.build
toolkit/crashreporter/injector/Makefile.in
toolkit/crashreporter/injector/moz.build
toolkit/crashreporter/moz.build
toolkit/crashreporter/test/Makefile.in
toolkit/crashreporter/test/moz.build
toolkit/mozapps/update/updater/Makefile.in
toolkit/mozapps/update/updater/moz.build
toolkit/system/gnome/Makefile.in
toolkit/system/gnome/moz.build
toolkit/xre/Makefile.in
toolkit/xre/moz.build
toolkit/xre/test/win/Makefile.in
toolkit/xre/test/win/moz.build
uriloader/exthandler/Makefile.in
uriloader/exthandler/moz.build
uriloader/prefetch/Makefile.in
uriloader/prefetch/moz.build
xulrunner/app/Makefile.in
xulrunner/app/moz.build
xulrunner/stub/Makefile.in
xulrunner/stub/moz.build
--- a/extensions/spellcheck/hunspell/src/Makefile.in
+++ b/extensions/spellcheck/hunspell/src/Makefile.in
@@ -5,11 +5,8 @@
 include $(topsrcdir)/config/rules.mk
 
 ifdef MOZ_NATIVE_HUNSPELL
 # MOZ_HUNSPELL_CFLAGS is extracted through pkgconfig during configure,
 # even though the variable doesn't show up in configure.in.
 CXXFLAGS += $(MOZ_HUNSPELL_CFLAGS)
 endif
 
-LOCAL_INCLUDES += \
-	-I$(topsrcdir)/editor/libeditor/base \
-	$(NULL)
--- a/extensions/spellcheck/hunspell/src/moz.build
+++ b/extensions/spellcheck/hunspell/src/moz.build
@@ -28,8 +28,12 @@ if not CONFIG['MOZ_NATIVE_HUNSPELL']:
     DEFINES['HUNSPELL_STATIC'] = True
 
 FINAL_LIBRARY = 'spellchecker'
 
 LOCAL_INCLUDES += [
     '/extensions/spellcheck/src',
 ]
 
+LOCAL_INCLUDES += [
+    '/editor/libeditor/base',
+]
+
--- a/ipc/ipdl/test/cxx/app/Makefile.in
+++ b/ipc/ipdl/test/cxx/app/Makefile.in
@@ -1,17 +1,14 @@
 # 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/.
 
 NSDISTMODE = copy
 
-LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
-LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/base
-
 LIBS = \
   $(DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \
   $(LIBXUL_LIBS) \
   $(NSPR_LIBS) \
   $(NULL)
 
 include $(topsrcdir)/config/config.mk
 
--- a/ipc/ipdl/test/cxx/app/moz.build
+++ b/ipc/ipdl/test/cxx/app/moz.build
@@ -6,8 +6,13 @@
 
 PROGRAM = 'ipdlunittest'
 
 SOURCES += [
     'TestIPDL.cpp',
 ]
 include('/ipc/chromium/chromium-config.mozbuild')
 
+LOCAL_INCLUDES += [
+    '/toolkit/xre',
+    '/xpcom/base',
+]
+
deleted file mode 100644
--- a/ipc/testshell/Makefile.in
+++ /dev/null
@@ -1,11 +0,0 @@
-# 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/.
-
-# For xpcshell error messages and nsDependentJSString
-LOCAL_INCLUDES += \
-  -I$(topsrcdir)/js/xpconnect/src \
-  -I$(topsrcdir)/dom/base \
-  $(NULL)
-
-include $(topsrcdir)/config/rules.mk
--- a/ipc/testshell/moz.build
+++ b/ipc/testshell/moz.build
@@ -25,8 +25,15 @@ IPDL_SOURCES = [
     'PTestShellCommand.ipdl',
 ]
 
 FAIL_ON_WARNINGS = True
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+# For xpcshell error messages and nsDependentJSString
+LOCAL_INCLUDES += [
+    '/dom/base',
+    '/js/xpconnect/src',
+]
+
--- a/media/mtransport/test/Makefile.in
+++ b/media/mtransport/test/Makefile.in
@@ -12,42 +12,16 @@ LIBS = \
   $(DEPTH)/media/mtransport/third_party/nrappkit/nrappkit_nrappkit/$(LIB_PREFIX)nrappkit.$(LIB_SUFFIX) \
   $(DEPTH)/media/webrtc/trunk/testing/gtest_gtest/$(LIB_PREFIX)gtest.$(LIB_SUFFIX) \
   $(NULL)
 
 ifdef MOZ_SCTP
 LIBS += $(DEPTH)/netwerk/sctp/src/$(LIB_PREFIX)nksctp_s.$(LIB_SUFFIX)
 endif
 
-LOCAL_INCLUDES += \
-  -I. \
-  -I$(topsrcdir)/media/webrtc/trunk/testing/gtest/include/ \
-  -I$(topsrcdir)/media/mtransport/ \
-  -I$(topsrcdir)/netwerk/sctp/src/ \
- $(NULL)
-
-LOCAL_INCLUDES += \
- -I. \
- -I$(topsrcdir)/media/mtransport/third_party/ \
- -I$(topsrcdir)/media/mtransport/third_party/ \
- -I$(topsrcdir)/media/mtransport/third_party/nICEr/src/crypto \
- -I$(topsrcdir)/media/mtransport/third_party/nICEr/src/ice \
- -I$(topsrcdir)/media/mtransport/third_party/nICEr/src/net \
- -I$(topsrcdir)/media/mtransport/third_party/nICEr/src/stun \
- -I$(topsrcdir)/media/mtransport/third_party/nICEr/src/util \
- -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/share \
- -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/util/ \
- -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/util/libekr \
- -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/log \
- -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/registry \
- -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/stats \
- -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/plugin \
- -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/event \
- $(NULL)
-
 ifneq (,$(filter Darwin DragonFly FreeBSD NetBSD OpenBSD,$(OS_TARGET)))
 LOCAL_INCLUDES +=  -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/darwin/include
 ifneq (,$(filter DragonFly FreeBSD NetBSD OpenBSD,$(OS_TARGET)))
 LOCAL_INCLUDES +=  -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/generic/include
 endif
 endif
 
 ifeq ($(OS_TARGET), Linux)
--- a/media/mtransport/test/moz.build
+++ b/media/mtransport/test/moz.build
@@ -35,8 +35,29 @@ if CONFIG['OS_TARGET'] != 'Android':
 if CONFIG['OS_TARGET'] == 'WINNT':
     DEFINES['__Userspace_os_Windows'] = 1
 else:
     # Works for Darwin, Linux, Android. Probably doesn't work for others.
     DEFINES['__Userspace_os_%s' % CONFIG['OS_TARGET']] = 1
 
 if CONFIG['OS_TARGET'] in ('Darwin', 'Android'):
     DEFINES['GTEST_USE_OWN_TR1_TUPLE'] = 1
+
+LOCAL_INCLUDES += [
+    '/media/mtransport/',
+    '/media/mtransport/third_party/',
+    '/media/mtransport/third_party/nICEr/src/crypto',
+    '/media/mtransport/third_party/nICEr/src/ice',
+    '/media/mtransport/third_party/nICEr/src/net',
+    '/media/mtransport/third_party/nICEr/src/stun',
+    '/media/mtransport/third_party/nICEr/src/util',
+    '/media/mtransport/third_party/nrappkit/src/event',
+    '/media/mtransport/third_party/nrappkit/src/log',
+    '/media/mtransport/third_party/nrappkit/src/plugin',
+    '/media/mtransport/third_party/nrappkit/src/registry',
+    '/media/mtransport/third_party/nrappkit/src/share',
+    '/media/mtransport/third_party/nrappkit/src/stats',
+    '/media/mtransport/third_party/nrappkit/src/util/',
+    '/media/mtransport/third_party/nrappkit/src/util/libekr',
+    '/media/webrtc/trunk/testing/gtest/include/',
+    '/netwerk/sctp/src/',
+]
+
--- a/memory/mozjemalloc/Makefile.in
+++ b/memory/mozjemalloc/Makefile.in
@@ -6,9 +6,8 @@
 ifndef MOZ_JEMALLOC3
 ifeq ($(OS_ARCH),SunOS)
 ifndef GNU_CC
 MODULE_OPTIMIZE_FLAGS = -xO5
 endif
 endif
 endif
 
-LOCAL_INCLUDES += -I$(topsrcdir)/memory/build
--- a/memory/mozjemalloc/moz.build
+++ b/memory/mozjemalloc/moz.build
@@ -26,8 +26,13 @@ if CONFIG['MOZ_REPLACE_MALLOC']:
     DEFINES['MOZ_REPLACE_MALLOC'] = True
 
 DEFINES['MOZ_JEMALLOC_IMPL'] = True
 
 #XXX: PGO on Linux causes problems here
 # See bug 419470
 if CONFIG['OS_TARGET'] == 'Linux':
     NO_PGO = True
+
+LOCAL_INCLUDES += [
+    '/memory/build',
+]
+
--- a/modules/libmar/sign/Makefile.in
+++ b/modules/libmar/sign/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/.
 
 # This makefile just builds support for reading archives.
-LOCAL_INCLUDES += -I$(srcdir)/../src \
-  -I$(srcdir)/../verify \
-  -I$(topsrcdir)/dist/include \
-  $(NULL)
-
 CFLAGS += -DMAR_NSS
 
 include $(topsrcdir)/config/rules.mk
 
 # The intermediate (.ii/.s) files for host and target can have the same name...
 # disable parallel builds
 .NOTPARALLEL:
--- a/modules/libmar/sign/moz.build
+++ b/modules/libmar/sign/moz.build
@@ -8,10 +8,16 @@ LIBRARY_NAME = 'signmar'
 
 UNIFIED_SOURCES += [
     'mar_sign.c',
     'nss_secutil.c',
 ]
 
 FORCE_STATIC_LIB = True
 
+LOCAL_INCLUDES += [
+    '../src',
+    '../verify',
+]
+
+
 if CONFIG['OS_ARCH'] == 'WINNT':
     USE_STATIC_LIBS = True
--- a/modules/libmar/verify/Makefile.in
+++ b/modules/libmar/verify/Makefile.in
@@ -1,15 +1,13 @@
 # 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/.
 
 # This makefile just builds support for reading archives.
-LOCAL_INCLUDES += -I$(srcdir)/../src
-
 ifneq ($(OS_ARCH),WINNT)
 LOCAL_INCLUDES += -I$(srcdir)/../sign
 endif
 
 include $(topsrcdir)/config/rules.mk
 
 # The intermediate (.ii/.s) files for host and target can have the same name...
 # disable parallel builds
--- a/modules/libmar/verify/moz.build
+++ b/modules/libmar/verify/moz.build
@@ -12,8 +12,13 @@ UNIFIED_SOURCES += [
 ]
 
 FORCE_STATIC_LIB = True
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     USE_STATIC_LIBS = True
 else:
     DEFINES['MAR_NSS'] = True
+
+LOCAL_INCLUDES += [
+    '../src',
+]
+
--- a/other-licenses/bsdiff/Makefile.in
+++ b/other-licenses/bsdiff/Makefile.in
@@ -30,13 +30,11 @@ HOST_LIBS += $(MOZ_BZ2_LIBS)
 else
 HOST_LIBS += $(DIST)/host/lib/$(LIB_PREFIX)hostbz2.$(LIB_SUFFIX)
 endif
 
 ifeq ($(HOST_OS_ARCH),WINNT)
 HOST_EXTRA_LIBS += $(call EXPAND_LIBNAME,Ws2_32)
 endif
 
-LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/mozapps/update/updater
-
 include $(topsrcdir)/config/rules.mk
 
 HOST_CXXFLAGS += $(MOZ_BZ2_CFLAGS)
--- a/other-licenses/bsdiff/moz.build
+++ b/other-licenses/bsdiff/moz.build
@@ -4,8 +4,13 @@
 # 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/.
 
 HOST_SOURCES += [
     'bsdiff.c',
 ]
 
 HOST_PROGRAM = 'mbsdiff'
+
+LOCAL_INCLUDES += [
+    '/toolkit/mozapps/update/updater',
+]
+
--- a/profile/dirserviceprovider/standalone/Makefile.in
+++ b/profile/dirserviceprovider/standalone/Makefile.in
@@ -1,9 +1,7 @@
 # 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/.
 
 include $(topsrcdir)/config/rules.mk
 
-LOCAL_INCLUDES = -I$(srcdir)/../src
-
 STL_FLAGS =
--- a/profile/dirserviceprovider/standalone/moz.build
+++ b/profile/dirserviceprovider/standalone/moz.build
@@ -8,8 +8,13 @@ include('../src/objs.mozbuild')
 
 UNIFIED_SOURCES += modules_profiledirservice_src_csrcs
 
 LIBRARY_NAME = 'profdirserviceprovidersa_s'
 
 FORCE_STATIC_LIB = True
 
 DEFINES['XPCOM_GLUE'] = 1
+
+LOCAL_INCLUDES += [
+    '../src',
+]
+
--- a/security/manager/ssl/tests/gtest/Makefile.in
+++ b/security/manager/ssl/tests/gtest/Makefile.in
@@ -3,13 +3,9 @@
 # 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/.
 
 include $(DEPTH)/config/autoconf.mk
 
 EXPORT_LIBRARY = 1
 
-LOCAL_INCLUDES = \
-  -I$(topsrcdir)/security/manager/ssl/src \
-  $(NULL)
-
 include $(topsrcdir)/config/rules.mk
--- a/security/manager/ssl/tests/gtest/moz.build
+++ b/security/manager/ssl/tests/gtest/moz.build
@@ -12,8 +12,13 @@ SOURCES += [
 	'TLSIntoleranceTest.cpp',
 ]
 
 LOCAL_INCLUDES += [
     '../../../../insanity/include',
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
+
+LOCAL_INCLUDES += [
+    '/security/manager/ssl/src',
+]
+
--- a/security/manager/ssl/tests/unit/tlsserver/cmd/Makefile.in
+++ b/security/manager/ssl/tests/unit/tlsserver/cmd/Makefile.in
@@ -10,11 +10,8 @@ LIBS = \
   $(NSPR_LIBS) \
   $(NSS_LIBS) \
   $(MOZALLOC_LIB) \
   ../lib/$(LIB_PREFIX)tlsserver.$(LIB_SUFFIX) \
   $(NULL)
 
 DEFINES += $(TK_CFLAGS)
 
-LOCAL_INCLUDES += \
-   -I$(srcdir)/../lib \
-   $(NULL)
--- a/security/manager/ssl/tests/unit/tlsserver/cmd/moz.build
+++ b/security/manager/ssl/tests/unit/tlsserver/cmd/moz.build
@@ -10,8 +10,13 @@ SIMPLE_PROGRAMS = [
     'BadCertServer',
     'GenerateOCSPResponse',
     'OCSPStaplingServer',
 ]
 
 SOURCES += [
     '%s.cpp' % s for s in SIMPLE_PROGRAMS
 ]
+
+LOCAL_INCLUDES += [
+    '../lib',
+]
+
--- a/security/sandbox/win/src/sandboxbroker/Makefile.in
+++ b/security/sandbox/win/src/sandboxbroker/Makefile.in
@@ -1,19 +1,13 @@
 # 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/.
 #
 MOZ_GLUE_LDFLAGS =
 STL_FLAGS =
 
-LOCAL_INCLUDES += \
-    -I$(topsrcdir)/security \
-    -I$(topsrcdir)/security/sandbox \
-    -I$(topsrcdir)/security/sandbox/chromium \
-    $(NULL)
-
 SHARED_LIBRARY_LIBS += \
 	../../../$(LIB_PREFIX)sandbox_s.$(LIB_SUFFIX) \
 	$(NSPR_LIBS) \
 	$(NULL)
 
 OS_LIBS += $(call EXPAND_LIBNAME,dbghelp)
--- a/security/sandbox/win/src/sandboxbroker/moz.build
+++ b/security/sandbox/win/src/sandboxbroker/moz.build
@@ -15,8 +15,15 @@ EXPORTS += [
     'sandboxBroker.h',
 ]
 
 FORCE_SHARED_LIB = True
 
 for var in ('UNICODE', '_UNICODE', 'NS_NO_XPCOM', 'NOMINMAX',
             'SANDBOX_EXPORTS'):
     DEFINES[var] = True
+
+LOCAL_INCLUDES += [
+    '/security',
+    '/security/sandbox',
+    '/security/sandbox/chromium',
+]
+
--- a/testing/gtest/Makefile.in
+++ b/testing/gtest/Makefile.in
@@ -1,22 +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/.
 
 # Avoid recursive make to avoid having to add files to the gtest/ subdirectory
 # (which is third-party code), and to make the build faster.
 
-LOCAL_INCLUDES += \
-  -I$(srcdir)/gtest \
-  -I$(srcdir)/gtest/include \
-  -I$(srcdir)/gmock \
-  -I$(srcdir)/gmock/include \
-  $(NULL)
-
 include $(topsrcdir)/config/rules.mk
 
 ifeq (browser,$(MOZ_BUILD_APP))
 # Disable because of metro linking error bug 883339:
 # LNK1181: cannot open input file 'runtimeobject.lib'
 # And non metro linking error bug 886656:
 # LNK1112: module machine type 'x64' conflicts with target machine type 'X86'
 ifneq ($(OS_ARCH),WINNT)
--- a/testing/gtest/moz.build
+++ b/testing/gtest/moz.build
@@ -62,8 +62,15 @@ LIBRARY_NAME = 'gtest'
 SOURCES += [
     'mozilla/SanityTest.cpp',
 ]
 
 LIBXUL_LIBRARY = True
 
 EXPORT_LIBRARY = True
 
+LOCAL_INCLUDES += [
+    'gmock',
+    'gmock/include',
+    'gtest',
+    'gtest/include',
+]
+
deleted file mode 100644
--- a/toolkit/components/alerts/Makefile.in
+++ /dev/null
@@ -1,7 +0,0 @@
-# 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/.
-
-LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/components/build/
-
-include $(topsrcdir)/config/rules.mk
--- a/toolkit/components/ctypes/tests/Makefile.in
+++ b/toolkit/components/ctypes/tests/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/.
 
-LOCAL_INCLUDES = \
-    -I$(topsrcdir)/js/src/ctypes \
-    $(NULL)
-
 EXTRA_DSO_LDOPTS += $(MOZALLOC_LIB)
 
 xpctestdir = $(testxpcobjdir)/$(relativesrcdir)/unit
 
 chrometestdir = \
   $(DEPTH)/_tests/testing/mochitest/chrome/toolkit/components/$(relativesrcdir)
 
 # should be MOCHITEST_CHROME_FILES, see bug 770938
--- a/toolkit/components/ctypes/tests/moz.build
+++ b/toolkit/components/ctypes/tests/moz.build
@@ -11,8 +11,13 @@ UNIFIED_SOURCES += [
     'jsctypes-test-errno.cpp',
     'jsctypes-test-finalizer.cpp',
     'jsctypes-test.cpp',
 ]
 
 LIBRARY_NAME = 'jsctypes-test'
 
 FORCE_SHARED_LIB = True
+
+LOCAL_INCLUDES += [
+    '/js/src/ctypes',
+]
+
--- a/toolkit/components/downloads/Makefile.in
+++ b/toolkit/components/downloads/Makefile.in
@@ -2,11 +2,8 @@
 # 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/.
 
 include $(topsrcdir)/config/rules.mk
 
 CXXFLAGS += $(TK_CFLAGS) -DGOOGLE_PROTOBUF_NO_RTTI
 
-LOCAL_INCLUDES += \
-  -I$(srcdir)/../protobuf \
-  $(NULL)
--- a/toolkit/components/downloads/moz.build
+++ b/toolkit/components/downloads/moz.build
@@ -47,8 +47,13 @@ if not CONFIG['MOZ_SUITE']:
     EXTRA_COMPONENTS += [
         'nsDownloadManagerUI.js',
         'nsDownloadManagerUI.manifest',
     ]
 
 FAIL_ON_WARNINGS = True
 
 FINAL_LIBRARY = 'toolkitcomps'
+
+LOCAL_INCLUDES += [
+    '../protobuf',
+]
+
--- a/toolkit/components/maintenanceservice/Makefile.in
+++ b/toolkit/components/maintenanceservice/Makefile.in
@@ -33,13 +33,8 @@ MOZ_WINCONSOLE = 0
 endif
 endif
 
 include $(topsrcdir)/config/rules.mk
 
 ifdef _MSC_VER
 WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
 endif
-
-# Pick up nsWindowsRestart.cpp
-LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre \
-  -I$(topsrcdir)/toolkit/mozapps/update/common \
-  $(NULL)
--- a/toolkit/components/maintenanceservice/moz.build
+++ b/toolkit/components/maintenanceservice/moz.build
@@ -17,9 +17,16 @@ SOURCES += [
 
 # For debugging purposes only
 #DEFINES['DISABLE_UPDATER_AUTHENTICODE_CHECK'] = True
 
 DEFINES['UNICODE'] = True
 DEFINES['_UNICODE'] = True
 DEFINES['NS_NO_XPCOM'] = True
 
+# Pick up nsWindowsRestart.cpp
+LOCAL_INCLUDES += [
+    '/toolkit/mozapps/update/common',
+    '/toolkit/xre',
+]
+
+
 USE_STATIC_LIBS = True
--- a/toolkit/components/telemetry/Makefile.in
+++ b/toolkit/components/telemetry/Makefile.in
@@ -1,19 +1,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/rcs.mk
 
-LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/build
-LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/threads
-
 DEFINES += -DMOZ_APP_VERSION='"$(MOZ_APP_VERSION)"'
 
 MOZ_HISTOGRAMS_VERSION ?= $(call getSourceRepo)/rev/$(firstword $(shell hg -R $(topsrcdir) parent --template='{node|short}\n' 2>/dev/null))
 ifdef MOZ_HISTOGRAMS_VERSION
 DEFINES += -DHISTOGRAMS_FILE_VERSION='$(MOZ_HISTOGRAMS_VERSION)'
 endif
 
 INSTALL_TARGETS += histoenums
--- a/toolkit/components/telemetry/moz.build
+++ b/toolkit/components/telemetry/moz.build
@@ -47,8 +47,14 @@ include('/ipc/chromium/chromium-config.m
 FINAL_LIBRARY = 'xul'
 
 GENERATED_FILES = [
     'TelemetryHistogramData.inc',
 ]
 
 if CONFIG['MOZILLA_OFFICIAL']:
     DEFINES['MOZILLA_OFFICIAL'] = True
+
+LOCAL_INCLUDES += [
+    '/xpcom/build',
+    '/xpcom/threads',
+]
+
--- a/toolkit/crashreporter/Makefile.in
+++ b/toolkit/crashreporter/Makefile.in
@@ -4,14 +4,12 @@
 
 ifeq ($(OS_TARGET),Android)
 # NDK5 workarounds
 TARGET_LOCAL_INCLUDES = \
   -I$(topsrcdir)/toolkit/crashreporter/google-breakpad/src/common/android/include/ \
   $(NULL)
 endif
 
-LOCAL_INCLUDES += -I$(srcdir)/google-breakpad/src
-
 include $(topsrcdir)/config/rules.mk
 
 check::
 	$(PYTHON) $(srcdir)/tools/unit-symbolstore.py
--- a/toolkit/crashreporter/client/Makefile.in
+++ b/toolkit/crashreporter/client/Makefile.in
@@ -10,18 +10,16 @@ STL_FLAGS =
 ifneq ($(OS_TARGET),Android)
 DIST_PROGRAM = crashreporter$(BIN_SUFFIX)
 
 # Don't link the updater against libmozglue.
 MOZ_GLUE_LDFLAGS =
 MOZ_GLUE_PROGRAM_LDFLAGS =
 endif
 
-LOCAL_INCLUDES = -I$(srcdir)/../google-breakpad/src
-
 ifeq ($(OS_ARCH),WINNT)
 LIBS += \
   $(DEPTH)/toolkit/crashreporter/breakpad-windows-libxul/$(LIB_PREFIX)google_breakpad_libxul_s.$(LIB_SUFFIX)
   $(NULL)
 LOCAL_INCLUDES += -I$(srcdir)
 RCINCLUDE = crashreporter.rc
 OS_LIBS += $(call EXPAND_LIBNAME,comctl32 shell32 wininet shlwapi)
 MOZ_WINCONSOLE = 0
--- a/toolkit/crashreporter/client/moz.build
+++ b/toolkit/crashreporter/client/moz.build
@@ -34,8 +34,13 @@ if CONFIG['MOZ_ENABLE_GTK']:
         'crashreporter_linux.cpp',
         'crashreporter_unix_common.cpp'
         ]
 
 if CONFIG['OS_ARCH'] == 'Darwin':
     UNIFIED_SOURCES += [
         'crashreporter_osx.mm',
     ]
+
+LOCAL_INCLUDES += [
+    '../google-breakpad/src',
+]
+
deleted file mode 100644
--- a/toolkit/crashreporter/google-breakpad/src/client/Makefile.in
+++ /dev/null
@@ -1,5 +0,0 @@
-# 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/.
-
-LOCAL_INCLUDES 	= -I$(srcdir)/..
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/Makefile.in
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/Makefile.in
@@ -1,13 +1,9 @@
 # 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/.
 
-LOCAL_INCLUDES = \
-  -I$(topsrcdir)/toolkit/crashreporter/google-breakpad/src \
-  $(NULL)
-
 include $(topsrcdir)/config/rules.mk
 
 ifeq ($(OS_TARGET),Android)
 LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/crashreporter/google-breakpad/src/common/android/include/
 endif
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/crash_generation/moz.build
@@ -5,8 +5,13 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 UNIFIED_SOURCES += [
     'crash_generation_client.cc',
     'crash_generation_server.cc',
 ]
 
 FINAL_LIBRARY = 'xulapp_s'
+
+LOCAL_INCLUDES += [
+    '/toolkit/crashreporter/google-breakpad/src',
+]
+
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/Makefile.in
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/Makefile.in
@@ -11,16 +11,12 @@ ifdef MOZ_THUMB2 #{
 # as a clobbered register yet gcc error's.  The generated assembly for
 # sys_clone() looks OK, so we chalk this up to a gcc/gas quirk and
 # work around it by telling gcc that the THUMB frame pointer is a
 # vanilla callee-save register.
 OS_CXXFLAGS += -fomit-frame-pointer
 MOZ_FRAMEPTR_FLAGS := -fomit-frame-pointer
 endif #}
 
-LOCAL_INCLUDES = \
-  -I$(topsrcdir)/toolkit/crashreporter/google-breakpad/src \
-  $(NULL)
-
 ifeq ($(OS_TARGET),Android)
 # NDK5 workarounds
 LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/crashreporter/google-breakpad/src/common/android/include/
 endif
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/handler/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/handler/moz.build
@@ -13,8 +13,13 @@ UNIFIED_SOURCES += [
 XPI_NAME = 'crashreporter'
 
 FINAL_LIBRARY = 'xulapp_s'
 
 if CONFIG['OS_TARGET'] == 'Android':
     # NDK5 workarounds
     DEFINES['_STLP_CONST_CONSTRUCTOR_BUG'] = True
     DEFINES['_STLP_NO_MEMBER_TEMPLATES'] = True
+
+LOCAL_INCLUDES += [
+    '/toolkit/crashreporter/google-breakpad/src',
+]
+
deleted file mode 100644
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/Makefile.in
+++ /dev/null
@@ -1,5 +0,0 @@
-# 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/.
-
-LOCAL_INCLUDES 	= -I$(srcdir)/../../..
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/client/mac/crash_generation/moz.build
@@ -7,8 +7,13 @@
 UNIFIED_SOURCES += [
     'crash_generation_client.cc',
     'crash_generation_server.cc',
 ]
 
 XPI_NAME = 'crashreporter'
 
 FINAL_LIBRARY = 'xulapp_s'
+
+LOCAL_INCLUDES += [
+    '../../..',
+]
+
deleted file mode 100644
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/Makefile.in
+++ /dev/null
@@ -1,5 +0,0 @@
-# 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/.
-
-LOCAL_INCLUDES 	= -I$(srcdir)/../../..
--- a/toolkit/crashreporter/google-breakpad/src/client/mac/handler/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/client/mac/handler/moz.build
@@ -9,8 +9,13 @@ UNIFIED_SOURCES += [
     'dynamic_images.cc',
     'exception_handler.cc',
     'minidump_generator.cc',
 ]
 
 XPI_NAME = 'crashreporter'
 
 FINAL_LIBRARY = 'xulapp_s'
+
+LOCAL_INCLUDES += [
+    '../../..',
+]
+
--- a/toolkit/crashreporter/google-breakpad/src/client/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/client/moz.build
@@ -6,8 +6,13 @@
 
 SOURCES += [
     'minidump_file_writer.cc',
 ]
 
 XPI_NAME = 'crashreporter'
 
 FINAL_LIBRARY = 'xulapp_s'
+
+LOCAL_INCLUDES += [
+    '..',
+]
+
deleted file mode 100644
--- a/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/Makefile.in
+++ /dev/null
@@ -1,5 +0,0 @@
-# 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/.
-
-LOCAL_INCLUDES 	= -I$(srcdir)/../../..
--- a/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/client/solaris/handler/moz.build
@@ -8,8 +8,13 @@ SOURCES += [
     'exception_handler.cc',
     'minidump_generator.cc',
     'solaris_lwp.cc',
 ]
 
 XPI_NAME = 'crashreporter'
 
 FINAL_LIBRARY = 'xulapp_s'
+
+LOCAL_INCLUDES += [
+    '../../..',
+]
+
--- a/toolkit/crashreporter/google-breakpad/src/common/Makefile.in
+++ b/toolkit/crashreporter/google-breakpad/src/common/Makefile.in
@@ -2,18 +2,16 @@
 # 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/.
 
 ifneq (WINNT,$(OS_TARGET))
 ifdef MOZ_CRASHREPORTER
 endif
 endif
 
-LOCAL_INCLUDES 	= -I$(srcdir)/..
-
 ifeq ($(OS_TARGET),Android)
 TARGET_LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/crashreporter/google-breakpad/src/common/android/include/
 endif
 
 # This kind of sucks.
 ifeq (Linux,$(OS_ARCH))
 HOST_CXXFLAGS += -DHAVE_A_OUT_H
 OS_CXXFLAGS += -DHAVE_A_OUT_H
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/Makefile.in
+++ b/toolkit/crashreporter/google-breakpad/src/common/linux/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/.
 
-LOCAL_INCLUDES = \
-  -I$(topsrcdir)/toolkit/crashreporter/google-breakpad/src \
-  $(NULL)
-
 ifneq (Android,$(OS_TARGET))
 else
 TARGET_LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/crashreporter/google-breakpad/src/common/android/include/
 endif
 
 include $(topsrcdir)/config/rules.mk
 
 # See https://bugzilla.mozilla.org/show_bug.cgi?id=741348#c11
--- a/toolkit/crashreporter/google-breakpad/src/common/linux/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/common/linux/moz.build
@@ -37,8 +37,13 @@ if CONFIG['MOZ_CRASHREPORTER']:
 LIBRARY_NAME = 'breakpad_linux_common_s'
 
 FINAL_LIBRARY = 'xulapp_s'
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
     DEFINES['ELFSIZE'] = 32
 
 DEFINES['NO_STABS_SUPPORT'] = True
+
+LOCAL_INCLUDES += [
+    '/toolkit/crashreporter/google-breakpad/src',
+]
+
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/Makefile.in
+++ b/toolkit/crashreporter/google-breakpad/src/common/mac/Makefile.in
@@ -1,9 +1,7 @@
 # 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/.
 
-LOCAL_INCLUDES 	= -I$(srcdir)/../..
-
 include $(topsrcdir)/config/rules.mk
 
 COMPILE_CMFLAGS += -std=c99
--- a/toolkit/crashreporter/google-breakpad/src/common/mac/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/common/mac/moz.build
@@ -28,8 +28,13 @@ if CONFIG['MOZ_CRASHREPORTER']:
 SOURCES += [
     'HTTPMultipartUpload.m',
     'MachIPC.mm',
 ]
 
 LIBRARY_NAME = 'breakpad_mac_common_s'
 
 FINAL_LIBRARY = 'xulapp_s'
+
+LOCAL_INCLUDES += [
+    '../..',
+]
+
--- a/toolkit/crashreporter/google-breakpad/src/common/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/common/moz.build
@@ -82,8 +82,13 @@ MSVC_ENABLE_PGO = True
 
 FINAL_LIBRARY = 'xulapp_s'
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
     DEFINES['ELFSIZE'] = 32
 
 if CONFIG['OS_TARGET'] == 'Android':
     DEFINES['NO_STABS_SUPPORT'] = True
+
+LOCAL_INCLUDES += [
+    '..',
+]
+
deleted file mode 100644
--- a/toolkit/crashreporter/google-breakpad/src/common/solaris/Makefile.in
+++ /dev/null
@@ -1,5 +0,0 @@
-# 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/.
-
-LOCAL_INCLUDES 	= -I$(srcdir)/../..
--- a/toolkit/crashreporter/google-breakpad/src/common/solaris/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/common/solaris/moz.build
@@ -18,8 +18,13 @@ LIBRARY_NAME = 'breakpad_solaris_common_
 # since it depends on libcurl
 HOST_SOURCES += [
     'dump_symbols.cc',
     'file_id.cc',
     'guid_creator.cc',
 ]
 
 FINAL_LIBRARY = 'xulapp_s'
+
+LOCAL_INCLUDES += [
+    '../..',
+]
+
deleted file mode 100644
--- a/toolkit/crashreporter/google-breakpad/src/processor/Makefile.in
+++ /dev/null
@@ -1,5 +0,0 @@
-# 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/.
-
-LOCAL_INCLUDES 	= -I$(srcdir)/../.. -I$(srcdir)/..
--- a/toolkit/crashreporter/google-breakpad/src/processor/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/processor/moz.build
@@ -17,8 +17,14 @@ UNIFIED_SOURCES += [
     'stackwalker_arm.cc',
     'stackwalker_ppc.cc',
     'stackwalker_sparc.cc',
     'stackwalker_x86.cc',
     'tokenize.cc',
 ]
 
 FINAL_LIBRARY = 'xulapp_s'
+
+LOCAL_INCLUDES += [
+    '..',
+    '../..',
+]
+
--- a/toolkit/crashreporter/google-breakpad/src/tools/linux/dump_syms/Makefile.in
+++ b/toolkit/crashreporter/google-breakpad/src/tools/linux/dump_syms/Makefile.in
@@ -1,14 +1,9 @@
 # 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/.
 
-LOCAL_INCLUDES 	= \
-  -I$(srcdir)/../../.. \
-  -I$(srcdir)/../../../common/linux \
-  $(NULL)
-
 HOST_LIBS += \
   $(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/linux/$(LIB_PREFIX)host_breakpad_linux_common_s.$(LIB_SUFFIX) \
   $(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/$(LIB_PREFIX)host_breakpad_common_s.$(LIB_SUFFIX) \
   $(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/dwarf/$(LIB_PREFIX)host_breakpad_dwarf_s.$(LIB_SUFFIX) \
   $(NULL)
--- a/toolkit/crashreporter/google-breakpad/src/tools/linux/dump_syms/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/tools/linux/dump_syms/moz.build
@@ -4,8 +4,14 @@
 # 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/.
 
 HOST_SOURCES += [
     'dump_syms.cc',
 ]
 
 HOST_PROGRAM = 'dump_syms'
+
+LOCAL_INCLUDES += [
+    '../../..',
+    '../../../common/linux',
+]
+
--- a/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/Makefile.in
+++ b/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/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/.
 
-LOCAL_INCLUDES 	= \
-  -I$(srcdir)/../../.. \
-  -I$(srcdir)/../../../common/mac \
-  $(NULL)
-
 HOST_LIBS += \
   $(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/dwarf/$(LIB_PREFIX)host_breakpad_dwarf_s.$(LIB_SUFFIX) \
   $(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/mac/$(LIB_PREFIX)host_breakpad_mac_common_s.$(LIB_SUFFIX) \
   $(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/$(LIB_PREFIX)host_breakpad_common_s.$(LIB_SUFFIX) \
   $(NULL)
 
 HOST_LDFLAGS += \
   -framework Foundation \
--- a/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/tools/mac/dump_syms/moz.build
@@ -5,8 +5,13 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 HOST_SOURCES += [
     'dump_syms_tool.mm',
 ]
 
 HOST_PROGRAM = 'dump_syms'
 
+LOCAL_INCLUDES += [
+    '../../..',
+    '../../../common/mac',
+]
+
--- a/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/Makefile.in
+++ b/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/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/.
 
-LOCAL_INCLUDES 	= \
-  -I$(srcdir)/../../.. \
-  -I$(srcdir)/../../../common/solaris \
-  $(NULL)
-
 HOST_LIBS += \
   $(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/solaris/$(LIB_PREFIX)host_breakpad_solaris_common_s.$(LIB_SUFFIX) \
   $(DEPTH)/toolkit/crashreporter/google-breakpad/src/common/$(LIB_PREFIX)host_breakpad_common_s.$(LIB_SUFFIX) \
   $(NULL)
 
 HOST_LDFLAGS += -lelf -ldemangle
--- a/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/tools/solaris/dump_syms/moz.build
@@ -4,8 +4,14 @@
 # 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/.
 
 HOST_SOURCES += [
     'dump_syms.cc',
 ]
   
 HOST_PROGRAM = 'dump_syms'
+
+LOCAL_INCLUDES += [
+    '../../..',
+    '../../../common/solaris',
+]
+
--- a/toolkit/crashreporter/injector/Makefile.in
+++ b/toolkit/crashreporter/injector/Makefile.in
@@ -2,14 +2,13 @@
 # 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/.
 
 STL_FLAGS =
 MOZ_GLUE_LDFLAGS =
 
 include $(topsrcdir)/config/rules.mk
 
-LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/crashreporter/google-breakpad/src
 ifndef GNU_CC
 LDFLAGS += -ENTRY:DummyEntryPoint
 else
 LDFLAGS += -Wl,-e,_DummyEntryPoint@12
 endif
--- a/toolkit/crashreporter/injector/moz.build
+++ b/toolkit/crashreporter/injector/moz.build
@@ -9,9 +9,14 @@ SOURCES += [
 ]
 
 LIBRARY_NAME = 'breakpadinjector'
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FORCE_SHARED_LIB = True
 
+LOCAL_INCLUDES += [
+    '/toolkit/crashreporter/google-breakpad/src',
+]
+
+
 USE_STATIC_LIBS = True
--- a/toolkit/crashreporter/moz.build
+++ b/toolkit/crashreporter/moz.build
@@ -92,9 +92,14 @@ if CONFIG['OS_TARGET'] == 'Android':
 
 if CONFIG['OS_ARCH'] == 'SunOS':
     # there's no define for this normally
     DEFINES['XP_SOLARIS'] = True
 
 DEFINES['UNICODE'] = True
 DEFINES['_UNICODE'] = True
 
-JAR_MANIFESTS += ['jar.mn']
\ No newline at end of file
+JAR_MANIFESTS += ['jar.mn']
+
+LOCAL_INCLUDES += [
+    'google-breakpad/src',
+]
+
--- a/toolkit/crashreporter/test/Makefile.in
+++ b/toolkit/crashreporter/test/Makefile.in
@@ -1,16 +1,13 @@
 #
 # 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/.
 
-LOCAL_INCLUDES += \
-  -I$(srcdir)/../google-breakpad/src/ \
-  $(NULL)
 EXTRA_DSO_LDOPTS += $(LIBS_DIR) $(MOZ_COMPONENT_LIBS) $(XPCOM_GLUE_LDOPTS)
 
 UNIT_FILES = $(SHARED_LIBRARY) $(EXTRA_JS_MODULES)
 UNIT_DEST = $(DEPTH)/_tests/xpcshell/$(relativesrcdir)/unit/
 INSTALL_TARGETS += UNIT
 
 UNIT_IPC_FILES = $(UNIT_FILES)
 UNIT_IPC_DEST = $(DEPTH)/_tests/xpcshell/$(relativesrcdir)/unit_ipc/
--- a/toolkit/crashreporter/test/moz.build
+++ b/toolkit/crashreporter/test/moz.build
@@ -27,8 +27,13 @@ FORCE_SHARED_LIB = True
 
 DEFINES['SHARED_LIBRARY'] = '%s%s%s' % (
     CONFIG['DLL_PREFIX'],
     LIBRARY_NAME,
     CONFIG['DLL_SUFFIX']
 )
 
 DEFINES['NOMINMAX'] = True
+
+LOCAL_INCLUDES += [
+    '../google-breakpad/src/',
+]
+
--- a/toolkit/mozapps/update/updater/Makefile.in
+++ b/toolkit/mozapps/update/updater/Makefile.in
@@ -2,21 +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/.
 
 # Don't link the updater against libmozglue. See bug 687139
 MOZ_GLUE_LDFLAGS =
 MOZ_GLUE_PROGRAM_LDFLAGS =
 
-LOCAL_INCLUDES += \
-  -I$(srcdir)/../common \
-  -I$(topsrcdir)/xpcom/glue \
-  $(NULL)
-
 ifeq ($(OS_ARCH),WINNT)
 LIBS += $(call EXPAND_LIBNAME_PATH,updatecommon-standalone,../common-standalone)
 else
 LIBS += $(call EXPAND_LIBNAME_PATH,updatecommon,../common)
 endif
 
 LIBS += \
   $(call EXPAND_LIBNAME_PATH,mar,$(DEPTH)/modules/libmar/src) \
--- a/toolkit/mozapps/update/updater/moz.build
+++ b/toolkit/mozapps/update/updater/moz.build
@@ -49,13 +49,19 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'coco
         'launchchild_osx.mm',
         'progressui_osx.mm',
     ]
 
 DEFINES['NS_NO_XPCOM'] = True
 for var in ('MAR_CHANNEL_ID', 'MOZ_APP_VERSION'):
     DEFINES[var] = '"%s"' % CONFIG[var]
 
+LOCAL_INCLUDES += [
+    '../common',
+    '/xpcom/glue',
+]
+
+
 DELAYLOAD_DLLS += [
     'crypt32.dll',
     'userenv.dll',
     'wsock32.dll',
 ]
--- a/toolkit/system/gnome/Makefile.in
+++ b/toolkit/system/gnome/Makefile.in
@@ -8,18 +8,16 @@ EXTRA_DSO_LDOPTS += \
 		$(NSPR_LIBS) \
 		$(MOZ_GCONF_LIBS) \
 		$(MOZ_GNOMEVFS_LIBS) \
 		$(GLIB_LIBS) \
 		$(MOZ_GIO_LIBS) \
 		$(MOZ_DBUS_GLIB_LIBS) \
 		$(NULL)
 
-LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/components/build/
-
 include $(topsrcdir)/config/rules.mk
 
 CXXFLAGS += \
 	$(MOZ_GCONF_CFLAGS) \
 	$(MOZ_GNOMEVFS_CFLAGS) \
 	$(MOZ_GIO_CFLAGS) \
 	$(GLIB_CFLAGS) \
 	$(MOZ_DBUS_GLIB_CFLAGS) \
--- a/toolkit/system/gnome/moz.build
+++ b/toolkit/system/gnome/moz.build
@@ -25,8 +25,13 @@ if CONFIG['MOZ_ENABLE_GIO']:
     ]
 
 LIBRARY_NAME = 'mozgnome'
 
 FAIL_ON_WARNINGS = True
 IS_COMPONENT = True
 
 FORCE_SHARED_LIB = True
+
+LOCAL_INCLUDES += [
+    '/toolkit/components/build/',
+]
+
--- a/toolkit/xre/Makefile.in
+++ b/toolkit/xre/Makefile.in
@@ -11,26 +11,16 @@ include $(topsrcdir)/config/makefiles/ma
 milestone_txt = $(topsrcdir)/config/milestone.txt
 
 ifdef MOZ_ENABLE_XREMOTE
 LOCAL_INCLUDES += -I$(topsrcdir)/widget/xremoteclient
 endif
 
 include $(topsrcdir)/config/rules.mk
 
-LOCAL_INCLUDES += \
-  -I$(topsrcdir)/testing/gtest/mozilla \
-  -I$(srcdir)/../profile \
-  -I$(topsrcdir)/dom/ipc \
-  -I$(topsrcdir)/toolkit/crashreporter \
-  -I$(topsrcdir)/dom/base \
-  -I$(topsrcdir)/xpcom/build \
-  -I$(topsrcdir)/config \
-  $(NULL)
-
 CXXFLAGS += $(TK_CFLAGS) $(MOZ_DBUS_CFLAGS) $(MOZ_DBUS_GLIB_CFLAGS)
 
 ifdef MOZ_WIDGET_GTK
 CXXFLAGS += $(MOZ_PANGO_CFLAGS)
 endif
 
 # Should version be optional or required ?
 TOOLKIT_EM_VERSION=$(shell $(PERL) $(topsrcdir)/config/milestone.pl --topsrcdir=$(topsrcdir))
--- a/toolkit/xre/moz.build
+++ b/toolkit/xre/moz.build
@@ -138,8 +138,19 @@ if CONFIG['OS_ARCH'] == 'Linux' and 'lib
 
 DEFINES['GRE_MILESTONE'] = CONFIG['GRE_MILESTONE']
 
 for var in ('APP_VERSION', 'APP_ID'):
     DEFINES[var] = CONFIG['MOZ_%s' % var]
 
 if CONFIG['MOZILLA_OFFICIAL']:
     DEFINES['MOZILLA_OFFICIAL'] = True
+
+LOCAL_INCLUDES += [
+    '../profile',
+    '/config',
+    '/dom/base',
+    '/dom/ipc',
+    '/testing/gtest/mozilla',
+    '/toolkit/crashreporter',
+    '/xpcom/build',
+]
+
--- a/toolkit/xre/test/win/Makefile.in
+++ b/toolkit/xre/test/win/Makefile.in
@@ -1,20 +1,14 @@
 # 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/.
 
 OS_LIBS += $(call EXPAND_LIBNAME,comctl32 ws2_32 shell32)
 
-LOCAL_INCLUDES += \
-  -I$(srcdir) \
-  -I$(topsrcdir)/toolkit/xre \
-  -I$(topsrcdir)/config \
-  $(NULL)
-
 MOZ_WINCONSOLE = 1
 
 include $(topsrcdir)/config/rules.mk
 
 libs:: TestXREMakeCommandLineWin.ini
 	$(INSTALL) $^ $(FINAL_TARGET)/
 
 check::
--- a/toolkit/xre/test/win/moz.build
+++ b/toolkit/xre/test/win/moz.build
@@ -10,9 +10,15 @@ SIMPLE_PROGRAMS = [
 ]
 
 SOURCES += [
     '%s.cpp' % s for s in SIMPLE_PROGRAMS
 ]
 
 DEFINES['NS_NO_XPCOM'] = True
 
+LOCAL_INCLUDES += [
+    '/config',
+    '/toolkit/xre',
+]
+
+
 USE_STATIC_LIBS = True
--- a/uriloader/exthandler/Makefile.in
+++ b/uriloader/exthandler/Makefile.in
@@ -1,22 +1,13 @@
 #
 # 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/.
 
-LOCAL_INCLUDES = -I$(srcdir)
-
-LOCAL_INCLUDES += -I$(topsrcdir)/dom/base \
-            -I$(topsrcdir)/dom/events \
-            -I$(topsrcdir)/dom/ipc \
-            -I$(topsrcdir)/content/base/src \
-            -I$(topsrcdir)/netwerk/base/src \
-            -I$(topsrcdir)/netwerk/protocol/http
-
 ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
 LOCAL_INCLUDES += -I$(srcdir)/win
 endif
 
 ifdef MOZ_ENABLE_DBUS
 OS_INCLUDES   += $(TK_CFLAGS) $(MOZ_DBUS_CFLAGS)
 endif
 
--- a/uriloader/exthandler/moz.build
+++ b/uriloader/exthandler/moz.build
@@ -131,8 +131,18 @@ IPDL_SOURCES += [
     'PExternalHelperApp.ipdl',
 ]
 
 FAIL_ON_WARNINGS = True
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+LOCAL_INCLUDES += [
+    '/content/base/src',
+    '/dom/base',
+    '/dom/events',
+    '/dom/ipc',
+    '/netwerk/base/src',
+    '/netwerk/protocol/http',
+]
+
deleted file mode 100644
--- a/uriloader/prefetch/Makefile.in
+++ /dev/null
@@ -1,13 +0,0 @@
-#
-# 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/.
-
-LOCAL_INCLUDES = \
-		-I$(topsrcdir)/content/base/src \
-		-I$(topsrcdir)/dom/events \
-		$(NULL)
-
-include $(topsrcdir)/config/rules.mk
-
-# vim: ts=4 sw=4 noexpandtab
--- a/uriloader/prefetch/moz.build
+++ b/uriloader/prefetch/moz.build
@@ -37,8 +37,14 @@ IPDL_SOURCES += [
     'POfflineCacheUpdate.ipdl',
 ]
 
 FAIL_ON_WARNINGS = True
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
+
+LOCAL_INCLUDES += [
+    '/content/base/src',
+    '/dom/events',
+]
+
--- a/xulrunner/app/Makefile.in
+++ b/xulrunner/app/Makefile.in
@@ -5,23 +5,16 @@
 
 PREF_JS_EXPORTS = $(srcdir)/xulrunner.js
 GARBAGE += $(addprefix $(DIST)/bin/defaults/pref/,xulrunner.js)
 
 DEFINES += -DAB_CD=$(AB_CD)
 
 STL_FLAGS=
 
-LOCAL_INCLUDES += \
-  -I$(topsrcdir)/toolkit/xre \
-  -I$(topsrcdir)/toolkit/profile \
-  -I$(topsrcdir)/xpcom/base \
-  -I$(topsrcdir)/xpcom/build \
-  $(NULL)
-
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 TK_LIBS := -framework Cocoa $(TK_LIBS)
 endif
 
 LIBS += \
   $(XPCOM_STANDALONE_GLUE_LDOPTS) \
   $(NULL)
 
--- a/xulrunner/app/moz.build
+++ b/xulrunner/app/moz.build
@@ -12,8 +12,16 @@ SOURCES += [
     'nsXULRunnerApp.cpp',
 ]
 
 DEFINES['XULRUNNER_PROGNAME'] = '"xulrunner"'
 DEFINES['XPCOM_GLUE'] = True
 
 if CONFIG['TARGET_XPCOM_ABI']:
     DEFINES['TARGET_XPCOM_ABI'] = '"%s"' % CONFIG['TARGET_XPCOM_ABI']
+
+LOCAL_INCLUDES += [
+    '/toolkit/profile',
+    '/toolkit/xre',
+    '/xpcom/base',
+    '/xpcom/build',
+]
+
--- a/xulrunner/stub/Makefile.in
+++ b/xulrunner/stub/Makefile.in
@@ -1,20 +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/.
 
 # Don't create a dependency on mozglue
 MOZ_GLUE_LDFLAGS =
 
-LOCAL_INCLUDES = \
-  -I$(topsrcdir)/xpcom/build \
-  -I$(topsrcdir)/xpcom/base \
-  $(NULL)
-
 STL_FLAGS=
 
 LIBS = \
   $(XPCOM_STANDALONE_STATICRUNTIME_GLUE_LDOPTS) \
   $(NULL)
 
 # Need to link with CoreFoundation on Mac
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
--- a/xulrunner/stub/moz.build
+++ b/xulrunner/stub/moz.build
@@ -14,10 +14,16 @@ SOURCES += [
     'nsXULStub.cpp',
 ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     FINAL_TARGET = 'dist/XUL.framework/Versions/%(MOZILLA_VERSION)s' % CONFIG
 
 DEFINES['XPCOM_GLUE'] = True
 
+LOCAL_INCLUDES += [
+    '/xpcom/base',
+    '/xpcom/build',
+]
+
+
 # Statically link against the RTL on windows
 USE_STATIC_LIBS = True