Bug 950130 - Move more INCLUDES / LOCAL_INCLUDES to moz.build; r=mshal
authorMs2ger <ms2ger@gmail.com>
Tue, 31 Dec 2013 10:06:11 +0100
changeset 178880 e13c3d784aa2c1384e9c007e0a4af03df0630098
parent 178879 b6471e45332ee5f77cc4a1ff647b1c45d62635f8
child 178881 6350d7ab5efb0ddccc481a9e8322943664ce05f7
push id462
push userraliiev@mozilla.com
push dateTue, 22 Apr 2014 00:22:30 +0000
treeherdermozilla-release@ac5db8c74ac0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs950130
milestone29.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 950130 - Move more INCLUDES / LOCAL_INCLUDES to moz.build; r=mshal
browser/components/feeds/src/Makefile.in
browser/components/feeds/src/moz.build
build/stlport/Makefile.in
build/stlport/moz.build
extensions/spellcheck/hunspell/src/Makefile.in
extensions/spellcheck/hunspell/src/moz.build
extensions/spellcheck/src/Makefile.in
extensions/spellcheck/src/moz.build
extensions/universalchardet/src/xpcom/Makefile.in
extensions/universalchardet/src/xpcom/moz.build
ipc/glue/Makefile.in
ipc/glue/moz.build
js/ipc/Makefile.in
js/ipc/moz.build
js/src/Makefile.in
js/xpconnect/loader/Makefile.in
js/xpconnect/loader/moz.build
js/xpconnect/shell/Makefile.in
js/xpconnect/shell/moz.build
js/xpconnect/src/Makefile.in
js/xpconnect/src/moz.build
js/xpconnect/wrappers/Makefile.in
js/xpconnect/wrappers/moz.build
media/libtremor/lib/Makefile.in
media/libtremor/lib/moz.build
media/omx-plugin/Makefile.in
media/omx-plugin/froyo/Makefile.in
media/omx-plugin/froyo/moz.build
media/omx-plugin/gb/Makefile.in
media/omx-plugin/gb/moz.build
media/omx-plugin/gb235/Makefile.in
media/omx-plugin/gb235/moz.build
media/omx-plugin/hc/Makefile.in
media/omx-plugin/hc/moz.build
media/omx-plugin/lib/froyo/libstagefright/Makefile.in
media/omx-plugin/lib/froyo/libstagefright/moz.build
media/omx-plugin/lib/gb/libstagefright/Makefile.in
media/omx-plugin/lib/gb/libstagefright/moz.build
media/omx-plugin/lib/gb/libstagefright_color_conversion/Makefile.in
media/omx-plugin/lib/gb/libstagefright_color_conversion/moz.build
media/omx-plugin/lib/gb/libutils/Makefile.in
media/omx-plugin/lib/gb/libutils/moz.build
media/omx-plugin/lib/gb235/libstagefright/Makefile.in
media/omx-plugin/lib/gb235/libstagefright/moz.build
media/omx-plugin/lib/hc/libstagefright/Makefile.in
media/omx-plugin/lib/hc/libstagefright/moz.build
media/omx-plugin/lib/ics/libstagefright/Makefile.in
media/omx-plugin/lib/ics/libstagefright/moz.build
media/omx-plugin/lib/ics/libutils/Makefile.in
media/omx-plugin/lib/ics/libutils/moz.build
media/omx-plugin/moz.build
other-licenses/skia-npapi/Makefile.in
other-licenses/skia-npapi/moz.build
parser/html/Makefile.in
parser/html/moz.build
rdf/build/Makefile.in
rdf/build/moz.build
rdf/datasource/src/Makefile.in
rdf/datasource/src/moz.build
storage/test/Makefile.in
storage/test/moz.build
toolkit/components/build/Makefile.in
toolkit/components/build/moz.build
toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/Makefile.in
toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/moz.build
tools/jprof/Makefile.in
tools/jprof/moz.build
xpcom/base/Makefile.in
xpcom/base/moz.build
xpcom/glue/Makefile.in
xpcom/glue/moz.build
xpcom/glue/nomozalloc/Makefile.in
xpcom/glue/nomozalloc/moz.build
xpcom/glue/standalone/Makefile.in
xpcom/glue/standalone/moz.build
xpcom/glue/standalone/staticruntime/Makefile.in
xpcom/glue/standalone/staticruntime/moz.build
xpcom/glue/staticruntime/Makefile.in
xpcom/glue/staticruntime/moz.build
xpcom/reflect/xptcall/src/md/os2/Makefile.in
xpcom/reflect/xptcall/src/md/os2/moz.build
xpcom/reflect/xptcall/src/md/unix/Makefile.in
xpcom/reflect/xptcall/src/md/unix/moz.build
xpcom/reflect/xptcall/src/md/win32/Makefile.in
xpcom/reflect/xptcall/src/md/win32/moz.build
xpcom/tests/Makefile.in
xpcom/tests/moz.build
xpfe/components/build/Makefile.in
xpfe/components/build/moz.build
deleted file mode 100644
--- a/browser/components/feeds/src/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)/../../build
--- a/browser/components/feeds/src/moz.build
+++ b/browser/components/feeds/src/moz.build
@@ -17,8 +17,13 @@ EXTRA_COMPONENTS += [
 EXTRA_PP_COMPONENTS += [
     'FeedWriter.js',
 ]
 
 FINAL_LIBRARY = 'browsercomps'
 
 for var in ('MOZ_APP_NAME', 'MOZ_MACBUNDLE_NAME'):
     DEFINES[var] = CONFIG[var]
+
+LOCAL_INCLUDES += [
+    '../../build',
+]
+
--- a/build/stlport/Makefile.in
+++ b/build/stlport/Makefile.in
@@ -7,9 +7,8 @@ STL_FLAGS =
 
 # Force to build a static library, instead of a fake library, without
 # installing it in dist/lib.
 LIBRARY = $(LIB_PREFIX)$(LIBRARY_NAME).$(LIB_SUFFIX)
 
 include $(topsrcdir)/config/rules.mk
 
 CXXFLAGS += -fuse-cxa-atexit
-INCLUDES += -I$(srcdir)/stlport
--- a/build/stlport/moz.build
+++ b/build/stlport/moz.build
@@ -42,8 +42,13 @@ SOURCES += [
 ]
 
 SOURCES += [
     'src/c_locale.c',
     'src/cxa.c',
 ]
 
 DEFINES['_GNU_SOURCE'] = True
+
+LOCAL_INCLUDES += [
+    'stlport',
+]
+
--- a/extensions/spellcheck/hunspell/src/Makefile.in
+++ b/extensions/spellcheck/hunspell/src/Makefile.in
@@ -1,16 +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/.
 
 include $(topsrcdir)/config/rules.mk
 
-INCLUDES        += -I$(topsrcdir)/extensions/spellcheck/src
-
 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 \
--- a/extensions/spellcheck/hunspell/src/moz.build
+++ b/extensions/spellcheck/hunspell/src/moz.build
@@ -23,8 +23,13 @@ if not CONFIG['MOZ_NATIVE_HUNSPELL']:
         'replist.cpp',
         'suggestmgr.cpp',
     ]
     # This variable is referenced in configure.in.  Make sure to change that file
     # too if you need to change this variable.
     DEFINES['HUNSPELL_STATIC'] = True
 
 FINAL_LIBRARY = 'spellchecker'
+
+LOCAL_INCLUDES += [
+    '/extensions/spellcheck/src',
+]
+
deleted file mode 100644
--- a/extensions/spellcheck/src/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/.
-
-include $(topsrcdir)/config/rules.mk
-
-LOCAL_INCLUDES += \
-	-I$(srcdir)/../hunspell/src \
-	-I$(topsrcdir)/content/base/src \
-	-I$(topsrcdir)/editor/libeditor/base \
-	$(NULL)
--- a/extensions/spellcheck/src/moz.build
+++ b/extensions/spellcheck/src/moz.build
@@ -13,8 +13,14 @@ UNIFIED_SOURCES += [
     'mozSpellChecker.cpp',
     'mozSpellCheckerFactory.cpp',
     'mozSpellI18NManager.cpp',
 ]
 
 LIBRARY_NAME = 'spellchecker'
 
 FINAL_LIBRARY = 'xul'
+
+LOCAL_INCLUDES += [
+    '../hunspell/src',
+    '/content/base/src',
+    '/editor/libeditor/base',
+]
deleted file mode 100644
--- a/extensions/universalchardet/src/xpcom/Makefile.in
+++ /dev/null
@@ -1,6 +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)/../base
--- a/extensions/universalchardet/src/xpcom/moz.build
+++ b/extensions/universalchardet/src/xpcom/moz.build
@@ -7,8 +7,12 @@
 UNIFIED_SOURCES += [
     'nsUdetXPCOMWrapper.cpp',
     'nsUniversalCharDetModule.cpp',
 ]
 
 LIBRARY_NAME = 'universalchardet'
 
 FINAL_LIBRARY = 'xul'
+
+LOCAL_INCLUDES += [
+    '../base',
+]
deleted file mode 100644
--- a/ipc/glue/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)/toolkit/crashreporter
-
-include $(topsrcdir)/config/rules.mk
-
-ifdef MOZ_CONTENT_SANDBOX
-ifeq ($(OS_ARCH),WINNT)
-LOCAL_INCLUDES += -I$(topsrcdir)/security/sandbox/win/src/sandboxbroker
-endif
-endif
--- a/ipc/glue/moz.build
+++ b/ipc/glue/moz.build
@@ -120,8 +120,17 @@ LOCAL_INCLUDES += [
 ]
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 for var in ('MOZ_CHILD_PROCESS_NAME', 'MOZ_CHILD_PROCESS_BUNDLE'):
     DEFINES[var] = '"%s"' % CONFIG[var]
+
+LOCAL_INCLUDES += [
+    '/toolkit/crashreporter',
+]
+
+if CONFIG['MOZ_CONTENT_SANDBOX'] and CONFIG['OS_ARCH'] == 'WINNT':
+    LOCAL_INCLUDES += [
+        '/security/sandbox/win/src/sandboxbroker',
+    ]
deleted file mode 100644
--- a/js/ipc/Makefile.in
+++ /dev/null
@@ -1,12 +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)/dom/base \
-  -I$(topsrcdir)/js/ipc \
-  -I$(topsrcdir)/js/public \
-  -I$(topsrcdir)/js/xpconnect/src \
-  $(NULL)
-
-include $(topsrcdir)/config/rules.mk
--- a/js/ipc/moz.build
+++ b/js/ipc/moz.build
@@ -17,8 +17,16 @@ IPDL_SOURCES += [
 
 FAIL_ON_WARNINGS = True
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xul'
 
 DEFINES['BIN_SUFFIX'] = '"%s"' % CONFIG['BIN_SUFFIX']
+
+LOCAL_INCLUDES += [
+    '/dom/base',
+    '/js/ipc',
+    '/js/public',
+    '/js/xpconnect/src',
+]
+
--- a/js/src/Makefile.in
+++ b/js/src/Makefile.in
@@ -339,18 +339,16 @@ DIST_GARBAGE = config.cache config.log c
    backend.mk config/backend.mk devtools/backend.mk editline/backend.mk \
    gdb/backend.mk jsapi-tests/backend.mk shell/backend.mk tests/backend.mk \
    backend.RecursiveMakeBackend backend.RecursiveMakeBackend.pp \
    devtools/rootAnalysis/Makefile
 
 distclean::
 	$(RM) $(DIST_GARBAGE)
 
-INCLUDES	+= -I$(srcdir)
-
 ifneq (,$(filter WINNT,$(OS_ARCH)))
 # _CRT_RAND_S must be #defined before #including stdlib.h to get rand_s()
 DEFINES         += -D_CRT_RAND_S
 endif
 
 ifneq ($(findstring -L,$(NSPR_LIBS)),)
 NSPR_STATIC_PATH = $(subst -L,,$(findstring -L,$(NSPR_LIBS)))
 else
deleted file mode 100644
--- a/js/xpconnect/loader/Makefile.in
+++ /dev/null
@@ -1,9 +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)/../src \
-  -I$(srcdir)/../wrappers \
-  -I$(topsrcdir)/content/base/src \
-  $(NULL)
--- a/js/xpconnect/loader/moz.build
+++ b/js/xpconnect/loader/moz.build
@@ -19,8 +19,15 @@ EXTRA_JS_MODULES += [
 
 FAIL_ON_WARNINGS = True
 
 MSVC_ENABLE_PGO = True
 
 FINAL_LIBRARY = 'xpconnect_s'
 
 DEFINES['JS_THREADSAFE'] = True
+
+LOCAL_INCLUDES += [
+    '../src',
+    '../wrappers',
+    '/content/base/src',
+]
+
--- a/js/xpconnect/shell/Makefile.in
+++ b/js/xpconnect/shell/Makefile.in
@@ -1,19 +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/.
 
 SDK_BINARY	= $(PROGRAM)
 
-LOCAL_INCLUDES += \
-  -I$(topsrcdir)/toolkit/xre \
-  $(NULL)
-
 LIBS		= \
 		$(DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \
 		$(LIBXUL_LIBS) \
 		$(XPCOM_LIBS) \
 		$(NULL)
 
 LIBS +=	$(NSPR_LIBS)
 
--- a/js/xpconnect/shell/moz.build
+++ b/js/xpconnect/shell/moz.build
@@ -21,9 +21,14 @@ DEFINES['JS_THREADSAFE'] = True
 
 if CONFIG['MOZ_SHARK']:
     DEFINES['MOZ_SHARK'] = True
 if CONFIG['MOZ_CALLGRIND']:
     DEFINES['MOZ_CALLGRIND'] = True
 if CONFIG['MOZ_VTUNE']:
     DEFINES['MOZ_VTUNE'] = True
 
-include('/ipc/chromium/chromium-config.mozbuild')
\ No newline at end of file
+include('/ipc/chromium/chromium-config.mozbuild')
+
+LOCAL_INCLUDES += [
+    '/toolkit/xre',
+]
+
--- a/js/xpconnect/src/Makefile.in
+++ b/js/xpconnect/src/Makefile.in
@@ -1,36 +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)/../wrappers \
-		-I$(srcdir)/../loader \
-		-I$(topsrcdir)/caps/include \
-		-I$(topsrcdir)/content/base/src \
-		-I$(topsrcdir)/content/base/public \
-		-I$(topsrcdir)/content/events/src \
-		-I$(topsrcdir)/content/html/content/src \
-		-I$(topsrcdir)/content/html/document/src \
-		-I$(topsrcdir)/content/svg/content/src \
-		-I$(topsrcdir)/layout/style \
-		-I$(topsrcdir)/layout/base \
-		-I$(topsrcdir)/dom/base \
-		-I$(topsrcdir)/xpcom/ds \
-		-I$(topsrcdir)/js/ipc \
-		$(NULL)
-
-ifdef MOZ_B2G_BT
-LOCAL_INCLUDES += \
-    -I$(topsrcdir)/dom/bluetooth \
-    $(NULL)
-endif
-
 EXTRA_MDDEPEND_FILES = dom_qsgen.pp dictionary_helper_gen.pp event_impl_gen.pp
 
 INSTALL_TARGETS += extra_export_files
 extra_export_files_FILES := \
   DictionaryHelpers.h \
   GeneratedEventClasses.h \
   GeneratedEvents.h \
   $(NULL)
--- a/js/xpconnect/src/moz.build
+++ b/js/xpconnect/src/moz.build
@@ -86,8 +86,30 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'wind
         if CONFIG['MOZ_APP_BASENAME']:
             DEFINES['MOZ_APP_BASENAME'] = '"%s"' % CONFIG['MOZ_APP_BASENAME']
         DEFINES['MOZ_APP_NAME'] = '"%s"' % CONFIG['MOZ_APP_NAME']
 
 DEFINES['JS_THREADSAFE'] = True
 
 if CONFIG['MOZ_JSDEBUGGER']:
     DEFINES['MOZ_JSDEBUGGER'] = True
+
+LOCAL_INCLUDES += [
+    '../loader',
+    '../wrappers',
+    '/caps/include',
+    '/content/base/public',
+    '/content/base/src',
+    '/content/events/src',
+    '/content/html/content/src',
+    '/content/html/document/src',
+    '/content/svg/content/src',
+    '/dom/base',
+    '/js/ipc',
+    '/layout/base',
+    '/layout/style',
+    '/xpcom/ds',
+]
+
+if CONFIG['MOZ_B2G_BT']:
+    LOCAL_INCLUDES += [
+        '/dom/bluetooth',
+    ]
deleted file mode 100644
--- a/js/xpconnect/wrappers/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$(srcdir)/../src \
-                -I$(srcdir)/../../../dom/base \
--- a/js/xpconnect/wrappers/moz.build
+++ b/js/xpconnect/wrappers/moz.build
@@ -22,8 +22,14 @@ SOURCES += [
 ]
 
 # warning C4661 for FilteringWrapper
 FAIL_ON_WARNINGS = not CONFIG['_MSC_VER']
 
 MSVC_ENABLE_PGO = True
 
 FINAL_LIBRARY = 'xpconnect_s'
+
+LOCAL_INCLUDES += [
+    '../../../dom/base',
+    '../src',
+]
+
deleted file mode 100644
--- a/media/libtremor/lib/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$(topsrcdir)/media/libtremor/include/tremor
--- a/media/libtremor/lib/moz.build
+++ b/media/libtremor/lib/moz.build
@@ -21,8 +21,13 @@ SOURCES += [
 
 FINAL_LIBRARY = 'gkmedias'
 
 if CONFIG['OS_ARCH'] == 'AIX':
     DEFINES['alloca'] = '__alloca'
 
 if CONFIG['TARGET_CPU'] == 'arm' and CONFIG['GNU_CC'] and not CONFIG['MOZ_THUMB2']:
     DEFINES['_ARM_ASSEM_'] = True
+
+LOCAL_INCLUDES += [
+    '/media/libtremor/include/tremor',
+]
+
--- a/media/omx-plugin/Makefile.in
+++ b/media/omx-plugin/Makefile.in
@@ -20,27 +20,23 @@ USE_STATIC_LIBS = 1
 
 include $(topsrcdir)/config/rules.mk
 
 ifdef GNU_CXX
 # Stagefright header files define many multichar constants.
 CXXFLAGS += -Wno-multichar
 endif
 
-INCLUDES        += \
-                -I$(srcdir)/../../content/media/plugins \
-                $(NULL)
-
 ifeq ($(MOZ_WIDGET_TOOLKIT),gonk)
 EXTRA_DSO_LDOPTS += \
                -lutils -lstagefright -lmedia -lstagefright_omx -lbinder -lui \
                -lhardware -lcutils \
 		$(NULL)
 
-INCLUDES        += \
+CXXFLAGS += \
                 -I$(ANDROID_SOURCE)/dalvik/libnativehelper/include/nativehelper \
                 -I$(ANDROID_SOURCE)/frameworks/base/include/ \
                 -I$(ANDROID_SOURCE)/frameworks/base/include/binder/ \
                 -I$(ANDROID_SOURCE)/frameworks/base/include/utils/ \
                 -I$(ANDROID_SOURCE)/frameworks/base/include/media/ \
                 -I$(ANDROID_SOURCE)/frameworks/base/include/media/stagefright/openmax \
                 -I$(ANDROID_SOURCE)/frameworks/base/media/libstagefright/include \
                 -I$(ANDROID_SOURCE)/frameworks/base/native/include \
@@ -51,14 +47,9 @@ else
 EXTRA_DSO_LDOPTS += \
 		-L$(DEPTH)/media/omx-plugin/lib/ics/libutils \
 		-lutils \
 		-L$(DEPTH)/media/omx-plugin/lib/ics/libstagefright \
 		-lstagefright \
 		-L$(DEPTH)/media/omx-plugin/lib/ics/libvideoeditorplayer \
 		-lvideoeditorplayer \
 		$(NULL)
-
-INCLUDES        += \
-                -I$(srcdir)/include/ics \
-                -I$(srcdir)/include/ics/media/stagefright/openmax \
-                $(NULL)
 endif
--- a/media/omx-plugin/froyo/Makefile.in
+++ b/media/omx-plugin/froyo/Makefile.in
@@ -15,25 +15,17 @@
 # Don't use STL wrappers; this isn't Gecko code
 STL_FLAGS =
 
 # must link statically with the CRT; this isn't Gecko code
 USE_STATIC_LIBS = 1
 
 include $(topsrcdir)/config/rules.mk
 
-INCLUDES        += \
-                -I$(srcdir)/../../../content/media/plugins \
-                $(NULL)
-
 EXTRA_DSO_LDOPTS += \
 		-L$(DEPTH)/media/omx-plugin/lib/gb/libutils \
 		-lutils \
 		-L$(DEPTH)/media/omx-plugin/lib/froyo/libstagefright \
 		-lstagefright \
 		-L$(DEPTH)/media/omx-plugin/lib/gb/libstagefright_color_conversion \
 		-lstagefright_color_conversion \
 		$(NULL)
 
-INCLUDES        += \
-                -I$(srcdir)/../include/froyo \
-                -I$(srcdir)/../include/froyo/media/stagefright/openmax \
-                $(NULL)
--- a/media/omx-plugin/froyo/moz.build
+++ b/media/omx-plugin/froyo/moz.build
@@ -6,8 +6,15 @@
 
 SOURCES += [
     'OmxPluginFroyo.cpp',
 ]
 
 LIBRARY_NAME = 'omxpluginfroyo'
 
 FORCE_SHARED_LIB = True
+
+LOCAL_INCLUDES += [
+    '../../../content/media/plugins',
+    '../include/froyo',
+    '../include/froyo/media/stagefright/openmax',
+]
+
--- a/media/omx-plugin/gb/Makefile.in
+++ b/media/omx-plugin/gb/Makefile.in
@@ -15,25 +15,17 @@
 # Don't use STL wrappers; this isn't Gecko code
 STL_FLAGS =
 
 # must link statically with the CRT; this isn't Gecko code
 USE_STATIC_LIBS = 1
 
 include $(topsrcdir)/config/rules.mk
 
-INCLUDES        += \
-                -I$(srcdir)/../../../content/media/plugins \
-                $(NULL)
-
 EXTRA_DSO_LDOPTS += \
 		-L$(DEPTH)/media/omx-plugin/lib/gb/libutils \
 		-lutils \
 		-L$(DEPTH)/media/omx-plugin/lib/gb/libstagefright \
 		-lstagefright \
 		-L$(DEPTH)/media/omx-plugin/lib/gb/libstagefright_color_conversion \
 		-lstagefright_color_conversion \
 		$(NULL)
 
-INCLUDES        += \
-                -I$(srcdir)/../include/gb \
-                -I$(srcdir)/../include/gb/media/stagefright/openmax \
-                $(NULL)
--- a/media/omx-plugin/gb/moz.build
+++ b/media/omx-plugin/gb/moz.build
@@ -6,8 +6,15 @@
 
 SOURCES += [
     'OmxPlugin236.cpp',
 ]
 
 LIBRARY_NAME = 'omxplugingb'
 
 FORCE_SHARED_LIB = True
+
+LOCAL_INCLUDES += [
+    '../../../content/media/plugins',
+    '../include/gb',
+    '../include/gb/media/stagefright/openmax',
+]
+
--- a/media/omx-plugin/gb235/Makefile.in
+++ b/media/omx-plugin/gb235/Makefile.in
@@ -15,25 +15,17 @@
 # Don't use STL wrappers; this isn't Gecko code
 STL_FLAGS =
 
 # must link statically with the CRT; this isn't Gecko code
 USE_STATIC_LIBS = 1
 
 include $(topsrcdir)/config/rules.mk
 
-INCLUDES        += \
-                -I$(srcdir)/../../../content/media/plugins \
-                $(NULL)
-
 EXTRA_DSO_LDOPTS += \
 		-L$(DEPTH)/media/omx-plugin/lib/gb/libutils \
 		-lutils \
 		-L$(DEPTH)/media/omx-plugin/lib/gb235/libstagefright \
 		-lstagefright \
 		-L$(DEPTH)/media/omx-plugin/lib/gb/libstagefright_color_conversion \
 		-lstagefright_color_conversion \
 		$(NULL)
 
-INCLUDES        += \
-                -I$(srcdir)/../include/gb \
-                -I$(srcdir)/../include/gb/media/stagefright/openmax \
-                $(NULL)
--- a/media/omx-plugin/gb235/moz.build
+++ b/media/omx-plugin/gb235/moz.build
@@ -6,8 +6,15 @@
 
 SOURCES += [
     'OmxPlugin235.cpp',
 ]
 
 LIBRARY_NAME = 'omxplugingb235'
 
 FORCE_SHARED_LIB = True
+
+LOCAL_INCLUDES += [
+    '../../../content/media/plugins',
+    '../include/gb',
+    '../include/gb/media/stagefright/openmax',
+]
+
--- a/media/omx-plugin/hc/Makefile.in
+++ b/media/omx-plugin/hc/Makefile.in
@@ -15,23 +15,15 @@
 # Don't use STL wrappers; this isn't Gecko code
 STL_FLAGS =
 
 # must link statically with the CRT; this isn't Gecko code
 USE_STATIC_LIBS = 1
 
 include $(topsrcdir)/config/rules.mk
 
-INCLUDES        += \
-                -I$(srcdir)/../../../content/media/plugins \
-                $(NULL)
-
 EXTRA_DSO_LDOPTS += \
 		-L$(DEPTH)/media/omx-plugin/lib/gb/libutils \
 		-lutils \
 		-L$(DEPTH)/media/omx-plugin/lib/hc/libstagefright \
 		-lstagefright \
 		$(NULL)
 
-INCLUDES        += \
-                -I$(srcdir)/../include/gb \
-                -I$(srcdir)/../include/gb/media/stagefright/openmax \
-                $(NULL)
--- a/media/omx-plugin/hc/moz.build
+++ b/media/omx-plugin/hc/moz.build
@@ -6,8 +6,15 @@
 
 SOURCES += [
     'OmxPluginHoneycomb.cpp',
 ]
 
 LIBRARY_NAME = 'omxpluginhc'
 
 FORCE_SHARED_LIB = True
+
+LOCAL_INCLUDES += [
+    '../../../content/media/plugins',
+    '../include/gb',
+    '../include/gb/media/stagefright/openmax',
+]
+
--- a/media/omx-plugin/lib/froyo/libstagefright/Makefile.in
+++ b/media/omx-plugin/lib/froyo/libstagefright/Makefile.in
@@ -15,17 +15,12 @@
 # Don't use STL wrappers; this isn't Gecko code
 STL_FLAGS =
 
 # must link statically with the CRT; this isn't Gecko code
 USE_STATIC_LIBS = 1
 
 include $(topsrcdir)/config/rules.mk
 
-INCLUDES        += \
-                -I$(topsrcdir)/media/omx-plugin/include/froyo \
-                -I$(topsrcdir)/media/omx-plugin/include/froyo/media/stagefright/openmax \
-                $(NULL)
-
 EXTRA_DSO_LDOPTS += \
 		-L$(DEPTH)/media/omx-plugin/lib/gb/libutils \
 		-lutils \
 		$(NULL)
--- a/media/omx-plugin/lib/froyo/libstagefright/moz.build
+++ b/media/omx-plugin/lib/froyo/libstagefright/moz.build
@@ -8,8 +8,14 @@ NO_DIST_INSTALL = True
 if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
     SOURCES += [
         'libstagefright.cpp',
     ]
 
 LIBRARY_NAME = 'stagefright'
 
 FORCE_SHARED_LIB = True
+
+LOCAL_INCLUDES += [
+    '/media/omx-plugin/include/froyo',
+    '/media/omx-plugin/include/froyo/media/stagefright/openmax',
+]
+
--- a/media/omx-plugin/lib/gb/libstagefright/Makefile.in
+++ b/media/omx-plugin/lib/gb/libstagefright/Makefile.in
@@ -15,17 +15,12 @@
 # Don't use STL wrappers; this isn't Gecko code
 STL_FLAGS =
 
 # must link statically with the CRT; this isn't Gecko code
 USE_STATIC_LIBS = 1
 
 include $(topsrcdir)/config/rules.mk
 
-INCLUDES        += \
-                -I$(topsrcdir)/media/omx-plugin/include/gb \
-                -I$(topsrcdir)/media/omx-plugin/include/gb/media/stagefright/openmax \
-                $(NULL)
-
 EXTRA_DSO_LDOPTS += \
 		-L$(DEPTH)/media/omx-plugin/lib/gb/libutils \
 		-lutils \
 		$(NULL)
--- a/media/omx-plugin/lib/gb/libstagefright/moz.build
+++ b/media/omx-plugin/lib/gb/libstagefright/moz.build
@@ -8,8 +8,14 @@ NO_DIST_INSTALL = True
 if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
     SOURCES += [
         'libstagefright.cpp',
     ]
 
 LIBRARY_NAME = 'stagefright'
 
 FORCE_SHARED_LIB = True
+
+LOCAL_INCLUDES += [
+    '/media/omx-plugin/include/gb',
+    '/media/omx-plugin/include/gb/media/stagefright/openmax',
+]
+
--- a/media/omx-plugin/lib/gb/libstagefright_color_conversion/Makefile.in
+++ b/media/omx-plugin/lib/gb/libstagefright_color_conversion/Makefile.in
@@ -15,17 +15,12 @@
 # Don't use STL wrappers; this isn't Gecko code
 STL_FLAGS =
 
 # must link statically with the CRT; this isn't Gecko code
 USE_STATIC_LIBS = 1
 
 include $(topsrcdir)/config/rules.mk
 
-INCLUDES        += \
-                -I$(topsrcdir)/media/omx-plugin/include/gb \
-                -I$(topsrcdir)/media/omx-plugin/include/gb/media/stagefright/openmax \
-                $(NULL)
-
 # EXTRA_DSO_LDOPTS += \
 # 		-L$(DEPTH)/media/omx-plugin/lib/gb/libutils \
 # 		-lutils \
 # 		$(NULL)
--- a/media/omx-plugin/lib/gb/libstagefright_color_conversion/moz.build
+++ b/media/omx-plugin/lib/gb/libstagefright_color_conversion/moz.build
@@ -8,8 +8,14 @@ NO_DIST_INSTALL = True
 if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
     SOURCES += [
         'libstagefright_color_conversion.cpp',
     ]
 
 LIBRARY_NAME = 'stagefright_color_conversion'
 
 FORCE_SHARED_LIB = True
+
+LOCAL_INCLUDES += [
+    '/media/omx-plugin/include/gb',
+    '/media/omx-plugin/include/gb/media/stagefright/openmax',
+]
+
--- a/media/omx-plugin/lib/gb/libutils/Makefile.in
+++ b/media/omx-plugin/lib/gb/libutils/Makefile.in
@@ -13,14 +13,8 @@
 # limitations under the License.
 
 # Don't use STL wrappers; this isn't Gecko code
 STL_FLAGS =
 
 # must link statically with the CRT; this isn't Gecko code
 USE_STATIC_LIBS = 1
 
-include $(topsrcdir)/config/rules.mk
-
-INCLUDES        += \
-                -I$(topsrcdir)/media/omx-plugin/include/gb \
-                -I$(topsrcdir)/media/omx-plugin/include/gb/media/stagefright/openmax \
-                $(NULL)
--- a/media/omx-plugin/lib/gb/libutils/moz.build
+++ b/media/omx-plugin/lib/gb/libutils/moz.build
@@ -8,8 +8,14 @@ NO_DIST_INSTALL = True
 if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
     SOURCES += [
         'libutils.cpp',
     ]
 
 LIBRARY_NAME = 'utils'
 
 FORCE_SHARED_LIB = True
+
+LOCAL_INCLUDES += [
+    '/media/omx-plugin/include/gb',
+    '/media/omx-plugin/include/gb/media/stagefright/openmax',
+]
+
--- a/media/omx-plugin/lib/gb235/libstagefright/Makefile.in
+++ b/media/omx-plugin/lib/gb235/libstagefright/Makefile.in
@@ -15,17 +15,12 @@
 # Don't use STL wrappers; this isn't Gecko code
 STL_FLAGS =
 
 # must link statically with the CRT; this isn't Gecko code
 USE_STATIC_LIBS = 1
 
 include $(topsrcdir)/config/rules.mk
 
-INCLUDES        += \
-                -I$(topsrcdir)/media/omx-plugin/include/gb \
-                -I$(topsrcdir)/media/omx-plugin/include/gb/media/stagefright/openmax \
-                $(NULL)
-
 EXTRA_DSO_LDOPTS += \
 		-L$(DEPTH)/media/omx-plugin/lib/gb/libutils \
 		-lutils \
 		$(NULL)
--- a/media/omx-plugin/lib/gb235/libstagefright/moz.build
+++ b/media/omx-plugin/lib/gb235/libstagefright/moz.build
@@ -8,8 +8,14 @@ NO_DIST_INSTALL = True
 if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
     SOURCES += [
         'libstagefright.cpp',
     ]
 
 LIBRARY_NAME = 'stagefright'
 
 FORCE_SHARED_LIB = True
+
+LOCAL_INCLUDES += [
+    '/media/omx-plugin/include/gb',
+    '/media/omx-plugin/include/gb/media/stagefright/openmax',
+]
+
--- a/media/omx-plugin/lib/hc/libstagefright/Makefile.in
+++ b/media/omx-plugin/lib/hc/libstagefright/Makefile.in
@@ -15,17 +15,12 @@
 # Don't use STL wrappers; this isn't Gecko code
 STL_FLAGS =
 
 # must link statically with the CRT; this isn't Gecko code
 USE_STATIC_LIBS = 1
 
 include $(topsrcdir)/config/rules.mk
 
-INCLUDES        += \
-                -I$(topsrcdir)/media/omx-plugin/include/gb \
-                -I$(topsrcdir)/media/omx-plugin/include/gb/media/stagefright/openmax \
-                $(NULL)
-
 EXTRA_DSO_LDOPTS += \
 		-L$(DEPTH)/media/omx-plugin/lib/gb/libutils \
 		-lutils \
 		$(NULL)
--- a/media/omx-plugin/lib/hc/libstagefright/moz.build
+++ b/media/omx-plugin/lib/hc/libstagefright/moz.build
@@ -8,8 +8,14 @@ NO_DIST_INSTALL = True
 if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
     SOURCES += [
         'libstagefright.cpp',
     ]
 
 LIBRARY_NAME = 'stagefright'
 
 FORCE_SHARED_LIB = True
+
+LOCAL_INCLUDES += [
+    '/media/omx-plugin/include/gb',
+    '/media/omx-plugin/include/gb/media/stagefright/openmax',
+]
+
--- a/media/omx-plugin/lib/ics/libstagefright/Makefile.in
+++ b/media/omx-plugin/lib/ics/libstagefright/Makefile.in
@@ -15,17 +15,12 @@
 # Don't use STL wrappers; this isn't Gecko code
 STL_FLAGS =
 
 # must link statically with the CRT; this isn't Gecko code
 USE_STATIC_LIBS = 1
 
 include $(topsrcdir)/config/rules.mk
 
-INCLUDES        += \
-                -I$(topsrcdir)/media/omx-plugin/include/ics \
-                -I$(topsrcdir)/media/omx-plugin/include/ics/media/stagefright/openmax \
-                $(NULL)
-
 EXTRA_DSO_LDOPTS += \
 		-L$(DEPTH)/media/omx-plugin/lib/ics/libutils \
 		-lutils \
 		$(NULL)
--- a/media/omx-plugin/lib/ics/libstagefright/moz.build
+++ b/media/omx-plugin/lib/ics/libstagefright/moz.build
@@ -8,8 +8,14 @@ NO_DIST_INSTALL = True
 if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
     SOURCES += [
         'libstagefright.cpp',
     ]
 
 LIBRARY_NAME = 'stagefright'
 
 FORCE_SHARED_LIB = True
+
+LOCAL_INCLUDES += [
+    '/media/omx-plugin/include/ics',
+    '/media/omx-plugin/include/ics/media/stagefright/openmax',
+]
+
--- a/media/omx-plugin/lib/ics/libutils/Makefile.in
+++ b/media/omx-plugin/lib/ics/libutils/Makefile.in
@@ -13,14 +13,8 @@
 # limitations under the License.
 
 # Don't use STL wrappers; this isn't Gecko code
 STL_FLAGS =
 
 # must link statically with the CRT; this isn't Gecko code
 USE_STATIC_LIBS = 1
 
-include $(topsrcdir)/config/rules.mk
-
-INCLUDES        += \
-                -I$(topsrcdir)/media/omx-plugin/include/ics \
-                -I$(topsrcdir)/media/omx-plugin/include/ics/media/stagefright/openmax \
-                $(NULL)
--- a/media/omx-plugin/lib/ics/libutils/moz.build
+++ b/media/omx-plugin/lib/ics/libutils/moz.build
@@ -8,8 +8,14 @@ NO_DIST_INSTALL = True
 if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'gonk':
     SOURCES += [
         'libutils.cpp',
     ]
 
 LIBRARY_NAME = 'utils'
 
 FORCE_SHARED_LIB = True
+
+LOCAL_INCLUDES += [
+    '/media/omx-plugin/include/ics',
+    '/media/omx-plugin/include/ics/media/stagefright/openmax',
+]
+
--- a/media/omx-plugin/moz.build
+++ b/media/omx-plugin/moz.build
@@ -16,8 +16,20 @@
 
 SOURCES += [
     'OmxPlugin.cpp',
 ]
 
 LIBRARY_NAME = 'omxplugin'
 
 FORCE_SHARED_LIB = True
+
+LOCAL_INCLUDES += [
+    '../../content/media/plugins',
+]
+
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
+    pass
+else:
+    LOCAL_INCLUDES += [
+        'include/ics',
+        'include/ics/media/stagefright/openmax',
+    ]
deleted file mode 100644
--- a/other-licenses/skia-npapi/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/.
-
-LOCAL_INCLUDES += \
-  -I$(topsrcdir)/dom/plugins/base \
-  -I$(topsrcdir)/dom/plugins/base/android \
-  -I$(topsrcdir)/gfx/skia/include/core \
-  -I$(topsrcdir)/gfx/skia/include/config \
-  -I$(topsrcdir)/gfx/gl \
-  $(NULL)
--- a/other-licenses/skia-npapi/moz.build
+++ b/other-licenses/skia-npapi/moz.build
@@ -14,8 +14,17 @@ UNIFIED_SOURCES += [
     'ANPPath.cpp',
     'ANPTypeface.cpp',
     'SkANP.cpp',
 ]
 
 FINAL_LIBRARY = 'xul'
 
 DEFINES['SK_BUILD_FOR_ANDROID_NDK'] = True
+
+LOCAL_INCLUDES += [
+    '/dom/plugins/base',
+    '/dom/plugins/base/android',
+    '/gfx/gl',
+    '/gfx/skia/include/config',
+    '/gfx/skia/include/core',
+]
+
deleted file mode 100644
--- a/parser/html/Makefile.in
+++ /dev/null
@@ -1,9 +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/.
-
-include $(topsrcdir)/config/rules.mk
-
-INCLUDES	+= \
-		-I$(srcdir)/../../content/base/src \
-		$(NULL)
--- a/parser/html/moz.build
+++ b/parser/html/moz.build
@@ -83,8 +83,13 @@ UNIFIED_SOURCES += [
     'nsParserUtils.cpp',
 ]
 
 MSVC_ENABLE_PGO = True
 
 FINAL_LIBRARY = 'gklayout'
 
 # DEFINES['ENABLE_VOID_MENUITEM'] = True
+
+LOCAL_INCLUDES += [
+    '../../content/base/src',
+]
+
deleted file mode 100644
--- a/rdf/build/Makefile.in
+++ /dev/null
@@ -1,12 +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/.
-
-include $(topsrcdir)/config/rules.mk
-
-LOCAL_INCLUDES	= \
-		-I$(srcdir)/../base/src \
-		-I$(srcdir)/../content/src \
-		-I$(srcdir)/../datasource/src \
-		$(NULL)
--- a/rdf/build/moz.build
+++ b/rdf/build/moz.build
@@ -10,8 +10,14 @@ EXPORTS += [
 
 SOURCES += [
     'nsRDFModule.cpp',
 ]
 
 LIBRARY_NAME = 'rdf'
 
 FINAL_LIBRARY = 'xul'
+
+LOCAL_INCLUDES += [
+    '../base/src',
+    '../content/src',
+    '../datasource/src',
+]
deleted file mode 100644
--- a/rdf/datasource/src/Makefile.in
+++ /dev/null
@@ -1,10 +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/.
-
-include $(topsrcdir)/config/rules.mk
-
-# XXX This is a dependency on rdfutil.h: it'll go away once that becomes
-# a first-class XPCOM interface.
-INCLUDES	+= -I$(srcdir)/../../base/src
--- a/rdf/datasource/src/moz.build
+++ b/rdf/datasource/src/moz.build
@@ -5,8 +5,15 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 UNIFIED_SOURCES += [
     'nsFileSystemDataSource.cpp',
     'nsLocalStore.cpp',
 ]
 
 FINAL_LIBRARY = 'rdf'
+
+# "This is a dependency on rdfutil.h: it'll go away once that becomes
+# a first-class XPCOM interface."
+LOCAL_INCLUDES += [
+    '../../base/src',
+]
+
--- a/storage/test/Makefile.in
+++ b/storage/test/Makefile.in
@@ -1,14 +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)/../src \
-  $(NULL)
-
 LIBS = \
 	$(LIBS_DIR) \
 	$(MOZ_COMPONENT_LIBS) \
 	$(SQLITE_LIBS) \
 	$(NULL)
--- a/storage/test/moz.build
+++ b/storage/test/moz.build
@@ -22,8 +22,13 @@ CPP_UNIT_TESTS += [
 ]
 
 if CONFIG['MOZ_DEBUG'] and CONFIG['OS_ARCH'] not in ('WINNT', 'Darwin'):
     # FIXME bug 523392: test_deadlock_detector doesn't like Windows
     # FIXME bug 523378: also fails on OS X
     CPP_UNIT_TESTS += [
         'test_deadlock_detector.cpp',
     ]
+
+LOCAL_INCLUDES += [
+    '../src',
+]
+
deleted file mode 100644
--- a/toolkit/components/build/Makefile.in
+++ /dev/null
@@ -1,27 +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)/../alerts \
-  -I$(srcdir)/../downloads \
-  -I$(srcdir)/../feeds \
-  -I$(srcdir)/../find \
-  -I$(srcdir)/../intl \
-  -I$(srcdir)/../jsdownloads/src \
-  -I$(srcdir)/../protobuf \
-  -I$(srcdir)/../startup \
-  -I$(srcdir)/../statusfilter \
-  -I$(srcdir)/../typeaheadfind \
-  -I$(srcdir)/../url-classifier \
-  -I$(srcdir)/../../xre \
-  $(NULL)
-
-ifndef MOZ_DISABLE_PARENTAL_CONTROLS
-ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
-LOCAL_INCLUDES += \
-  -I$(srcdir)/../parentalcontrols \
-  $(NULL)
-endif
-endif
--- a/toolkit/components/build/moz.build
+++ b/toolkit/components/build/moz.build
@@ -10,8 +10,28 @@ EXPORTS += [
 
 SOURCES += [
     'nsToolkitCompsModule.cpp',
 ]
 
 LIBRARY_NAME = 'toolkitcomps'
 
 FINAL_LIBRARY = 'xul'
+
+LOCAL_INCLUDES += [
+    '../../xre',
+    '../alerts',
+    '../downloads',
+    '../feeds',
+    '../find',
+    '../intl',
+    '../jsdownloads/src',
+    '../protobuf',
+    '../startup',
+    '../statusfilter',
+    '../typeaheadfind',
+    '../url-classifier',
+]
+
+if not CONFIG['MOZ_DISABLE_PARENTAL_CONTROLS'] and CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
+    LOCAL_INCLUDES += [
+        '../parentalcontrols',
+    ]
deleted file mode 100644
--- a/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/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/.
-
-LOCAL_INCLUDES = \
-  -I$(topsrcdir)/toolkit/crashreporter/google-breakpad/src \
-  $(NULL)
-
-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/minidump_writer/moz.build
+++ b/toolkit/crashreporter/google-breakpad/src/client/linux/minidump_writer/moz.build
@@ -11,8 +11,17 @@ UNIFIED_SOURCES += [
 ]
 
 XPI_NAME = 'crashreporter'
 
 FINAL_LIBRARY = 'xulapp_s'
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
     DEFINES['ELFSIZE'] = 32
+
+LOCAL_INCLUDES += [
+    '/toolkit/crashreporter/google-breakpad/src',
+]
+
+if CONFIG['OS_TARGET'] == 'Android':
+    LOCAL_INCLUDES += [
+        '/toolkit/crashreporter/google-breakpad/src/common/android/include',
+    ]
--- a/tools/jprof/Makefile.in
+++ b/tools/jprof/Makefile.in
@@ -5,16 +5,8 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 OS_LIBS = \
 	-ldl \
 	-lbfd \
 	-liberty \
 	$(NULL)
 
-HELPER_SCRIPTS	= jprofsig
-HELPER_SCRIPTS	:= $(addprefix $(srcdir)/, $(HELPER_SCRIPTS))
-
-include $(topsrcdir)/config/rules.mk
-
-INCLUDES += \
-	-I$(srcdir)/stub \
-	$(NULL)
--- a/tools/jprof/moz.build
+++ b/tools/jprof/moz.build
@@ -11,8 +11,13 @@ PROGRAM = 'jprof'
 SOURCES += [
     'bfd.cpp',
     'coff.cpp',
     'elf.cpp',
     'intcnt.cpp',
     'leaky.cpp',
     'strset.cpp',
 ]
+
+LOCAL_INCLUDES += [
+    'stub',
+]
+
--- a/xpcom/base/Makefile.in
+++ b/xpcom/base/Makefile.in
@@ -14,21 +14,16 @@ errorlist_DEST = $(DIST)/include
 errorlist_TARGET := export
 
 include $(topsrcdir)/config/rules.mk
 
 ifdef MOZ_WIDGET_GTK
 CXXFLAGS        += $(TK_CFLAGS)
 endif
 
-LOCAL_INCLUDES += \
-		-I$(srcdir)/../build \
-		-I$(topsrcdir)/xpcom/ds \
-		$(NULL)
-
 # We generate ErrorListCxxDefines.h from ErrorList.h using regex.  The -n option
 # suppresses printing the pattern space, and the p at the end prints it anyway,
 # so we don't print lines that don't match the pattern to start with.
 ErrorListCxxDefines.h: ErrorList.h Makefile
 	echo '// IWYU pragma: private, include "nsError.h"' > $@
 	sed -n 's/.*ERROR(\([A-Z_0-9]*\).*/#define \1 nsresult::\1/p' < $< >> $@
 
 ErrorListCDefines.h: ErrorList.h Makefile
--- a/xpcom/base/moz.build
+++ b/xpcom/base/moz.build
@@ -148,10 +148,16 @@ UNIFIED_SOURCES += [
 ]
 
 MSVC_ENABLE_PGO = True
 
 include('/ipc/chromium/chromium-config.mozbuild')
 
 FINAL_LIBRARY = 'xpcom_core'
 
+LOCAL_INCLUDES += [
+    '../build',
+    '/xpcom/ds',
+]
+
+
 if CONFIG['MOZ_OPTIMIZE']:
     DEFINES['MOZ_OPTIMIZE'] = True
--- a/xpcom/glue/Makefile.in
+++ b/xpcom/glue/Makefile.in
@@ -1,19 +1,15 @@
 # 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_INSTALL	= 1
 
-LOCAL_INCLUDES	= \
-		-I$(srcdir)/../build \
-		$(NULL)
-
 include $(topsrcdir)/config/rules.mk
 
 ifdef _MSC_VER
 # Don't include directives about which CRT to use
 OS_COMPILE_CXXFLAGS += -Zl
 OS_COMPILE_CFLAGS += -Zl
 endif
--- a/xpcom/glue/moz.build
+++ b/xpcom/glue/moz.build
@@ -104,10 +104,14 @@ SDK_LIBRARY = [
 FORCE_STATIC_LIB = True
 
 if CONFIG['_MSC_VER']:
     DEFINES['_USE_ANSI_CPP'] = True
 
 if CONFIG['TARGET_XPCOM_ABI']:
     DEFINES['TARGET_XPCOM_ABI'] = '"%s"' % CONFIG['TARGET_XPCOM_ABI']
 
+LOCAL_INCLUDES += [
+    '../build',
+]
+
 if CONFIG['ENABLE_TESTS']:
     DIRS += ['tests/gtest']
--- a/xpcom/glue/nomozalloc/Makefile.in
+++ b/xpcom/glue/nomozalloc/Makefile.in
@@ -1,20 +1,16 @@
 # 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_INSTALL	= 1
 
-LOCAL_INCLUDES	= \
-		-I$(srcdir)/../../build \
-		$(NULL)
-
 # Pretend we're statically linking the CRT, even though we might not be: this
 # avoids "msvcrp" and assembly dependencies from creeping into the directives
 # for this library on Windows.
 USE_STATIC_LIBS = 1
 
 # Don't use STL wrappers here (i.e. wrapped <new>); they require mozalloc
 STL_FLAGS       =
 
--- a/xpcom/glue/nomozalloc/moz.build
+++ b/xpcom/glue/nomozalloc/moz.build
@@ -25,8 +25,13 @@ FORCE_STATIC_LIB = True
 
 if CONFIG['_MSC_VER']:
     DEFINES['_USE_ANSI_CPP'] = True
 
 if CONFIG['TARGET_XPCOM_ABI']:
     DEFINES['TARGET_XPCOM_ABI'] = '"%s"' % CONFIG['TARGET_XPCOM_ABI']
 
 DEFINES['MOZ_NO_MOZALLOC'] = True
+
+LOCAL_INCLUDES += [
+    '../../build',
+]
+
--- a/xpcom/glue/standalone/Makefile.in
+++ b/xpcom/glue/standalone/Makefile.in
@@ -1,20 +1,16 @@
 # 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_INSTALL	= 1
 
-LOCAL_INCLUDES	= \
-	-I$(srcdir)/../../build \
-	$(NULL)
-
 # Don't use STL wrappers here (i.e. wrapped <new>); they require mozalloc
 STL_FLAGS	=
 
 include $(topsrcdir)/config/rules.mk
 
 ifdef _MSC_VER
 # Don't include directives in obj files about which CRT to use
 OS_COMPILE_CXXFLAGS += -Zl
--- a/xpcom/glue/standalone/moz.build
+++ b/xpcom/glue/standalone/moz.build
@@ -32,8 +32,13 @@ FORCE_STATIC_LIB = True
 
 if CONFIG['_MSC_VER']:
     DEFINES['_USE_ANSI_CPP'] = True
 
 DEFINES['XPCOM_GLUE'] = True
 
 if CONFIG['TARGET_XPCOM_ABI']:
     DEFINES['TARGET_XPCOM_ABI'] = '"%s"' % CONFIG['TARGET_XPCOM_ABI']
+
+LOCAL_INCLUDES += [
+    '../../build',
+]
+
--- a/xpcom/glue/standalone/staticruntime/Makefile.in
+++ b/xpcom/glue/standalone/staticruntime/Makefile.in
@@ -1,19 +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/.
 
 
 DIST_INSTALL	= 1
 
-LOCAL_INCLUDES	= \
-	-I$(srcdir)/../../../build \
-	$(NULL)
-
 # Statically link to the CRT on Windows
 USE_STATIC_LIBS = 1
 
 # Don't use STL wrappers here (i.e. wrapped <new>); they require mozalloc
 STL_FLAGS	=
 
 include $(topsrcdir)/config/rules.mk
 
--- a/xpcom/glue/standalone/staticruntime/moz.build
+++ b/xpcom/glue/standalone/staticruntime/moz.build
@@ -24,8 +24,13 @@ FORCE_STATIC_LIB = True
 
 if CONFIG['_MSC_VER']:
     DEFINES['_USE_ANSI_CPP'] = True
 
 DEFINES['XPCOM_GLUE'] = True
 
 if CONFIG['TARGET_XPCOM_ABI']:
     DEFINES['TARGET_XPCOM_ABI'] = '"%s"' % CONFIG['TARGET_XPCOM_ABI']
+
+LOCAL_INCLUDES += [
+    '../../../build',
+]
+
--- a/xpcom/glue/staticruntime/Makefile.in
+++ b/xpcom/glue/staticruntime/Makefile.in
@@ -1,20 +1,16 @@
 # 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_INSTALL	= 1
 
-LOCAL_INCLUDES	= \
-	-I$(srcdir)/../../build \
-	$(NULL)
-
 # Statically link to the CRT on Windows
 USE_STATIC_LIBS = 1
 
 # Don't use STL wrappers here (i.e. wrapped <new>); they require mozalloc
 STL_FLAGS	=
 
 include $(topsrcdir)/config/rules.mk
 
--- a/xpcom/glue/staticruntime/moz.build
+++ b/xpcom/glue/staticruntime/moz.build
@@ -22,8 +22,13 @@ SDK_LIBRARY = [
 
 FORCE_STATIC_LIB = True
 
 if CONFIG['_MSC_VER']:
     DEFINES['_USE_ANSI_CPP'] = True
 
 if CONFIG['TARGET_XPCOM_ABI']:
     DEFINES['TARGET_XPCOM_ABI'] = '"%s"' % CONFIG['TARGET_XPCOM_ABI']
+
+LOCAL_INCLUDES += [
+    '../../build',
+]
+
--- a/xpcom/reflect/xptcall/src/md/os2/Makefile.in
+++ b/xpcom/reflect/xptcall/src/md/os2/Makefile.in
@@ -1,14 +1,6 @@
 #
 # 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/.
 
 MOZILLA_INTERNAL_API = 1
-
-LOCAL_INCLUDES = \
-		-I$(srcdir)/../unix \
-		-I$(srcdir)/../../../../xptinfo/src \
-		$(NULL)
-include $(topsrcdir)/config/rules.mk
-
-LOCAL_INCLUDES	+= -I$(srcdir)/../..
--- a/xpcom/reflect/xptcall/src/md/os2/moz.build
+++ b/xpcom/reflect/xptcall/src/md/os2/moz.build
@@ -7,8 +7,15 @@
 SOURCES += [
     '../unix/xptcinvoke_gcc_x86_unix.cpp',
     'xptcstubs_gcc_x86_os2.cpp',
 ]
 
 FINAL_LIBRARY = 'xpcom_core'
 
 DEFINES['MOZ_NEED_LEADING_UNDERSCORE'] = True
+
+LOCAL_INCLUDES += [
+    '../..',
+    '../../../../xptinfo/src',
+    '../unix',
+]
+
--- a/xpcom/reflect/xptcall/src/md/unix/Makefile.in
+++ b/xpcom/reflect/xptcall/src/md/unix/Makefile.in
@@ -91,21 +91,16 @@ CXXFLAGS	+= -fno-strict-aliasing -fno-in
 endif
 
 ifeq ($(OS_ARCH)$(OS_TEST),Linuxs390x)
 CXXFLAGS	+= -fno-strict-aliasing -fno-inline -fomit-frame-pointer -mbackchain
 endif
 
 include $(topsrcdir)/config/rules.mk
 
-LOCAL_INCLUDES += \
-	-I$(srcdir)/../.. \
-	-I$(srcdir)/../../../../xptinfo/src \
-	$(NULL)
-
 ifeq ($(OS_ARCH),Linux)
 ifneq (,$(findstring mips, $(OS_TEST)))
 xptcstubs_asm_mips.o: $(DIST)/include/xptcstubsdef.inc
 endif
 endif
 
 ifeq ($(OS_ARCH),Darwin)
 xptcstubs_asm_ppc_darwin.s: xptcstubs_asm_ppc_darwin.s.m4 $(DIST)/include/xptcstubsdef.inc Makefile
--- a/xpcom/reflect/xptcall/src/md/unix/moz.build
+++ b/xpcom/reflect/xptcall/src/md/unix/moz.build
@@ -304,9 +304,14 @@ if CONFIG['OS_ARCH'] == 'Linux':
     elif CONFIG['OS_TEST'] == 's390x':
         SOURCES += [
             'xptcinvoke_linux_s390x.cpp',
             'xptcstubs_linux_s390x.cpp',
         ]
 
 FINAL_LIBRARY = 'xpcom_core'
 
+LOCAL_INCLUDES += [
+    '../..',
+    '../../../../xptinfo/src',
+]
+
 NO_PGO = True
--- a/xpcom/reflect/xptcall/src/md/win32/Makefile.in
+++ b/xpcom/reflect/xptcall/src/md/win32/Makefile.in
@@ -1,12 +1,6 @@
 #
 # 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/.
 
 MOZILLA_INTERNAL_API = 1
-
-LOCAL_INCLUDES += -I$(srcdir)/../../../../xptinfo/src
-
-include $(topsrcdir)/config/rules.mk
-
-LOCAL_INCLUDES	+= -I$(srcdir)/../..
--- a/xpcom/reflect/xptcall/src/md/win32/moz.build
+++ b/xpcom/reflect/xptcall/src/md/win32/moz.build
@@ -31,12 +31,17 @@ else:
     else:
         SOURCES += [
             'xptcinvoke.cpp',
             'xptcstubs.cpp',
         ]
 
 FINAL_LIBRARY = 'xpcom_core'
 
+LOCAL_INCLUDES += [
+    '../..',
+    '../../../../xptinfo/src',
+]
+
 if CONFIG['TARGET_CPU'] != 'x86_64':
     if not CONFIG['GNU_CXX']:
         # FIXME: bug 413019
         NO_PGO = True
--- a/xpcom/tests/Makefile.in
+++ b/xpcom/tests/Makefile.in
@@ -4,20 +4,16 @@
 
 LIBS += $(XPCOM_LIBS)
 
 # Make sure we have symbols in case we need to debug these.
 MOZ_DEBUG_SYMBOLS = 1
 
 include $(topsrcdir)/config/rules.mk
 
-LOCAL_INCLUDES	= \
-                -I$(srcdir)/../ds \
-		$(NULL)
-
 libs::
 	$(INSTALL) $(srcdir)/test.properties $(DIST)/bin/res
 ifneq (,$(SIMPLE_PROGRAMS))
 	$(INSTALL) $(SIMPLE_PROGRAMS) $(DEPTH)/_tests/xpcshell/$(relativesrcdir)/unit
 endif
 
 ifeq (,$(filter-out WINNT os2-emx, $(HOST_OS_ARCH)))
 getnativepath = $(call normalizepath,$(1))
--- a/xpcom/tests/moz.build
+++ b/xpcom/tests/moz.build
@@ -112,8 +112,13 @@ if CONFIG['MOZ_DEBUG'] and CONFIG['OS_AR
         'TestDeadlockDetector.cpp',
         'TestDeadlockDetectorScalability.cpp',
     ]
 
 if not CONFIG['MOZILLA_INTERNAL_API']:
     CPP_UNIT_TESTS += [
         'TestStringAPI.cpp',
     ]
+
+LOCAL_INCLUDES += [
+    '../ds',
+]
+
deleted file mode 100644
--- a/xpfe/components/build/Makefile.in
+++ /dev/null
@@ -1,6 +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)/../directory
--- a/xpfe/components/build/moz.build
+++ b/xpfe/components/build/moz.build
@@ -6,8 +6,12 @@
 
 SOURCES += [
     'nsModule.cpp',
 ]
 
 LIBRARY_NAME = 'appcomps'
 
 FINAL_LIBRARY = 'xul'
+
+LOCAL_INCLUDES += [
+    '../directory',
+]