diff --git a/content/html/document/src/Makefile.in b/content/html/document/src/Makefile.in
deleted file mode 100644
index c9b334ae06c..00000000000
--- a/content/html/document/src/Makefile.in
+++ /dev/null
@@ -1,16 +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)/../../../events/src \
- -I$(srcdir)/../../content/src \
- -I$(topsrcdir)/layout/style \
- -I$(topsrcdir)/dom/base \
- -I$(topsrcdir)/caps/include \
- -I$(topsrcdir)/xpcom/ds \
- $(NULL)
diff --git a/content/html/document/src/moz.build b/content/html/document/src/moz.build
index 7aa28a3c192..5515a31fd5f 100644
--- a/content/html/document/src/moz.build
+++ b/content/html/document/src/moz.build
@@ -33,3 +33,12 @@ LIBXUL_LIBRARY = True
MSVC_ENABLE_PGO = True
+LOCAL_INCLUDES += [
+ '../../content/src',
+ '/caps/include',
+ '/content/base/src',
+ '/content/events/src',
+ '/dom/base',
+ '/layout/style',
+ '/xpcom/ds',
+]
diff --git a/content/media/mediasource/Makefile.in b/content/media/mediasource/Makefile.in
deleted file mode 100644
index 6fbe8159b2d..00000000000
--- a/content/media/mediasource/Makefile.in
+++ /dev/null
@@ -1,3 +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/.
diff --git a/content/media/plugins/Makefile.in b/content/media/plugins/Makefile.in
deleted file mode 100644
index 9e99f02e7a4..00000000000
--- a/content/media/plugins/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
-
-INCLUDES += \
- -I$(srcdir)/../../base/src \
- -I$(srcdir)/../../html/content/src \
- $(NULL)
diff --git a/content/media/plugins/moz.build b/content/media/plugins/moz.build
index 729551df317..9ce356cff8a 100644
--- a/content/media/plugins/moz.build
+++ b/content/media/plugins/moz.build
@@ -25,3 +25,7 @@ LIBRARY_NAME = 'gkconmediaplugins_s'
LIBXUL_LIBRARY = True
+LOCAL_INCLUDES += [
+ '/content/base/src',
+ '/content/html/content/src',
+ ]
diff --git a/content/smil/Makefile.in b/content/smil/Makefile.in
deleted file mode 100644
index e127ed31561..00000000000
--- a/content/smil/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/.
-
-LOCAL_INCLUDES += \
- -I$(srcdir)/../base/src \
- -I$(srcdir)/../../layout/style \
- -I$(srcdir)/../events/src \
- $(NULL)
diff --git a/content/smil/moz.build b/content/smil/moz.build
index 0e4c6f74569..2892d20f10f 100644
--- a/content/smil/moz.build
+++ b/content/smil/moz.build
@@ -67,3 +67,8 @@ LIBXUL_LIBRARY = True
LIBRARY_NAME = 'gkconsmil_s'
+LOCAL_INCLUDES += [
+ '../base/src',
+ '../events/src',
+ '/layout/style',
+]
diff --git a/content/svg/document/src/Makefile.in b/content/svg/document/src/Makefile.in
deleted file mode 100644
index fe72b0d45a8..00000000000
--- a/content/svg/document/src/Makefile.in
+++ /dev/null
@@ -1,17 +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) \
- -I$(srcdir)/../../../xml/document/src \
- -I$(srcdir)/../../../html/document/src \
- -I$(srcdir)/../../../../layout/style \
- -I$(srcdir)/../../../base/src \
- -I$(srcdir)/../../../events/src \
- -I$(topsrcdir)/xpcom/ds \
- -I$(topsrcdir)/content/svg/content/src \
- $(NULL)
diff --git a/content/svg/document/src/moz.build b/content/svg/document/src/moz.build
index d0723654f0f..b5b5f8264f8 100644
--- a/content/svg/document/src/moz.build
+++ b/content/svg/document/src/moz.build
@@ -20,3 +20,12 @@ FAIL_ON_WARNINGS = True
LIBXUL_LIBRARY = True
+LOCAL_INCLUDES += [
+ '/content/base/src',
+ '/content/events/src',
+ '/content/html/document/src',
+ '/content/svg/content/src',
+ '/content/xml/document/src',
+ '/layout/style',
+ '/xpcom/ds',
+]
diff --git a/content/xbl/src/Makefile.in b/content/xbl/src/Makefile.in
deleted file mode 100644
index a0f13f47b16..00000000000
--- a/content/xbl/src/Makefile.in
+++ /dev/null
@@ -1,18 +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)/../../html/document/src \
- -I$(srcdir)/../../xml/document/src \
- -I$(srcdir)/../../xul/content/src \
- -I$(srcdir)/../../xul/document/src \
- -I$(srcdir)/../../events/src \
- -I$(srcdir)/../../../layout/style \
- -I$(srcdir)/../../../dom/base \
- -I$(topsrcdir)/xpcom/ds \
- $(NULL)
diff --git a/content/xbl/src/moz.build b/content/xbl/src/moz.build
index e3cfed1451f..71a1f0537e4 100644
--- a/content/xbl/src/moz.build
+++ b/content/xbl/src/moz.build
@@ -44,3 +44,14 @@ MSVC_ENABLE_PGO = True
LIBRARY_NAME = 'gkconxbl_s'
+LOCAL_INCLUDES += [
+ '/content/base/src',
+ '/content/events/src',
+ '/content/html/document/src',
+ '/content/xml/document/src',
+ '/content/xul/content/src',
+ '/content/xul/document/src',
+ '/dom/base',
+ '/layout/style',
+ '/xpcom/ds',
+]
diff --git a/content/xml/document/src/Makefile.in b/content/xml/document/src/Makefile.in
deleted file mode 100644
index 0bdbcd70a1e..00000000000
--- a/content/xml/document/src/Makefile.in
+++ /dev/null
@@ -1,18 +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) \
- -I$(srcdir)/../../../html/document/src \
- -I$(srcdir)/../../../../layout/style \
- -I$(srcdir)/../../../base/src \
- -I$(srcdir)/../../../xul/content/src \
- -I$(srcdir)/../../../events/src \
- -I$(srcdir)/../../../../dom/base \
- -I$(srcdir)/../../../../caps/include \
- -I$(topsrcdir)/xpcom/ds \
- $(NULL)
diff --git a/content/xml/document/src/moz.build b/content/xml/document/src/moz.build
index 105fe79cff1..d7770082265 100644
--- a/content/xml/document/src/moz.build
+++ b/content/xml/document/src/moz.build
@@ -25,3 +25,13 @@ LIBXUL_LIBRARY = True
MSVC_ENABLE_PGO = True
+LOCAL_INCLUDES += [
+ '/caps/include',
+ '/content/base/src',
+ '/content/events/src',
+ '/content/html/document/src',
+ '/content/xul/content/src',
+ '/dom/base',
+ '/layout/style',
+ '/xpcom/ds',
+ ]
diff --git a/content/xslt/src/base/Makefile.in b/content/xslt/src/base/Makefile.in
deleted file mode 100644
index c967747abe0..00000000000
--- a/content/xslt/src/base/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/.
-
-include $(topsrcdir)/config/rules.mk
-
-INCLUDES += \
- -I$(srcdir)/../../public \
- -I$(srcdir) \
- -I$(srcdir)/../xml \
- -I$(srcdir)/../xpath \
- -I$(srcdir)/../xslt \
- $(NULL)
diff --git a/content/xslt/src/base/moz.build b/content/xslt/src/base/moz.build
index 073bd662fe4..23f8719f328 100644
--- a/content/xslt/src/base/moz.build
+++ b/content/xslt/src/base/moz.build
@@ -20,3 +20,9 @@ FAIL_ON_WARNINGS = True
LIBXUL_LIBRARY = True
+LOCAL_INCLUDES += [
+ '../../public',
+ '../xml',
+ '../xpath',
+ '../xslt',
+]
diff --git a/content/xslt/src/xml/Makefile.in b/content/xslt/src/xml/Makefile.in
deleted file mode 100644
index 225e6c8041d..00000000000
--- a/content/xslt/src/xml/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/.
-
-include $(topsrcdir)/config/rules.mk
-
-INCLUDES += \
- -I$(srcdir)/../base \
- -I$(srcdir) \
- -I$(srcdir)/../xpath \
- -I$(srcdir)/../xslt \
- -I$(srcdir)/../../../base/src \
- $(NULL)
diff --git a/content/xslt/src/xml/moz.build b/content/xslt/src/xml/moz.build
index 471e2db7c0f..d1d85e57190 100644
--- a/content/xslt/src/xml/moz.build
+++ b/content/xslt/src/xml/moz.build
@@ -17,3 +17,9 @@ FAIL_ON_WARNINGS = True
LIBXUL_LIBRARY = True
+LOCAL_INCLUDES += [
+ '../base',
+ '../xpath',
+ '../xslt',
+ '/content/base/src',
+]
diff --git a/content/xslt/src/xpath/Makefile.in b/content/xslt/src/xpath/Makefile.in
deleted file mode 100644
index 462cf326fc8..00000000000
--- a/content/xslt/src/xpath/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
-
-INCLUDES += \
- -I$(srcdir)/../base \
- -I$(srcdir)/../xml \
- -I$(srcdir) \
- -I$(srcdir)/../xslt \
- $(NULL)
diff --git a/content/xslt/src/xpath/moz.build b/content/xslt/src/xpath/moz.build
index 23e60da2f68..33422fb1d47 100644
--- a/content/xslt/src/xpath/moz.build
+++ b/content/xslt/src/xpath/moz.build
@@ -57,3 +57,8 @@ FAIL_ON_WARNINGS = True
LIBXUL_LIBRARY = True
+LOCAL_INCLUDES += [
+ '../base',
+ '../xml',
+ '../xslt',
+]
diff --git a/content/xslt/src/xslt/Makefile.in b/content/xslt/src/xslt/Makefile.in
deleted file mode 100644
index 2388cc5d542..00000000000
--- a/content/xslt/src/xslt/Makefile.in
+++ /dev/null
@@ -1,18 +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 nsDependentJSString
-LOCAL_INCLUDES += \
- -I$(topsrcdir)/dom/base \
- $(NULL)
-
-include $(topsrcdir)/config/rules.mk
-
-INCLUDES += \
- -I$(srcdir) \
- -I$(srcdir)/../base \
- -I$(srcdir)/../xml \
- -I$(srcdir)/../xpath \
- -I$(srcdir)/../../../base/src \
- $(NULL)
diff --git a/content/xslt/src/xslt/moz.build b/content/xslt/src/xslt/moz.build
index c86961f4263..5ecc48c310b 100644
--- a/content/xslt/src/xslt/moz.build
+++ b/content/xslt/src/xslt/moz.build
@@ -50,3 +50,12 @@ FAIL_ON_WARNINGS = True
LIBXUL_LIBRARY = True
+# For nsDependentJSString
+LOCAL_INCLUDES += ["/dom/base"]
+
+LOCAL_INCLUDES += [
+ '../base',
+ '../xml',
+ '../xpath',
+ '/content/base/src',
+]
diff --git a/content/xul/content/src/Makefile.in b/content/xul/content/src/Makefile.in
deleted file mode 100644
index 385bcdf8e44..00000000000
--- a/content/xul/content/src/Makefile.in
+++ /dev/null
@@ -1,21 +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)/../../document/src \
- -I$(srcdir)/../../templates/src \
- -I$(srcdir)/../../../xml/content/src \
- -I$(srcdir)/../../../base/src \
- -I$(srcdir)/../../../xml/document/src \
- -I$(srcdir)/../../../../layout/generic \
- -I$(srcdir)/../../../../layout/style \
- -I$(srcdir)/../../../../layout/xul/base/src \
- -I$(srcdir)/../../../html/content/src \
- -I$(srcdir)/../../../events/src \
- -I$(srcdir)/../../../xbl/src \
- -I$(topsrcdir)/xpcom/ds \
- $(NULL)
diff --git a/content/xul/content/src/moz.build b/content/xul/content/src/moz.build
index 2c209b0cf72..e34d55b3f07 100644
--- a/content/xul/content/src/moz.build
+++ b/content/xul/content/src/moz.build
@@ -19,3 +19,17 @@ if CONFIG['MOZ_XUL']:
FAIL_ON_WARNINGS = True
+LOCAL_INCLUDES += [
+ '../../document/src',
+ '../../templates/src',
+ '/content/base/src',
+ '/content/events/src',
+ '/content/html/content/src',
+ '/content/xbl/src',
+ '/content/xml/content/src',
+ '/content/xml/document/src',
+ '/layout/generic',
+ '/layout/style',
+ '/layout/xul/base/src',
+ '/xpcom/ds',
+]
diff --git a/content/xul/document/src/Makefile.in b/content/xul/document/src/Makefile.in
deleted file mode 100644
index f956dda749a..00000000000
--- a/content/xul/document/src/Makefile.in
+++ /dev/null
@@ -1,20 +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)/../../templates/src \
- -I$(srcdir)/../../../../layout/base \
- -I$(srcdir)/../../../../layout/generic \
- -I$(srcdir)/../../../../layout/style \
- -I$(srcdir)/../../../../layout/xul/base/src \
- -I$(srcdir)/../../../xml/document/src \
- -I$(srcdir)/../../../xbl/src \
- -I$(srcdir)/../../../events/src \
- -I$(topsrcdir)/xpcom/ds \
- -I$(topsrcdir)/dom/base \
- $(NULL)
diff --git a/content/xul/document/src/moz.build b/content/xul/document/src/moz.build
index 04924010927..d8fb48e9034 100644
--- a/content/xul/document/src/moz.build
+++ b/content/xul/document/src/moz.build
@@ -27,3 +27,17 @@ LIBXUL_LIBRARY = True
MSVC_ENABLE_PGO = True
+LOCAL_INCLUDES += [
+ '/content/base/src',
+ '/content/events/src',
+ '/content/xbl/src',
+ '/content/xml/document/src',
+ '/content/xul/content/src',
+ '/content/xul/templates/src',
+ '/dom/base',
+ '/layout/base',
+ '/layout/generic',
+ '/layout/style',
+ '/layout/xul/base/src',
+ '/xpcom/ds',
+]
diff --git a/content/xul/templates/src/Makefile.in b/content/xul/templates/src/Makefile.in
deleted file mode 100644
index 390009456a5..00000000000
--- a/content/xul/templates/src/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)/../../../../dom/base \
- -I$(srcdir)/../../../../layout/xul/tree/ \
- $(NULL)
diff --git a/content/xul/templates/src/moz.build b/content/xul/templates/src/moz.build
index 9317155aba5..a9f05d4a819 100644
--- a/content/xul/templates/src/moz.build
+++ b/content/xul/templates/src/moz.build
@@ -41,3 +41,9 @@ LIBXUL_LIBRARY = True
MSVC_ENABLE_PGO = True
+LOCAL_INCLUDES += [
+ '../../content/src',
+ '/content/base/src',
+ '/dom/base',
+ '/layout/xul/tree/',
+]