Bug 865673 - Convert objs.mk to objs.mozbuild. r=gps
authorBrian O'Keefe <bokeefe@alum.wpi.edu>
Fri, 30 Aug 2013 09:09:06 -0400
changeset 148562 0d87616d0acf6600513ea6574d424711e30235c2
parent 148561 dd8abf7ff87fcbd0f86bc2f57f802685bfdf6a4d
child 148563 e67dad88f86054c1d90adb48ce671177a3d6f119
push idunknown
push userunknown
push dateunknown
reviewersgps
bugs865673
milestone26.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 865673 - Convert objs.mk to objs.mozbuild. r=gps
intl/unicharutil/util/Makefile.in
intl/unicharutil/util/internal/Makefile.in
intl/unicharutil/util/internal/moz.build
intl/unicharutil/util/moz.build
intl/unicharutil/util/objs.mk
intl/unicharutil/util/objs.mozbuild
media/mtransport/build/Makefile.in
media/mtransport/build/moz.build
media/mtransport/objs.mk
media/mtransport/objs.mozbuild
media/mtransport/standalone/Makefile.in
media/mtransport/standalone/moz.build
profile/dirserviceprovider/src/Makefile.in
profile/dirserviceprovider/src/moz.build
profile/dirserviceprovider/src/objs.mk
profile/dirserviceprovider/src/objs.mozbuild
profile/dirserviceprovider/standalone/Makefile.in
profile/dirserviceprovider/standalone/moz.build
rdf/util/src/Makefile.in
rdf/util/src/internal/Makefile.in
rdf/util/src/internal/moz.build
rdf/util/src/moz.build
rdf/util/src/objs.mk
rdf/util/src/objs.mozbuild
toolkit/library/Makefile.in
toolkit/library/moz.build
toolkit/mozapps/update/updater/Makefile.in
toolkit/mozapps/update/updater/archivereader.cpp
toolkit/profile/Makefile.in
toolkit/profile/moz.build
xpcom/build/Makefile.in
xpcom/build/moz.build
xpcom/glue/Makefile.in
xpcom/glue/moz.build
xpcom/glue/nomozalloc/Makefile.in
xpcom/glue/nomozalloc/moz.build
xpcom/glue/objs.mk
xpcom/glue/objs.mozbuild
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
--- a/intl/unicharutil/util/Makefile.in
+++ b/intl/unicharutil/util/Makefile.in
@@ -2,18 +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/.
 
 # This makefile builds the unicharutil_external_s library which should be used
 # by frozen (dependent) linkage components. Internal-linkage code should use
 # unicharutil_s which is built in the internal/ subdirectory.
 
-include $(srcdir)/objs.mk
-
 DIST_INSTALL = 1
 SDK_LIBRARY = $(LIBRARY)
 
 FORCE_STATIC_LIB = 1
 USE_STATIC_LIBS = 1
 
 LOCAL_INCLUDES += -I$(srcdir)/../src
 
--- a/intl/unicharutil/util/internal/Makefile.in
+++ b/intl/unicharutil/util/internal/Makefile.in
@@ -6,24 +6,14 @@
 # This makefile builds the version of unicharutils_s static library which uses
 # internal linkage. Components that use frozen (external) linkage should use
 # unicharutil_external_s.
 
 DIST_INSTALL = 1
 EXPORT_LIBRARY = 1
 MOZILLA_INTERNAL_API = 1
 
-include $(srcdir)/../objs.mk
-
-EXTRA_DEPS += $(srcdir)/../objs.mk
-
 LOCAL_INCLUDES	+= -I$(srcdir)/.. \
   -I$(srcdir)/../../src
 
-
 FORCE_STATIC_LIB = 1
 
 include $(topsrcdir)/config/rules.mk
-
-$(INTL_UNICHARUTIL_UTIL_LCPPSRCS): %: $(srcdir)/../%
-	$(INSTALL) $^ .
-
-GARBAGE += $(INTL_UNICHARUTIL_UTIL_LCPPSRCS)
--- a/intl/unicharutil/util/internal/moz.build
+++ b/intl/unicharutil/util/internal/moz.build
@@ -1,14 +1,14 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 MODULE = 'unicharutil'
 
-CPP_SOURCES += [
-    '$(INTL_UNICHARUTIL_UTIL_LCPPSRCS)',
-]
+include('../objs.mozbuild')
+
+CPP_SOURCES += intl_unicharutil_util_cppsrcs
 
 LIBRARY_NAME = 'unicharutil_s'
 
--- a/intl/unicharutil/util/moz.build
+++ b/intl/unicharutil/util/moz.build
@@ -11,16 +11,13 @@ MODULE = 'unicharutil'
 EXPORTS += [
     'nsBidiUtils.h',
     'nsSpecialCasingData.h',
     'nsUnicharUtils.h',
     'nsUnicodeProperties.h',
     'nsUnicodeScriptCodes.h',
 ]
 
-CPP_SOURCES += [
-    'nsBidiUtils.cpp',
-    'nsSpecialCasingData.cpp',
-    'nsUnicharUtils.cpp',
-    'nsUnicodeProperties.cpp',
-]
+include('objs.mozbuild')
+
+CPP_SOURCES += intl_unicharutil_util_cppsrcs
 
 LIBRARY_NAME = 'unicharutil_external_s'
deleted file mode 100644
--- a/intl/unicharutil/util/objs.mk
+++ /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/.
-
-INTL_UNICHARUTIL_UTIL_LCPPSRCS = \
-	nsUnicharUtils.cpp \
-	nsBidiUtils.cpp \
-	nsSpecialCasingData.cpp \
-	nsUnicodeProperties.cpp \
-	$(NULL)
-
-INTL_UNICHARUTIL_UTIL_CPPSRCS = $(addprefix $(topsrcdir)/intl/unicharutil/util/, $(INTL_UNICHARUTIL_UTIL_LCPPSRCS))
new file mode 100644
--- /dev/null
+++ b/intl/unicharutil/util/objs.mozbuild
@@ -0,0 +1,17 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+intl_unicharutil_util_lcppsrcs = [
+    'nsBidiUtils.cpp',
+    'nsSpecialCasingData.cpp',
+    'nsUnicharUtils.cpp',
+    'nsUnicodeProperties.cpp',
+]
+
+intl_unicharutil_util_cppsrcs = [
+    '%s/intl/unicharutil/util/%s' % (TOPSRCDIR, s) \
+        for s in intl_unicharutil_util_lcppsrcs
+]
--- a/media/mtransport/build/Makefile.in
+++ b/media/mtransport/build/Makefile.in
@@ -1,24 +1,48 @@
 # -*- Mode: makefile; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- #
 # 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/.
-EXTRA_DEPS += $(srcdir)/../objs.mk
 
 ifeq (WINNT,$(OS_TARGET))
 VISIBILITY_FLAGS =
 endif
 
-include $(srcdir)/../objs.mk
+DEFINES += -DHAVE_STRDUP -DNR_SOCKET_IS_VOID_PTR
 
+ifneq (,$(filter Darwin DragonFly FreeBSD NetBSD OpenBSD,$(OS_TARGET)))
+ifeq ($(OS_TARGET), Darwin)
+DEFINES += -DDARWIN
+else
+DEFINES += -DBSD
+endif
+endif
+
+ifeq ($(OS_TARGET), Linux)
+DEFINES += -DLINUX -DUSE_INTERFACE_PRIORITIZER
+endif
 
-# Make a copy into the local directory for dual compilation
-export:: $(MTRANSPORT_CPPSRCS)
-	$(INSTALL) $^ .
+ifeq ($(OS_TARGET), Android)
+DEFINES += -DLINUX -DANDROID
+endif
+
+ifeq ($(OS_TARGET), WINNT)
+DEFINES += -DWIN
+endif
+
+DEFINES += \
+   -DR_DEFINED_INT2=int16_t -DR_DEFINED_UINT2=uint16_t \
+   -DR_DEFINED_INT4=int32_t -DR_DEFINED_UINT4=uint32_t \
+   -DR_DEFINED_INT8=int64_t -DR_DEFINED_UINT8=uint64_t \
+   $(NULL)
+
+ifeq (gonk,$(MOZ_WIDGET_TOOLKIT))
+DEFINES += -DUSE_INTERFACE_PRIORITIZER
+endif
 
 # for stun.h
 ifeq (WINNT,$(OS_TARGET))
 DEFINES += \
   -DWIN32 \
   -DNOMINMAX \
   $(NULL)
 else ifeq (Linux,$(OS_TARGET))
--- a/media/mtransport/build/moz.build
+++ b/media/mtransport/build/moz.build
@@ -19,18 +19,55 @@ EXPORTS.mtransport += [
     '../transportlayer.h',
     '../transportlayerdtls.h',
     '../transportlayerice.h',
     '../transportlayerlog.h',
     '../transportlayerloopback.h',
     '../transportlayerprsock.h',
 ]
 
-CPP_SOURCES += [
-    '$(MTRANSPORT_LCPPSRCS)',
-]
+include('../objs.mozbuild')
+
+CPP_SOURCES += mtransport_cppsrcs
 
 LIBRARY_NAME = 'mtransport'
 
 FAIL_ON_WARNINGS = not CONFIG['_MSC_VER']
 
 LIBXUL_LIBRARY = True
 
+LOCAL_INCLUDES = [
+    '/media/webrtc/trunk/third_party/libjingle/source/',
+]
+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/port/generic/include',
+    '/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/libekr',
+]
+
+if CONFIG['OS_TARGET'] in ['Darwin', 'DragonFly', 'FreeBSD', 'NetBSD', 'OpenBSD']:
+    LOCAL_INCLUDES += [
+        '/media/mtransport/third_party/nrappkit/src/port/darwin/include',
+    ]
+elif CONFIG['OS_TARGET'] == 'Linux':
+    LOCAL_INCLUDES += [
+        '/media/mtransport/third_party/nrappkit/src/port/linux/include',
+    ]
+elif CONFIG['OS_TARGET'] == 'Android':
+    LOCAL_INCLUDES += [
+        '/media/mtransport/third_party/nrappkit/src/port/android/include',
+    ]
+elif CONFIG['OS_TARGET'] == 'WINNT':
+    LOCAL_INCLUDES += [
+        '/media/mtransport/third_party/nrappkit/src/port/win32/include',
+    ]
deleted file mode 100644
--- a/media/mtransport/objs.mk
+++ /dev/null
@@ -1,94 +0,0 @@
-# -*- Mode: makefile; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- #
-# 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/.
-DEFINES += -DHAVE_STRDUP -DNR_SOCKET_IS_VOID_PTR
-
-LOCAL_INCLUDES += \
- -I. \
- -I$(topsrcdir)/media/webrtc/trunk/third_party/libjingle/source/ \
- -I$(topsrcdir)/media/mtransport/ \
- -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/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 \
-  -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/generic/include \
-  $(NULL)
-ifeq ($(OS_TARGET), Darwin)
-DEFINES += -DDARWIN
-else
-DEFINES += -DBSD
-endif
-endif
-
-ifeq ($(OS_TARGET), Linux)
-LOCAL_INCLUDES += \
-  -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/linux/include \
-  -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/generic/include \
-  $(NULL)
-DEFINES += -DLINUX -DUSE_INTERFACE_PRIORITIZER
-endif
-
-ifeq ($(OS_TARGET), Android)
-LOCAL_INCLUDES += \
-  -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/android/include \
-  -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/generic/include \
-  $(NULL)
-DEFINES += -DLINUX -DANDROID
-endif
-
-ifeq ($(OS_TARGET), WINNT)
-LOCAL_INCLUDES += \
-  -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/win32/include \
-  -I$(topsrcdir)/media/mtransport/third_party/nrappkit/src/port/generic/include \
-  $(NULL)
-DEFINES += -DWIN
-endif
-
-DEFINES += \
-   -DR_DEFINED_INT2=int16_t -DR_DEFINED_UINT2=uint16_t \
-   -DR_DEFINED_INT4=int32_t -DR_DEFINED_UINT4=uint32_t \
-   -DR_DEFINED_INT8=int64_t -DR_DEFINED_UINT8=uint64_t \
-   $(NULL)
-
-MTRANSPORT_LCPPSRCS = \
-  dtlsidentity.cpp \
-  nricectx.cpp \
-  nricemediastream.cpp \
-  nriceresolverfake.cpp \
-  nriceresolver.cpp \
-  nrinterfaceprioritizer.cpp \
-  nr_socket_prsock.cpp \
-  nr_timer.cpp \
-  transportflow.cpp \
-  transportlayer.cpp \
-  transportlayerice.cpp \
-  transportlayerdtls.cpp \
-  transportlayerlog.cpp \
-  transportlayerloopback.cpp \
-  transportlayerprsock.cpp \
-  $(NULL)
-
-ifeq (gonk,$(MOZ_WIDGET_TOOLKIT))
-MTRANSPORT_LCPPSRCS += \
-  gonk_addrs.cpp \
-  $(NULL)
-DEFINES += -DUSE_INTERFACE_PRIORITIZER
-endif
-
-MTRANSPORT_CPPSRCS = $(addprefix $(topsrcdir)/media/mtransport/, $(MTRANSPORT_LCPPSRCS))
-
new file mode 100644
--- /dev/null
+++ b/media/mtransport/objs.mozbuild
@@ -0,0 +1,33 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+mtransport_lcppsrcs = [
+    'dtlsidentity.cpp',
+    'nricectx.cpp',
+    'nricemediastream.cpp',
+    'nriceresolverfake.cpp',
+    'nriceresolver.cpp',
+    'nrinterfaceprioritizer.cpp',
+    'nr_socket_prsock.cpp',
+    'nr_timer.cpp',
+    'transportflow.cpp',
+    'transportlayer.cpp',
+    'transportlayerice.cpp',
+    'transportlayerdtls.cpp',
+    'transportlayerlog.cpp',
+    'transportlayerloopback.cpp',
+    'transportlayerprsock.cpp',
+]
+
+if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk':
+    mtransport_lcppsrcs += [
+        'gonk_addrs.cpp',
+    ]
+
+mtransport_lcppsrcs.sort()
+mtransport_cppsrcs = [ 
+    '%s/media/mtransport/%s' % (TOPSRCDIR, s) for s in mtransport_lcppsrcs
+]
--- a/media/mtransport/standalone/Makefile.in
+++ b/media/mtransport/standalone/Makefile.in
@@ -1,28 +1,52 @@
 # -*- Mode: makefile; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- #
 # 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 $(srcdir)/../objs.mk
-
-EXTRA_DEPS += $(srcdir)/../objs.mk
 
 FORCE_STATIC_LIB= 1
 ifeq (WINNT,$(OS_TARGET))
 VISIBILITY_FLAGS =
 endif
 
-# Make a copy into the local directory for dual compilation
-export:: $(MTRANSPORT_CPPSRCS)
-	$(INSTALL) $^ .
+DEFINES += -DHAVE_STRDUP -DNR_SOCKET_IS_VOID_PTR
+
+ifneq (,$(filter Darwin DragonFly FreeBSD NetBSD OpenBSD,$(OS_TARGET)))
+ifeq ($(OS_TARGET), Darwin)
+DEFINES += -DDARWIN
+else
+DEFINES += -DBSD
+endif
+endif
+
+ifeq ($(OS_TARGET), Linux)
+DEFINES += -DLINUX -DUSE_INTERFACE_PRIORITIZER
+endif
+
+ifeq ($(OS_TARGET), Android)
+DEFINES += -DLINUX -DANDROID
+endif
+
+ifeq ($(OS_TARGET), WINNT)
+DEFINES += -DWIN
+endif
+
+DEFINES += \
+   -DR_DEFINED_INT2=int16_t -DR_DEFINED_UINT2=uint16_t \
+   -DR_DEFINED_INT4=int32_t -DR_DEFINED_UINT4=uint32_t \
+   -DR_DEFINED_INT8=int64_t -DR_DEFINED_UINT8=uint64_t \
+   $(NULL)
+
+ifeq (gonk,$(MOZ_WIDGET_TOOLKIT))
+DEFINES += -DUSE_INTERFACE_PRIORITIZER
+endif
 
 # for stun.h
 ifeq (WINNT,$(OS_TARGET))
 DEFINES += \
   -DWIN32 \
   -DNOMINMAX \
   $(NULL)
 else ifeq (Linux,$(OS_TARGET))
 DEFINES += -DLINUX
 endif
 
-include $(srcdir)/../objs.mk
--- a/media/mtransport/standalone/moz.build
+++ b/media/mtransport/standalone/moz.build
@@ -1,14 +1,51 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 MODULE = 'mtransport_s'
 
-CPP_SOURCES += [
-    '$(MTRANSPORT_LCPPSRCS)',
-]
+include('../objs.mozbuild')
+
+CPP_SOURCES += mtransport_cppsrcs
 
 LIBRARY_NAME = 'mtransport_s'
 
+LOCAL_INCLUDES = [
+    '/media/webrtc/trunk/third_party/libjingle/source/',
+]
+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/port/generic/include',
+    '/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/libekr',
+]
+
+if CONFIG['OS_TARGET'] in ['Darwin', 'DragonFly', 'FreeBSD', 'NetBSD', 'OpenBSD']:
+    LOCAL_INCLUDES += [
+        '/media/mtransport/third_party/nrappkit/src/port/darwin/include',
+    ]
+elif CONFIG['OS_TARGET'] == 'Linux':
+    LOCAL_INCLUDES += [
+        '/media/mtransport/third_party/nrappkit/src/port/linux/include',
+    ]
+elif CONFIG['OS_TARGET'] == 'Android':
+    LOCAL_INCLUDES += [
+        '/media/mtransport/third_party/nrappkit/src/port/android/include',
+    ]
+elif CONFIG['OS_TARGET'] == 'WINNT':
+    LOCAL_INCLUDES += [
+        '/media/mtransport/third_party/nrappkit/src/port/win32/include',
+    ]
--- a/profile/dirserviceprovider/src/Makefile.in
+++ b/profile/dirserviceprovider/src/Makefile.in
@@ -1,10 +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/.
 
-include $(srcdir)/objs.mk
 
 MOZILLA_INTERNAL_API = 1
 
 # we don't want the shared lib
 FORCE_STATIC_LIB = 1
--- a/profile/dirserviceprovider/src/moz.build
+++ b/profile/dirserviceprovider/src/moz.build
@@ -1,14 +1,13 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 MODULE = 'profdirserviceprovider'
 
-CPP_SOURCES += [
-    '$(MODULES_PROFILEDIRSERVICE_SRC_LCSRCS)',
-]
+include('objs.mozbuild')
+
+CPP_SOURCES += modules_profiledirservice_src_csrcs
 
 LIBRARY_NAME = 'profdirserviceprovider_s'
-
deleted file mode 100644
--- a/profile/dirserviceprovider/src/objs.mk
+++ /dev/null
@@ -1,14 +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/.
-
-MODULES_PROFILEDIRSERVICE_SRC_LCSRCS = \
-		nsProfileDirServiceProvider.cpp \
-		$(NULL)
-
-ifdef MOZ_PROFILELOCKING
-MODULES_PROFILEDIRSERVICE_SRC_LCSRCS += nsProfileLock.cpp
-endif
-
-MODULES_PROFILEDIRSERVICE_SRC_CSRCS := $(addprefix $(topsrcdir)/profile/dirserviceprovider/src/, $(MODULES_PROFILEDIRSERVICE_SRC_LCSRCS))
new file mode 100644
--- /dev/null
+++ b/profile/dirserviceprovider/src/objs.mozbuild
@@ -0,0 +1,20 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+modules_profiledirservice_src_lcsrcs = [
+    'nsProfileDirServiceProvider.cpp',
+]
+
+if CONFIG['MOZ_PROFILELOCKING']:
+    modules_profiledirservice_src_lcsrcs += [
+        'nsProfileLock.cpp',
+    ]
+
+modules_profiledirservice_src_lcsrcs.sort()
+modules_profiledirservice_src_csrcs = [ 
+    '%s/profile/dirserviceprovider/src/%s' % (TOPSRCDIR, s) \
+        for s in modules_profiledirservice_src_lcsrcs
+]
--- a/profile/dirserviceprovider/standalone/Makefile.in
+++ b/profile/dirserviceprovider/standalone/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/.
 
-include $(srcdir)/../src/objs.mk
 
 FORCE_STATIC_LIB = 1
 
 include $(topsrcdir)/config/rules.mk
 
 LOCAL_INCLUDES = -I$(srcdir)/../src
 
 DEFINES += -DXPCOM_GLUE
 STL_FLAGS =
-
-export:: $(MODULES_PROFILEDIRSERVICE_SRC_CSRCS)
-	$(INSTALL) $^ .
-
-GARBAGE		= $(notdir $(MODULES_PROFILEDIRSERVICE_SRC_CSRCS))
--- a/profile/dirserviceprovider/standalone/moz.build
+++ b/profile/dirserviceprovider/standalone/moz.build
@@ -1,14 +1,13 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 MODULE = 'profdirserviceprovider'
 
-CPP_SOURCES += [
-    '$(MODULES_PROFILEDIRSERVICE_SRC_LCSRCS)',
-]
+include('../src/objs.mozbuild')
+
+CPP_SOURCES += modules_profiledirservice_src_csrcs
 
 LIBRARY_NAME = 'profdirserviceprovidersa_s'
-
--- a/rdf/util/src/Makefile.in
+++ b/rdf/util/src/Makefile.in
@@ -2,16 +2,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 builds the rdfutil_external_s library which should be 
 # used by frozen (dependent) linkage components. The internal-linkage code should use
 # rdfutil_s which is built in the internal/ subdirectory. 
 
-include $(srcdir)/objs.mk
-
-EXTRA_DEPS += $(srcdir)/objs.mk
-
 DIST_INSTALL = 1
 
 # we don't want the shared lib, but we want to force the creation of a static lib.
 FORCE_STATIC_LIB = 1
--- a/rdf/util/src/internal/Makefile.in
+++ b/rdf/util/src/internal/Makefile.in
@@ -2,23 +2,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/.
 
 # This makefile builds the version of unicharutils_s static library which uses
 # internal linkage. Components that use frozen (external) linkage should use
 # rdfutil_external_s.
 
-include $(srcdir)/../objs.mk
-
-EXTRA_DEPS += $(srcdir)/../objs.mk
-
 MOZILLA_INTERNAL_API = 1
 
 # we don't want the shared lib, but we want to force the creation of a static lib.
 FORCE_STATIC_LIB = 1
 
 include $(topsrcdir)/config/rules.mk
-
-$(RDF_UTIL_SRC_LCPPSRCS): %: $(srcdir)/../%
-	$(INSTALL) $^ .
-
-GARBAGE += $(RDF_UTIL_SRC_LCPPSRCS)
--- a/rdf/util/src/internal/moz.build
+++ b/rdf/util/src/internal/moz.build
@@ -1,14 +1,14 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 MODULE = 'rdfutil'
 
-CPP_SOURCES += [
-    '$(RDF_UTIL_SRC_LCPPSRCS)',
-]
+include('../objs.mozbuild')
+
+CPP_SOURCES += rdf_util_src_cppsrcs
 
 LIBRARY_NAME = 'rdfutil_s'
 
--- a/rdf/util/src/moz.build
+++ b/rdf/util/src/moz.build
@@ -3,14 +3,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/.
 
 DIRS += ['internal']
 
 MODULE = 'rdfutil'
 
-CPP_SOURCES += [
-    '$(RDF_UTIL_SRC_LCPPSRCS)',
-]
+include('objs.mozbuild')
+
+CPP_SOURCES += rdf_util_src_cppsrcs
 
 LIBRARY_NAME = 'rdfutil_external_s'
 
deleted file mode 100644
--- a/rdf/util/src/objs.mk
+++ /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/.
-
-RDF_UTIL_SRC_LCPPSRCS = \
-	nsRDFResource.cpp \
-	$(NULL)
-
-RDF_UTIL_SRC_CPPSRCS = $(addprefix $(topsrcdir)/rdf/util/src/, $(RDF_UTIL_SRC_LCPPSRCS))
new file mode 100644
--- /dev/null
+++ b/rdf/util/src/objs.mozbuild
@@ -0,0 +1,13 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+rdf_util_src_lcppsrcs = [
+    'nsRDFResource.cpp',
+]
+
+rdf_util_src_cppsrcs = [
+    '%s/rdf/util/src/%s' % (TOPSRCDIR, s) for s in rdf_util_src_lcppsrcs
+]
--- a/toolkit/library/Makefile.in
+++ b/toolkit/library/Makefile.in
@@ -1,15 +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/.
 
-include $(topsrcdir)/rdf/util/src/objs.mk
-include $(topsrcdir)/intl/unicharutil/util/objs.mk
-
 FORCE_SHARED_LIB = 1
 MOZILLA_INTERNAL_API = 1
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
 # Setting MAKE_FRAMEWORK makes DLL_PREFIX and DLL_SUFFIX be ignored when
 # setting SHARED_LIBRARY; we need to leave DLL_PREFIX and DLL_SUFFIX
 # as-is so that dependencies of the form -ltracemalloc still work.
 MAKE_FRAMEWORK=1
@@ -465,26 +462,16 @@ endif
 ifdef MOZ_WMF
 OS_LIBS += $(call EXPAND_LIBNAME,mfuuid wmcodecdspuuid strmiids)
 endif
 
 ifdef MOZ_DIRECTSHOW
 OS_LIBS += $(call EXPAND_LIBNAME,dmoguids wmcodecdspuuid strmiids msdmo)
 endif
 
-EXTRA_DEPS += \
-  $(topsrcdir)/intl/unicharutil/util/objs.mk \
-  $(topsrcdir)/rdf/util/src/objs.mk \
-  $(NULL)
-
-GARBAGE += \
-  $(INTL_UNICHARUTIL_UTIL_LCPPSRCS) \
-  $(RDF_UTIL_SRC_LCPPSRCS) \
-  $(NULL)
-
 LOCAL_INCLUDES += -I$(topsrcdir)/intl/unicharutil/util \
   -I$(topsrcdir)/intl/unicharutil/src
 
 ifneq (,$(filter OS2 WINNT,$(OS_ARCH)))
 SDK_LIBRARY = $(IMPORT_LIBRARY)
 else
 SDK_LIBRARY = $(SHARED_LIBRARY)
 endif
@@ -640,19 +627,16 @@ EFFECTIVE_LIB_PREFIX=$(DLL_PREFIX)
 EFFECTIVE_LIB_SUFFIX=$(DLL_SUFFIX)
 endif
 
 GTEST_LIB = $(EFFECTIVE_LIB_PREFIX)gtest/$(EFFECTIVE_LIB_PREFIX)$(LIBRARY_NAME)$(EFFECTIVE_LIB_SUFFIX)
 EXTRA_MDDEPEND_FILES = $(GTEST_LIB).pp
 
 include $(topsrcdir)/config/rules.mk
 
-export:: $(RDF_UTIL_SRC_CPPSRCS) $(INTL_UNICHARUTIL_UTIL_CPPSRCS)
-	$(INSTALL) $^ .
-
 # need widget/windows for resource.h (included from widget.rc)
 LOCAL_INCLUDES += \
   -I$(topsrcdir)/config \
   -I$(topsrcdir)/widget/windows \
   $(NULL)
 
 OS_LIBS += $(LIBICONV)
 
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -11,19 +11,23 @@ MODULE = 'libxul'
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     # This is going to be a framework named "XUL", not an ordinary library named
     # "libxul.dylib"
     LIBRARY_NAME = 'XUL'
 else:
     LIBRARY_NAME = 'xul'
 
+include('/rdf/util/src/objs.mozbuild')
+include('/intl/unicharutil/util/objs.mozbuild')
+
+CPP_SOURCES += intl_unicharutil_util_cppsrcs
+CPP_SOURCES += rdf_util_src_cppsrcs
+
 CPP_SOURCES += [
-    '$(INTL_UNICHARUTIL_UTIL_LCPPSRCS)',
-    '$(RDF_UTIL_SRC_LCPPSRCS)',
     'nsStaticXULComponents.cpp',
 ]
 
 if CONFIG['OS_ARCH'] == 'WINNT':
     CPP_SOURCES += [
         'nsDllMain.cpp',
     ]
     if not CONFIG['GNU_CC']:
@@ -42,9 +46,8 @@ if CONFIG['OS_ARCH'] == 'OS2':
         'nsGFXDeps.cpp',
     ]
     if not CONFIG['MOZ_NATIVE_ZLIB']:
         CPP_SOURCES += [
             'dlldeps-zlib.cpp',
         ]
 
 MSVC_ENABLE_PGO = True
-
--- a/toolkit/mozapps/update/updater/Makefile.in
+++ b/toolkit/mozapps/update/updater/Makefile.in
@@ -4,16 +4,17 @@
 # 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)
 
 LIBS += \
   ../common/$(LIB_PREFIX)updatecommon.$(LIB_SUFFIX) \
   $(DEPTH)/modules/libmar/src/$(LIB_PREFIX)mar.$(LIB_SUFFIX) \
   $(MOZ_BZ2_LIBS) \
   $(NULL)
 
--- a/toolkit/mozapps/update/updater/archivereader.cpp
+++ b/toolkit/mozapps/update/updater/archivereader.cpp
@@ -11,17 +11,17 @@
 #include "archivereader.h"
 #include "errors.h"
 #ifdef XP_WIN
 #include "nsAlgorithm.h" // Needed by nsVersionComparator.cpp
 #include "updatehelper.h"
 #endif
 
 #define UPDATER_NO_STRING_GLUE_STL
-#include "../../../../xpcom/build/nsVersionComparator.cpp"
+#include "nsVersionComparator.cpp"
 #undef UPDATER_NO_STRING_GLUE_STL
 
 #if defined(XP_UNIX)
 # include <sys/types.h>
 #elif defined(XP_WIN)
 # include <io.h>
 #endif
 
--- a/toolkit/profile/Makefile.in
+++ b/toolkit/profile/Makefile.in
@@ -3,14 +3,9 @@
 # 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)/../xre \
   -I$(topsrcdir)/profile/dirserviceprovider/src \
   $(NULL)
 
-GARBAGE += nsProfileLock.cpp
-
 include $(topsrcdir)/config/rules.mk
-
-export:: $(topsrcdir)/profile/dirserviceprovider/src/nsProfileLock.cpp
-	$(INSTALL) $^ .
--- a/toolkit/profile/moz.build
+++ b/toolkit/profile/moz.build
@@ -12,16 +12,16 @@ XPIDL_SOURCES += [
     'nsIToolkitProfileService.idl',
 ]
 
 XPIDL_MODULE = 'toolkitprofile'
 
 MODULE = 'xulapp'
 
 CPP_SOURCES += [
-    'nsProfileLock.cpp',
+    TOPSRCDIR + '/profile/dirserviceprovider/src/nsProfileLock.cpp',
     'nsToolkitProfileService.cpp',
 ]
 
 LIBRARY_NAME = 'profile_s'
 
 LIBXUL_LIBRARY = True
 
--- a/xpcom/build/Makefile.in
+++ b/xpcom/build/Makefile.in
@@ -1,17 +1,14 @@
 # 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/.
 
-include $(srcdir)/../glue/objs.mk
-
-EXTRA_DEPS += $(srcdir)/../glue/objs.mk
 
 EXPORT_LIBRARY = 1
 
 MOZILLA_INTERNAL_API = 1
 
 ifeq (Darwin, $(OS_ARCH))
 CSRCS = mach_override.c
 endif
@@ -45,28 +42,23 @@ LOCAL_INCLUDES	= \
 		-I$(srcdir)/../io \
 		-I$(srcdir)/../components \
 		-I$(srcdir)/../threads \
 		-I$(srcdir)/../reflect/xptinfo/src \
 		-I$(topsrcdir)/chrome/src \
 		-I$(srcdir)/../../docshell/base \
 		$(NULL)
 
-GARBAGE         += $(XPCOM_GLUE_SRC_LCPPSRCS) $(XPCOM_GLUENS_SRC_LCPPSRCS)
-
 include $(topsrcdir)/config/rules.mk
 include $(topsrcdir)/ipc/chromium/chromium-config.mk
 
 DEFINES		+= \
 		-D_IMPL_NS_STRINGAPI \
 		-DOMNIJAR_NAME="$(OMNIJAR_NAME)" \
 		$(NULL)
 
 ifdef TARGET_XPCOM_ABI
 DEFINES += -DTARGET_XPCOM_ABI=\"$(TARGET_XPCOM_ABI)\"
 endif
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 CXXFLAGS	+= $(TK_CFLAGS)
 endif
-
-export:: $(XPCOM_GLUE_SRC_CPPSRCS) $(XPCOM_GLUENS_SRC_CPPSRCS)
-	$(INSTALL) $^ .
--- a/xpcom/build/moz.build
+++ b/xpcom/build/moz.build
@@ -36,19 +36,22 @@ elif CONFIG['OS_ARCH'] == 'Darwin':
         'mozPoisonWriteBase.cpp',
         'mozPoisonWriteMac.cpp',
     ]
 else:
     CPP_SOURCES += [
         'mozPoisonWriteStub.cpp',
     ]
 
+include('../glue/objs.mozbuild')
+
+CPP_SOURCES += xpcom_gluens_src_cppsrcs
+CPP_SOURCES += xpcom_glue_src_cppsrcs
+
 CPP_SOURCES += [
-    '$(XPCOM_GLUENS_SRC_LCPPSRCS)',
-    '$(XPCOM_GLUE_SRC_LCPPSRCS)',
     'FileLocation.cpp',
     'FrozenFunctions.cpp',
     'Omnijar.cpp',
     'Services.cpp',
     'nsXPCOMStrings.cpp',
     'nsXPComInit.cpp',
 ]
 
--- a/xpcom/glue/Makefile.in
+++ b/xpcom/glue/Makefile.in
@@ -1,16 +1,13 @@
 # vim:set ts=8 sw=8 sts=8 noet:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-include $(srcdir)/objs.mk
-
-EXTRA_DEPS += $(srcdir)/objs.mk
 
 DIST_INSTALL	= 1
 
 LOCAL_INCLUDES	= \
 		-I$(srcdir)/../build \
 		$(NULL)
 
 SDK_LIBRARY     =                        \
--- a/xpcom/glue/moz.build
+++ b/xpcom/glue/moz.build
@@ -81,16 +81,19 @@ EXPORTS.mozilla += [
     'ReentrantMonitor.h',
     'unused.h',
 ]
 
 EXPORTS.mozilla.threads += [
     'nsThreadIDs.h',
 ]
 
+include('objs.mozbuild')
+
+CPP_SOURCES += xpcom_gluens_src_cppsrcs
+CPP_SOURCES += xpcom_glue_src_cppsrcs
+
 CPP_SOURCES += [
-    '$(XPCOM_GLUENS_SRC_LCPPSRCS)',
-    '$(XPCOM_GLUE_SRC_LCPPSRCS)',
     'GenericModule.cpp',
     'nsStringAPI.cpp',
 ]
 
 LIBRARY_NAME = 'xpcomglue_s'
--- a/xpcom/glue/nomozalloc/Makefile.in
+++ b/xpcom/glue/nomozalloc/Makefile.in
@@ -1,29 +1,24 @@
 # 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/.
 
-include $(srcdir)/../objs.mk
-
-EXTRA_DEPS += $(srcdir)/../objs.mk
 
 DIST_INSTALL	= 1
 
 LOCAL_INCLUDES	= \
 		-I$(srcdir)/../../build \
 		$(NULL)
 
 SDK_LIBRARY     =                        \
 		$(LIB_PREFIX)xpcomglue_s_nomozalloc.$(LIB_SUFFIX) \
 		$(NULL)
 
-GARBAGE += $(CPPSRCS) DeadlockDetector.h SSE.h arm.h
-
 # we don't want the shared lib, but we want to force the creation of a static lib.
 FORCE_STATIC_LIB = 1
 
 # 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
 
@@ -34,16 +29,13 @@ 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
 DEFINES += -D_USE_ANSI_CPP
 endif
 
-export:: $(XPCOM_GLUE_SRC_CPPSRCS) $(XPCOM_GLUENS_SRC_CPPSRCS) $(topsrcdir)/xpcom/glue/nsStringAPI.cpp $(topsrcdir)/xpcom/glue/GenericModule.cpp $(topsrcdir)/xpcom/glue/DeadlockDetector.h
-	$(INSTALL) $^ .
-
 ifdef TARGET_XPCOM_ABI
 DEFINES += -DTARGET_XPCOM_ABI=\"$(TARGET_XPCOM_ABI)\"
 endif
 
 DEFINES += -DMOZ_NO_MOZALLOC
--- a/xpcom/glue/nomozalloc/moz.build
+++ b/xpcom/glue/nomozalloc/moz.build
@@ -1,17 +1,20 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 MODULE = 'xpcom'
 
+include('../objs.mozbuild')
+
+CPP_SOURCES += xpcom_gluens_src_cppsrcs
+CPP_SOURCES += xpcom_glue_src_cppsrcs
+
 CPP_SOURCES += [
-    '$(XPCOM_GLUENS_SRC_LCPPSRCS)',
-    '$(XPCOM_GLUE_SRC_LCPPSRCS)',
-    'GenericModule.cpp',
-    'nsStringAPI.cpp',
+    '../GenericModule.cpp',
+    '../nsStringAPI.cpp',
 ]
 
 LIBRARY_NAME = 'xpcomglue_s_nomozalloc'
 
deleted file mode 100644
--- a/xpcom/glue/objs.mk
+++ /dev/null
@@ -1,46 +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/.
-
-XPCOM_GLUE_SRC_LCPPSRCS =        \
-  AppData.cpp                    \
-  nsArrayEnumerator.cpp          \
-  nsArrayUtils.cpp               \
-  nsCategoryCache.cpp            \
-  nsCOMPtr.cpp                   \
-  nsCOMArray.cpp                 \
-  nsCRTGlue.cpp                  \
-  nsClassInfoImpl.cpp            \
-  nsComponentManagerUtils.cpp    \
-  nsEnumeratorUtils.cpp          \
-  nsID.cpp                       \
-  nsIInterfaceRequestorUtils.cpp \
-  nsINIParser.cpp                \
-  nsISupportsImpl.cpp            \
-  nsMemory.cpp                   \
-  nsWeakReference.cpp            \
-  nsVersionComparator.cpp        \
-  nsTHashtable.cpp               \
-  nsQuickSort.cpp                \
-  nsVoidArray.cpp                \
-  nsTArray.cpp                   \
-  nsThreadUtils.cpp              \
-  nsTObserverArray.cpp           \
-  nsCycleCollectionParticipant.cpp \
-  nsDeque.cpp \
-  pldhash.cpp \
-  FileUtils.cpp                  \
-  $(NULL)
-
-XPCOM_GLUE_SRC_CPPSRCS = $(addprefix $(topsrcdir)/xpcom/glue/, $(XPCOM_GLUE_SRC_LCPPSRCS))
-
-XPCOM_GLUENS_SRC_LCPPSRCS =      \
-  BlockingResourceBase.cpp       \
-  DeadlockDetector.cpp           \
-  unused.cpp                     \
-  nsProxyRelease.cpp             \
-  nsTextFormatter.cpp            \
-  GenericFactory.cpp             \
-  $(NULL)
-
-XPCOM_GLUENS_SRC_CPPSRCS = $(addprefix $(topsrcdir)/xpcom/glue/,$(XPCOM_GLUENS_SRC_LCPPSRCS))
new file mode 100644
--- /dev/null
+++ b/xpcom/glue/objs.mozbuild
@@ -0,0 +1,52 @@
+# -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+xpcom_glue_src_lcppsrcs = [
+    'AppData.cpp',
+    'FileUtils.cpp',
+    'nsArrayEnumerator.cpp',
+    'nsArrayUtils.cpp',
+    'nsCOMArray.cpp',
+    'nsCOMPtr.cpp',
+    'nsCRTGlue.cpp',
+    'nsCategoryCache.cpp',
+    'nsClassInfoImpl.cpp',
+    'nsComponentManagerUtils.cpp',
+    'nsCycleCollectionParticipant.cpp',
+    'nsDeque.cpp',
+    'nsEnumeratorUtils.cpp',
+    'nsID.cpp',
+    'nsIInterfaceRequestorUtils.cpp',
+    'nsINIParser.cpp',
+    'nsISupportsImpl.cpp',
+    'nsMemory.cpp',
+    'nsQuickSort.cpp',
+    'nsTArray.cpp',
+    'nsTHashtable.cpp',
+    'nsThreadUtils.cpp',
+    'nsTObserverArray.cpp',
+    'nsVersionComparator.cpp',
+    'nsVoidArray.cpp',
+    'nsWeakReference.cpp',
+    'pldhash.cpp',
+]
+
+xpcom_glue_src_cppsrcs = [
+    '%s/xpcom/glue/%s' % (TOPSRCDIR, s) for s in xpcom_glue_src_lcppsrcs
+]
+
+xpcom_gluens_src_lcppsrcs = [
+    'BlockingResourceBase.cpp',
+    'DeadlockDetector.cpp',
+    'GenericFactory.cpp',
+    'nsProxyRelease.cpp',
+    'nsTextFormatter.cpp',
+    'unused.cpp',
+]
+
+xpcom_gluens_src_cppsrcs = [
+    '%s/xpcom/glue/%s' % (TOPSRCDIR, s) for s in xpcom_gluens_src_lcppsrcs
+]
--- a/xpcom/glue/standalone/Makefile.in
+++ b/xpcom/glue/standalone/Makefile.in
@@ -1,45 +1,35 @@
 # 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/.
 
-include $(srcdir)/../objs.mk
-
-EXTRA_DEPS += $(srcdir)/../objs.mk
 
 DIST_INSTALL	= 1
 
 LOCAL_INCLUDES	= \
 	-I$(srcdir)/../../build \
 	$(NULL)
 
 SDK_LIBRARY     	= \
 	$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX) \
 	$(NULL)
 
 FORCE_STATIC_LIB = 1
 
 # Don't use STL wrappers here (i.e. wrapped <new>); they require mozalloc
 STL_FLAGS	=
 
-GARBAGE         += $(XPCOM_GLUE_SRC_LCPPSRCS)
-
 include $(topsrcdir)/config/rules.mk
 
 ifdef _MSC_VER
 # Don't include directives in obj files about which CRT to use
 OS_COMPILE_CXXFLAGS += -Zl
 OS_COMPILE_CFLAGS += -Zl
 DEFINES += -D_USE_ANSI_CPP
 endif
 
-export:: $(XPCOM_GLUE_SRC_CPPSRCS) $(topsrcdir)/xpcom/glue/nsStringAPI.cpp
-	$(INSTALL) $^ .
-
-GARBAGE += nsStringAPI.cpp
-
 DEFINES		+= -DXPCOM_GLUE
 
 ifdef TARGET_XPCOM_ABI
 DEFINES += -DTARGET_XPCOM_ABI=\"$(TARGET_XPCOM_ABI)\"
 endif
--- a/xpcom/glue/standalone/moz.build
+++ b/xpcom/glue/standalone/moz.build
@@ -6,19 +6,22 @@
 
 # On win we build two glue libs - glue linked to crt dlls here and in staticruntime we build
 # a statically linked glue lib.
 if CONFIG['OS_ARCH'] == 'WINNT':
     DIRS += ['staticruntime']
 
 MODULE = 'xpcom'
 
+include('../objs.mozbuild')
+
+CPP_SOURCES += xpcom_glue_src_cppsrcs
+
 CPP_SOURCES += [
-    '$(XPCOM_GLUE_SRC_LCPPSRCS)',
-    'nsStringAPI.cpp',
+    '../nsStringAPI.cpp',
     'nsXPCOMGlue.cpp',
 ]
 
 LIBRARY_NAME = 'xpcomglue'
 
 EXPORTS += [
     'nsXPCOMGlue.h',
 ]
--- a/xpcom/glue/standalone/staticruntime/Makefile.in
+++ b/xpcom/glue/standalone/staticruntime/Makefile.in
@@ -1,15 +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/.
 
-include $(srcdir)/../../objs.mk
-
-EXTRA_DEPS += $(srcdir)/../../objs.mk
 
 DIST_INSTALL	= 1
 
 LOCAL_INCLUDES	= \
 	-I$(srcdir)/../../../build \
 	$(NULL)
 
 SDK_LIBRARY     	= \
@@ -20,29 +17,22 @@ SDK_LIBRARY     	= \
 FORCE_STATIC_LIB = 1
 
 # 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	=
 
-GARBAGE         += $(XPCOM_GLUE_SRC_LCPPSRCS)
-
 include $(topsrcdir)/config/rules.mk
 
 ifdef _MSC_VER
 # Don't include directives in obj files about which CRT to use
 OS_COMPILE_CXXFLAGS += -Zl
 OS_COMPILE_CFLAGS += -Zl
 DEFINES += -D_USE_ANSI_CPP
 endif
 
-export:: $(XPCOM_GLUE_SRC_CPPSRCS) $(topsrcdir)/xpcom/glue/nsStringAPI.cpp ../nsXPCOMGlue.cpp
-	$(INSTALL) $^ .
-
-GARBAGE += nsStringAPI.cpp nsXPCOMGlue.cpp
-
 DEFINES		+= -DXPCOM_GLUE
 
 ifdef TARGET_XPCOM_ABI
 DEFINES += -DTARGET_XPCOM_ABI=\"$(TARGET_XPCOM_ABI)\"
 endif
--- a/xpcom/glue/standalone/staticruntime/moz.build
+++ b/xpcom/glue/standalone/staticruntime/moz.build
@@ -1,16 +1,19 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 MODULE = 'xpcom'
 
+include('../../objs.mozbuild')
+
+CPP_SOURCES += xpcom_glue_src_cppsrcs
+
 CPP_SOURCES += [
-    '$(XPCOM_GLUE_SRC_LCPPSRCS)',
-    'nsStringAPI.cpp',
-    'nsXPCOMGlue.cpp',
+    '../../nsStringAPI.cpp',
+    '../nsXPCOMGlue.cpp',
 ]
 
 LIBRARY_NAME = 'xpcomglue_staticruntime'
 
--- a/xpcom/glue/staticruntime/Makefile.in
+++ b/xpcom/glue/staticruntime/Makefile.in
@@ -1,29 +1,24 @@
 # 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/.
 
-include $(srcdir)/../objs.mk
-
-EXTRA_DEPS += $(srcdir)/../objs.mk
 
 DIST_INSTALL	= 1
 
 LOCAL_INCLUDES	= \
 	-I$(srcdir)/../../build \
 	$(NULL)
 
 SDK_LIBRARY     	= \
 	$(LIB_PREFIX)xpcomglue_staticruntime_s.$(LIB_SUFFIX) \
 	$(NULL)
 
-GARBAGE         += $(XPCOM_GLUE_SRC_LCPPSRCS)
-
 FORCE_STATIC_LIB = 1
 
 # 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	=
 
@@ -31,14 +26,11 @@ 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
 DEFINES += -D_USE_ANSI_CPP
 endif
 
-export:: $(XPCOM_GLUE_SRC_CPPSRCS) $(XPCOM_GLUENS_SRC_CPPSRCS) $(topsrcdir)/xpcom/glue/nsStringAPI.cpp $(topsrcdir)/xpcom/glue/GenericModule.cpp $(topsrcdir)/xpcom/glue/DeadlockDetector.h
-	$(INSTALL) $^ .
-
 ifdef TARGET_XPCOM_ABI
 DEFINES += -DTARGET_XPCOM_ABI=\"$(TARGET_XPCOM_ABI)\"
 endif
--- a/xpcom/glue/staticruntime/moz.build
+++ b/xpcom/glue/staticruntime/moz.build
@@ -1,17 +1,20 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 MODULE = 'xpcom'
 
+include('../objs.mozbuild')
+
+CPP_SOURCES += xpcom_gluens_src_cppsrcs
+CPP_SOURCES += xpcom_glue_src_cppsrcs
+
 CPP_SOURCES += [
-    '$(XPCOM_GLUENS_SRC_LCPPSRCS)',
-    '$(XPCOM_GLUE_SRC_LCPPSRCS)',
-    'GenericModule.cpp',
-    'nsStringAPI.cpp',
+    '../GenericModule.cpp',
+    '../nsStringAPI.cpp',
 ]
 
 LIBRARY_NAME = 'xpcomglue_staticruntime_s'