[mq]: auto-paths draft
authorJoshua Cranmer <Pidgeot18@gmail.com>
Sun, 13 Jul 2014 14:22:01 -0500
changeset 24860 23bf18bc6edbc51172ef8a75421c01fba5da1c43
parent 24859 0fb849ec9b6fe30a47668bcba963d1698e1a561f
child 24861 774d12560db98d3a662707f39602aea6391ba4c4
push id1562
push userPidgeot18@gmail.com
push dateMon, 14 Jul 2014 05:28:41 +0000
treeherdertry-comm-central@05885c373b87 [default view] [failures only]
[mq]: auto-paths
Makefile.in
calendar/lightning/Makefile.in
calendar/lightning/app-config.mk
calendar/lightning/build/universal.mk
calendar/lightning/lightning-packager.mk
calendar/lightning/lightning-tests.mk
calendar/providers/gdata/Makefile.in
calendar/test/mozmill/Makefile.in
calendar/timezones/Makefile.in
config/baseconfig.mk
config/config.mk
config/makefiles/makeutils.mk
config/makefiles/rcs.mk
config/rules.mk
config/static-checking-config.mk
config/static-rules.mk
config/version.mk
im/app/Makefile.in
im/build.mk
im/installer/Makefile.in
im/installer/windows/Makefile.in
im/locales/Makefile.in
mail/Makefile.in
mail/app/Makefile.in
mail/base/Makefile.in
mail/installer/Makefile.in
mail/installer/windows/Makefile.in
mail/locales/Makefile.in
mail/test/mozmill/Makefile.in
mail/testsuite-targets.mk
mailnews/Makefile.in
mailnews/import/build/Makefile.in
suite/app/Makefile.in
suite/browser/test/Makefile.in
suite/common/dataman/tests/Makefile.in
suite/common/downloads/tests/Makefile.in
suite/common/places/tests/Makefile.in
suite/common/tests/browser/Makefile.in
suite/common/tests/chrome/Makefile.in
suite/common/tests/preferences/Makefile.in
suite/installer/Makefile.in
suite/installer/windows/Makefile.in
suite/locales/Makefile.in
suite/smile/test/Makefile.in
--- a/Makefile.in
+++ b/Makefile.in
@@ -21,25 +21,25 @@ include $(DEPTH)/config/autoconf.mk
 default::
 
 ifdef COMPILE_ENVIRONMENT
 include $(topsrcdir)/$(MOZ_BUILD_APP)/build.mk
 endif
 
 include $(topsrcdir)/config/config.mk
 
-default alldep all:: $(topsrcdir)/configure config.status
+default alldep all:: $(topsrcdir)/../configure config.status
 
-$(topsrcdir)/configure: $(topsrcdir)/configure.in
+$(topsrcdir)/../configure: $(topsrcdir)/../configure.in
 	@echo "STOP!  configure.in has changed, and your configure is out of date."
 	@echo "Please rerun autoconf and configure."
 	@echo "To ignore this message, touch 'configure' in the source directory."
 	@exit 1
 
-config.status: $(topsrcdir)/configure
+config.status: $(topsrcdir)/../configure
 	@echo "STOP!  configure has changed and needs to be run in this build directory."
 	@echo "Please rerun configure."
 	@echo "To ignore this message, touch 'config.status' in the build directory."
 	@exit 1
 
 default export libs clean realclean distclean alldep \
 maybe_clobber_profiledbuild uploadsymbols all:: $(SUBMAKEFILES)
 	$(MAKE) -C mozilla $@
@@ -47,20 +47,20 @@ maybe_clobber_profiledbuild uploadsymbol
 ifdef ENABLE_TESTS
 check mochitest reftest crashtest xpcshell-tests:: $(SUBMAKEFILES)
 	$(MAKE) -C mozilla $@
 
 mochitest-% :: $(SUBMAKEFILES)
 	$(MAKE) -C mozilla $@
 
 check-sync-dirs::
-	@$(PYTHON) $(topsrcdir)/mail/check-sync-dirs.py \
-	   $(topsrcdir)/build $(topsrcdir)/mozilla/build
-	@$(PYTHON) $(topsrcdir)/mail/check-sync-dirs.py \
-	   $(topsrcdir)/config/makefiles $(topsrcdir)/mozilla/config/makefiles
+	@$(PYTHON) $(topsrcdir)/../mail/check-sync-dirs.py \
+	   $(topsrcdir)/../build $(topsrcdir)/../build
+	@$(PYTHON) $(topsrcdir)/../mail/check-sync-dirs.py \
+	   $(topsrcdir)/../config/makefiles $(topsrcdir)/../config/makefiles
 
 check:: check-sync-dirs
 
 ifndef MOZ_THUNDERBIRD
 package-tests:: $(SUBMAKEFILES)
 	$(MAKE) -C mozilla $@
 endif
 endif
@@ -68,25 +68,25 @@ endif
 # http://bugzilla.mozilla.org/show_bug.cgi?id=450485
 MAKE_SYM_STORE_PATH=dist/bin
 ifeq ($(OS_ARCH),Darwin)
 ifdef UNIVERSAL_BINARY
   MAKE_SYM_STORE_PATH=dist/universal
 endif
 endif
 
-include $(topsrcdir)/mozilla/toolkit/mozapps/installer/package-name.mk
+include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
 
 ifeq ($(OS_ARCH),WINNT)
   # PDB files don't get moved to dist, so we need to scan the whole objdir
   MAKE_SYM_STORE_PATH=..
 endif
 
 buildsymbols :: $(SUBMAKEFILES)
-	$(MAKE) -C mozilla MAKE_SYM_STORE_PATH=$(MAKE_SYM_STORE_PATH) SYM_STORE_SOURCE_DIRS='$(topsrcdir)/mozilla/extensions/inspector $(topsrcdir)/ldap/sdks $(topsrcdir)/mozilla $(topsrcdir)' $@
+	$(MAKE) -C mozilla MAKE_SYM_STORE_PATH=$(MAKE_SYM_STORE_PATH) SYM_STORE_SOURCE_DIRS='$(topsrcdir)/../extensions/inspector $(topsrcdir)/../ldap/sdks $(topsrcdir)/.. $(topsrcdir)/..' $@
 
 # If we don't specify this, then we will end up trying to build as if we were a
 # regular directory in the build tree.
 SUPPRESS_DEFAULT_RULES := 1
 
 include $(topsrcdir)/config/rules.mk
 
 # defined in (mozilla/.../)package-name.mk
--- a/calendar/lightning/Makefile.in
+++ b/calendar/lightning/Makefile.in
@@ -17,20 +17,20 @@ XPI_PKGNAME = lightning-$(LIGHTNING_VERS
 XPI_VERSION = $(LIGHTNING_VERSION)
 
 XPI_EM_ID = {e2fda1a4-762b-4020-b5ad-a41df1933103}
 
 DIST_FILES = install.rdf application.ini
 PREF_JS_EXPORTS = $(srcdir)/content/lightning.js
 
 # Lighting version number
-THUNDERBIRD_VERSION := $(shell cat $(topsrcdir)/mail/config/version.txt)
-SEAMONKEY_VERSION := $(shell cat $(topsrcdir)/suite/config/version.txt)
+THUNDERBIRD_VERSION := $(shell cat $(topsrcdir)/../mail/config/version.txt)
+SEAMONKEY_VERSION := $(shell cat $(topsrcdir)/../suite/config/version.txt)
 LIGHTNING_VERSION := $(shell $(PYTHON) $(srcdir)/build/makeversion.py $(word 1,$(MOZ_PKG_VERSION) $(THUNDERBIRD_VERSION)))
-GDATA_VERSION := $(shell $(PYTHON) $(topsrcdir)/calendar/providers/gdata/makeversion.py $(LIGHTNING_VERSION))
+GDATA_VERSION := $(shell $(PYTHON) $(topsrcdir)/../calendar/providers/gdata/makeversion.py $(LIGHTNING_VERSION))
 
 # For extensions we require a max version that is compatible across security releases.
 # THUNDERBIRD_MAXVERSION and SEAMONKEY_MAXVERSION is our method for doing that.
 # Alpha versions 10.0a1 and 10.0a2 aren't affected
 # For Seamonkey, 2.17 becomes 2.17.*, 2.17.1 becomes 2.17.*
 # For Thunderbird, 10.0 becomes 10.*, 10.0.1 becomes 10.*
 THUNDERBIRD_MAXVERSION := $(THUNDERBIRD_VERSION)
 ifneq (a,$(findstring a,$(THUNDERBIRD_VERSION)))
@@ -47,39 +47,39 @@ DEFINES += -DLIGHTNING_PRERELEASE_VERSIO
 endif
 
 # Enable nightly updates on aurora and nightly channel
 ifeq (nightly,$(subst aurora,nightly,$(MOZ_UPDATE_CHANNEL)))
 DEFINES += -DLIGHTNING_UPDATE_LOCATION=https://calendar.mozilla.org/update.php
 endif
 
 # Gecko milestone
-GRE_MILESTONE = $(shell $(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build Milestone)
+GRE_MILESTONE = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build Milestone)
 ifdef GRE_MILESTONE
 DEFINES += -DGRE_MILESTONE=$(GRE_MILESTONE)
 endif
 
 # comm-central source repo and stamp
-SOURCE_STAMP ?= $(firstword $(shell hg -R $(topsrcdir) parent --template="{node|short}\n" 2>/dev/null))
+SOURCE_STAMP ?= $(firstword $(shell hg -R $(topsrcdir)/.. parent --template="{node|short}\n" 2>/dev/null))
 ifdef SOURCE_STAMP
 DEFINES += -DSOURCE_STAMP="$(SOURCE_STAMP)"
 endif
 
-SOURCE_REPO := $(shell hg -R $(topsrcdir) showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/http:/")
+SOURCE_REPO := $(shell hg -R $(topsrcdir)/.. showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/http:/")
 ifdef SOURCE_REPO
 DEFINES += -DSOURCE_REPO="$(SOURCE_REPO)"
 endif
 
 # Mozilla source repo and stamps
-MOZ_SOURCE_STAMP = $(firstword $(shell hg -R $(MOZILLA_SRCDIR) parent --template="{node|short}\n" 2>/dev/null))
+MOZ_SOURCE_STAMP = $(firstword $(shell hg -R $(topsrcdir) parent --template="{node|short}\n" 2>/dev/null))
 ifdef MOZ_SOURCE_STAMP
 DEFINES += -DMOZ_SOURCE_STAMP="$(MOZ_SOURCE_STAMP)"
 endif
 
-MOZ_SOURCE_REPO := $(shell hg -R $(MOZILLA_SRCDIR) showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/http:/")
+MOZ_SOURCE_REPO := $(shell hg -R $(topsrcdir) showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/http:/")
 ifdef MOZ_SOURCE_REPO
 DEFINES += -DMOZ_SOURCE_REPO="$(MOZ_SOURCE_REPO)"
 endif
 
 # include config.mk here so myconfig or app-config can set DISABLE_LIGHTNING_INSTALL
 include $(topsrcdir)/config/config.mk
 
 # installing lightning in a thunderbird build causes problems on tinderboxes
@@ -106,17 +106,17 @@ DEFINES += -DTHUNDERBIRD_VERSION=$(THUND
            -DSEAMONKEY_VERSION=$(SEAMONKEY_VERSION) \
            -DSEAMONKEY_MAXVERSION=$(SEAMONKEY_MAXVERSION) \
            -DLIGHTNING_VERSION=$(LIGHTNING_VERSION) \
            -DTARGET_PLATFORM=$(OS_TARGET)_$(TARGET_XPCOM_ABI) \
            -DXPI_EM_ID="$(XPI_EM_ID)" \
            -DTHEME=$(THEME) \
            $(NULL)
 
-GRE_BUILDID = $(shell $(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build BuildID)
+GRE_BUILDID = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build BuildID)
 DEFINES += -DGRE_BUILDID=$(GRE_BUILDID)
 
 # xxx todo: unless our packaging story is revised (bug 406579) we package up timezones.sqlite
 libs::
 	$(NSINSTALL) -m 0644 $(srcdir)/../timezones/timezones.sqlite $(FINAL_TARGET)
 
 include $(topsrcdir)/config/rules.mk
 include $(srcdir)/lightning-packager.mk
@@ -132,16 +132,16 @@ ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 # If the macbundle dist dir was already created, sync lightning here to avoid
 # the need to make -C objdir/mail/app each time
 libs::
 	[ -d $(DIST)/$(MOZ_MACBUNDLE_NAME) ] && rsync -aL $(FINAL_TARGET)/ $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/extensions/$(XPI_EM_ID) || true
 endif
 
 ident:
 	@printf "comm_revision "
-	@$(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py \
+	@$(PYTHON) $(topsrcdir)/config/printconfigsetting.py \
 	    $(FINAL_TARGET)/application.ini App SourceStamp
 	@printf "moz_revision "
-	@$(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py \
+	@$(PYTHON) $(topsrcdir)/config/printconfigsetting.py \
 	    $(FINAL_TARGET)/application.ini Build SourceStamp
 	@printf "buildid "
-	@$(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py \
+	@$(PYTHON) $(topsrcdir)/config/printconfigsetting.py \
 	    $(FINAL_TARGET)/application.ini App BuildID
--- a/calendar/lightning/app-config.mk
+++ b/calendar/lightning/app-config.mk
@@ -1,14 +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/.
 
 # If we are in one of the calendar directories, then make sure that files end
 # up in xpi-stage/lightning.
-ifeq (calendar,$(firstword $(subst /, ,$(subst $(topsrcdir)/,,$(srcdir)))))
+ifeq (calendar,$(firstword $(subst /, ,$(subst $(topsrcdir)/../,,$(srcdir)))))
 # Possibly XPI_NAME is already set, i.e in the timezones extension. Don't
 # override this.
 ifndef XPI_NAME
 export XPI_NAME = lightning
 export USE_EXTENSION_MANIFEST = 1
 endif
 endif
--- a/calendar/lightning/build/universal.mk
+++ b/calendar/lightning/build/universal.mk
@@ -10,20 +10,20 @@ DIST_ARCH_2 = $(OBJDIR_ARCH_2)/dist
 DIST_UNI = $(DIST_ARCH_1)/universal
 OBJDIR = $(OBJDIR_ARCH_1)
 endif
 
 topsrcdir = $(TOPSRCDIR)
 DEPTH = $(OBJDIR)
 
 include $(DEPTH)/config/autoconf.mk
-include $(topsrcdir)/mozilla/toolkit/mozapps/installer/package-name.mk
+include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
 
-THUNDERBIRD_VERSION := $(shell cat $(topsrcdir)/mail/config/version.txt)
-LIGHTNING_VERSION := $(shell $(PYTHON) $(topsrcdir)/calendar/lightning/build/makeversion.py $(word 1,$(MOZ_PKG_VERSION) $(THUNDERBIRD_VERSION)))
+THUNDERBIRD_VERSION := $(shell cat $(topsrcdir)/../mail/config/version.txt)
+LIGHTNING_VERSION := $(shell $(PYTHON) $(topsrcdir)/../calendar/lightning/build/makeversion.py $(word 1,$(MOZ_PKG_VERSION) $(THUNDERBIRD_VERSION)))
 XPI_PKGNAME = lightning-$(LIGHTNING_VERSION).$(AB_CD).$(MOZ_PKG_PLATFORM)
 
 STANDALONE_MAKEFILE := 1
 include $(TOPSRCDIR)/config/config.mk
 
 postflight_all:
 	mkdir -p $(DIST_UNI)/xpi-stage
 	rm -rf $(DIST_UNI)/xpi-stage/lightning*
--- a/calendar/lightning/lightning-packager.mk
+++ b/calendar/lightning/lightning-packager.mk
@@ -11,17 +11,17 @@
 # following variables in your Makefile, then include this file.
 #   XPI_NAME = lightning # The extension path name
 #   XPI_PKGNAME = lightning-2.2.en-US.mac # The extension package name
 #   XPI_VERSION = 2.2 # The extension version
 #
 # The following variables are optional:
 #   XPI_NO_UNIVERSAL = 1  # If set, no universal path is used on mac
 
-include $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/package-name.mk
+include $(topsrcdir)olkit/mozapps/installer/package-name.mk
 
 # Set the univeral path only if we are building a univeral binary and it was
 # not restricted by the calling makefile
 ifeq ($(UNIVERSAL_BINARY)|$(XPI_NO_UNIVERSAL),1|)
 UNIVERSAL_PATH=universal/
 else
 UNIVERSAL_PATH=
 endif
@@ -61,20 +61,20 @@ SHORTOS = osx
 else
 SHORTOS = linux
 endif
 
 # function oslocales(filename)
 oslocales = $(shell $(AWK) '{ if ($$2 == "" || $$2 == "$(SHORTOS)") { print $$1 } }' $(1))
 
 # function apposlocales(app)
-apposlocales = $(call oslocales,$(topsrcdir)/$1/locales/$(if $(filter $(MOZ_UPDATE_CHANNEL),beta release),shipped-locales,all-locales))
+apposlocales = $(call oslocales,$(topsrcdir)/../$1/locales/$(if $(filter $(MOZ_UPDATE_CHANNEL),beta release),shipped-locales,all-locales))
 
 # function print_ltnconfig(section,configname)
-print_ltnconfig = $(shell $(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py $(XPI_STAGE_PATH)/$(XPI_NAME)/application.ini $1 $2)
+print_ltnconfig = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(XPI_STAGE_PATH)/$(XPI_NAME)/application.ini $1 $2)
 
 wget-en-US: FINAL_BINARY_URL = $(subst thunderbird,calendar/lightning,$(EN_US_BINARY_URL))
 wget-en-US: $(XPI_STAGE_PATH)
 	(cd $(XPI_STAGE_PATH) && $(WGET) -nv -N $(FINAL_BINARY_URL)/$(ENUS_PKGNAME).xpi)
 	@echo "Downloaded $(FINAL_BINARY_URL)/$(ENUS_PKGNAME) to $(XPI_ZIP_IN)"
 
 ensure-stage-dir: $(if $(wildcard $(XPI_STAGE_PATH)/$(XPI_NAME)/),,wget-en-US unpack)
 
--- a/calendar/lightning/lightning-tests.mk
+++ b/calendar/lightning/lightning-tests.mk
@@ -17,11 +17,11 @@ stage-extension:
 	$(NSINSTALL) -D $(PKG_STAGE)/extensions/$(XPI_EM_ID)
 	(cd $(FINAL_TARGET) && tar $(TAR_CREATE_FLAGS) - *) | (cd $(PKG_STAGE)/extensions/$(XPI_EM_ID) && tar -xf -)
 	grep -v em:realTargetPlatform $(FINAL_TARGET)/install.rdf > $(PKG_STAGE)/extensions/$(XPI_EM_ID)/install.rdf
 
 # stage mozmill tests and shared modules. Cross your fingers that there are no
 # name conflicts between calendar/ and mail/
 stage-mozmill:
 	$(NSINSTALL) -D $(PKG_STAGE)/mozmill/shared-modules
-	(cd $(topsrcdir)/calendar/test/mozmill && tar $(TAR_CREATE_FLAGS) - `cat $(topsrcdir)/calendar/test/mozmill/mozmilltests.list`) | (cd $(PKG_STAGE)/mozmill && tar -xf -)
-	(cd $(topsrcdir)/calendar/test/mozmill/shared-modules && tar $(TAR_CREATE_FLAGS) - *) | (cd $(PKG_STAGE)/mozmill/shared-modules && tar -xf -)
-	$(call py_action,buildlist,$(PKG_STAGE)/mozmill/mozmilltests.list $(shell cat $(topsrcdir)/calendar/test/mozmill/mozmilltests.list))
+	(cd $(topsrcdir)/../calendar/test/mozmill && tar $(TAR_CREATE_FLAGS) - `cat $(topsrcdir)/../calendar/test/mozmill/mozmilltests.list`) | (cd $(PKG_STAGE)/mozmill && tar -xf -)
+	(cd $(topsrcdir)/../calendar/test/mozmill/shared-modules && tar $(TAR_CREATE_FLAGS) - *) | (cd $(PKG_STAGE)/mozmill/shared-modules && tar -xf -)
+	$(call py_action,buildlist,$(PKG_STAGE)/mozmill/mozmilltests.list $(shell cat $(topsrcdir)/../calendar/test/mozmill/mozmilltests.list))
--- a/calendar/providers/gdata/Makefile.in
+++ b/calendar/providers/gdata/Makefile.in
@@ -10,19 +10,19 @@ VPATH = @srcdir@
 include $(DEPTH)/config/autoconf.mk
 
 export USE_EXTENSION_MANIFEST = 1
 DIST_FILES = install.rdf
 XPI_PKGNAME = gdata-provider-$(GDATA_VERSION).$(AB_CD).$(MOZ_PKG_PLATFORM)
 XPI_VERSION = $(GDATA_VERSION)
 XPI_NO_UNIVERSAL = 1
 
-THUNDERBIRD_VERSION := $(shell cat $(topsrcdir)/mail/config/version.txt)
-SEAMONKEY_VERSION := $(shell cat $(topsrcdir)/suite/config/version.txt)
-CALENDAR_VERSION := $(shell $(PYTHON) $(topsrcdir)/calendar/lightning/build/makeversion.py $(word 1,$(MOZ_PKG_VERSION) $(THUNDERBIRD_VERSION)))
+THUNDERBIRD_VERSION := $(shell cat $(topsrcdir)/../mail/config/version.txt)
+SEAMONKEY_VERSION := $(shell cat $(topsrcdir)/../suite/config/version.txt)
+CALENDAR_VERSION := $(shell $(PYTHON) $(topsrcdir)/../calendar/lightning/build/makeversion.py $(word 1,$(MOZ_PKG_VERSION) $(THUNDERBIRD_VERSION)))
 GDATA_VERSION = $(shell $(PYTHON) $(srcdir)/makeversion.py $(CALENDAR_VERSION))
 
 DEFINES += -DAB_CD=$(AB_CD) \
            -DCALENDAR_VERSION=$(CALENDAR_VERSION) \
            -DSEAMONKEY_VERSION=$(SEAMONKEY_VERSION) \
            -DTHUNDERBIRD_VERSION=$(THUNDERBIRD_VERSION) \
            -DCOMM_BUILD=$(COMM_BUILD) \
            -DGDATA_VERSION=$(GDATA_VERSION) \
--- a/calendar/test/mozmill/Makefile.in
+++ b/calendar/test/mozmill/Makefile.in
@@ -4,17 +4,17 @@
 
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-MOZMILLDIR=$(DEPTH)/mozilla/_tests/mozmill
+MOZMILLDIR=$(DEPTH)/_tests/mozmill
 ifeq ($(OS_ARCH),WINNT)
 VIRTUALENV_BIN = $(MOZMILLDIR)/../mozmill-virtualenv/Scripts
 else
 VIRTUALENV_BIN = $(MOZMILLDIR)/../mozmill-virtualenv/bin
 endif
 MOZMILLPYTHON = $(abspath $(VIRTUALENV_BIN)/python$(BIN_SUFFIX))
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
@@ -40,17 +40,17 @@ include $(topsrcdir)/config/rules.mk
 # problems if the names are the same, but I propose we boycott those modules!
 mozmill-stage: MOZMILL_STAGE=$(MOZMILLDIR)/stage
 mozmill-stage: MOZMILL_STAGE_SHARED=$(MOZMILL_STAGE)/shared-modules
 mozmill-stage: $(MOZMILL_SHARED)
 	$(INSTALL) -D $(MOZMILL_STAGE)
 	$(INSTALL) -D $(MOZMILL_STAGE_SHARED)
 	$(INSTALL) $(addprefix $(srcdir)/,$(shell cat $(srcdir)/mozmilltests.list)) $(MOZMILL_STAGE)
 
-	$(INSTALL) $(wildcard $(topsrcdir)/mail/test/mozmill/shared-modules/*.js) $(MOZMILL_STAGE_SHARED)
+	$(INSTALL) $(wildcard $(topsrcdir)/../mail/test/mozmill/shared-modules/*.js) $(MOZMILL_STAGE_SHARED)
 	$(INSTALL) $(wildcard $(srcdir)/shared-modules/*.js) $(MOZMILL_STAGE_SHARED)
 
 mozmill: mozmill-stage
 	unset PYTHONHOME && cd $(MOZMILLDIR) && unset MACOSX_DEPLOYMENT_TARGET && \
 	$(MOZMILLPYTHON) runtestlist.py --list=$(srcdir)/mozmilltests.list \
 	--binary=$(MOZMILLPROGRAM) \
 	--dir=$(abspath $(MOZMILLDIR))/stage \
 	--symbols-path=$(abspath $(DIST)/crashreporter-symbols) \
--- a/calendar/timezones/Makefile.in
+++ b/calendar/timezones/Makefile.in
@@ -34,19 +34,19 @@ XPI_PKGNAME = calendar-timezones
 
 PREF_JS_EXPORTS = $(srcdir)/defaults/preferences.js
 
 ifndef DISABLE_LIGHTNING_INSTALL
 # install as a global extension in dist/bin/extensions/
 INSTALL_EXTENSION_ID = calendar-timezones@mozilla.org
 endif
 
-THUNDERBIRD_VERSION := $(shell cat $(topsrcdir)/mail/config/version.txt)
-SEAMONKEY_VERSION := $(shell cat $(topsrcdir)/suite/config/version.txt)
-CALENDAR_VERSION := $(shell $(PYTHON) $(topsrcdir)/calendar/lightning/build/makeversion.py $(word 1,$(MOZ_PKG_VERSION) $(THUNDERBIRD_VERSION)))
+THUNDERBIRD_VERSION := $(shell cat $(topsrcdir)/../mail/config/version.txt)
+SEAMONKEY_VERSION := $(shell cat $(topsrcdir)/../suite/config/version.txt)
+CALENDAR_VERSION := $(shell $(PYTHON) $(topsrcdir)/../calendar/lightning/build/makeversion.py $(word 1,$(MOZ_PKG_VERSION) $(THUNDERBIRD_VERSION)))
 TIMEZONES_VERSION := $(shell cat $(srcdir)/config/version.txt)
 
 DEFINES += -DAB_CD=$(AB_CD) \
            -DTHUNDERBIRD_VERSION=$(THUNDERBIRD_VERSION) \
            -DSEAMONKEY_VERSION=$(SEAMONKEY_VERSION) \
            -DCALENDAR_VERSION=$(CALENDAR_VERSION) \
            -DTIMEZONES_VERSION=$(TIMEZONES_VERSION) \
            $(NULL)
--- a/config/baseconfig.mk
+++ b/config/baseconfig.mk
@@ -1,19 +1,19 @@
 # This file is normally included by autoconf.mk, but it is also used
 # directly in python/mozbuild/mozbuild/base.py for gmake validation.
 # We thus use INCLUDED_AUTOCONF_MK to enable/disable some parts depending
 # whether a normal build is happening or whether the check is running.
 includedir := $(includedir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
 idldir = $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
 installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
 sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION)
-MOZILLA_SRCDIR = $(topsrcdir)/mozilla
-MOZDEPTH = $(DEPTH)/mozilla
-DIST = $(MOZDEPTH)/dist
+MOZILLA_SRCDIR = $(topsrcdir)/..
+MOZDEPTH = $(DEPTH)
+DIST = $(DEPTH)/dist
 
 # We do magic with OBJ_SUFFIX in config.mk, the following ensures we don't
 # manually use it before config.mk inclusion
 _OBJ_SUFFIX := $(OBJ_SUFFIX)
 OBJ_SUFFIX = $(error config/config.mk needs to be included before using OBJ_SUFFIX)
 
 ifeq ($(HOST_OS_ARCH),WINNT)
 # We only support building with a non-msys gnu make version
--- a/config/config.mk
+++ b/config/config.mk
@@ -142,17 +142,17 @@ CHECK_VARS := \
 # named by $x
 check-variable = $(if $(filter-out 0 1,$(words $($(x))z)),$(error Spaces are not allowed in $(x)))
 
 $(foreach x,$(CHECK_VARS),$(check-variable))
 
 RM = rm -f
 
 ifndef INCLUDED_FUNCTIONS_MK
-include $(MOZILLA_SRCDIR)/config/makefiles/functions.mk
+include $(topsrcdir)nfig/makefiles/functions.mk
 endif
 
 # FINAL_TARGET specifies the location into which we copy end-user-shipped
 # build products (typelibs, components, chrome). It may already be specified by
 # a moz.build file.
 #
 # If XPI_NAME is set, the files will be shipped to $(DIST)/xpi-stage/$(XPI_NAME)
 # instead of $(DIST)/bin. In both cases, if DIST_SUBDIR is set, the files will be
@@ -165,25 +165,25 @@ FINAL_TARGET_FROZEN := '$(FINAL_TARGET)'
 ifdef XPI_NAME
 DEFINES += -DXPI_NAME=$(XPI_NAME)
 endif
 
 # The VERSION_NUMBER is suffixed onto the end of the DLLs we ship.
 VERSION_NUMBER		= 50
 
 ifeq ($(HOST_OS_ARCH),WINNT)
-win_srcdir      := $(subst $(topsrcdir),$(WIN_TOP_SRC),$(srcdir))
+win_srcdir      := $(subst $(topsrcdir)/..,$(WIN_TOP_SRC),$(srcdir))
 BUILD_TOOLS     = $(WIN_TOP_SRC)/mozilla/build/unix
 else
 win_srcdir      := $(srcdir)
-BUILD_TOOLS     = $(MOZILLA_SRCDIR)/build/unix
+BUILD_TOOLS     = $(topsrcdir)/build/unix
 endif
 
 CONFIG_TOOLS	= $(MOZ_BUILD_ROOT)/mozilla/config
-AUTOCONF_TOOLS	= $(MOZILLA_SRCDIR)/build/autoconf
+AUTOCONF_TOOLS	= $(topsrcdir)/build/autoconf
 
 #
 # Strip off the excessively long version numbers on these platforms,
 # but save the version to allow multiple versions of the same base
 # platform to be built in the same tree.
 #
 ifneq (,$(filter FreeBSD HP-UX Linux NetBSD OpenBSD SunOS,$(OS_ARCH)))
 OS_RELEASE	:= $(basename $(OS_RELEASE))
@@ -193,19 +193,19 @@ ifdef WANT_MOZILLA_CONFIG_OS_VERSION
 OS_VERS		:= $(suffix $(OS_RELEASE))
 OS_VERSION	:= $(shell echo $(OS_VERS) | sed 's/-.*//')
 endif
 
 endif
 
 OS_CONFIG	:= $(OS_ARCH)$(OS_RELEASE)
 
-FINAL_LINK_LIBS = $(MOZDEPTH)/config/final-link-libs
-FINAL_LINK_COMPS = $(MOZDEPTH)/config/final-link-comps
-FINAL_LINK_COMP_NAMES = $(MOZDEPTH)/config/final-link-comp-names
+FINAL_LINK_LIBS = $(DEPTH)/config/final-link-libs
+FINAL_LINK_COMPS = $(DEPTH)/config/final-link-comps
+FINAL_LINK_COMP_NAMES = $(DEPTH)/config/final-link-comp-names
 
 ifdef _MSC_VER
 CC_WRAPPER ?= $(call py_action,cl)
 CXX_WRAPPER ?= $(call py_action,cl)
 endif # _MSC_VER
 
 CC := $(CC_WRAPPER) $(CC)
 CXX := $(CXX_WRAPPER) $(CXX)
@@ -377,17 +377,17 @@ DEFINES += \
 		$(NULL)
 
 ifndef MOZ_NATIVE_ZLIB
 DEFINES += -DZLIB_INTERNAL
 endif
 endif
 
 MAKE_JARS_FLAGS = \
-	-t $(topsrcdir) \
+	-t $(topsrcdir)/.. \
 	-f $(MOZ_CHROME_FILE_FORMAT) \
 	$(NULL)
 
 ifdef USE_EXTENSION_MANIFEST
 MAKE_JARS_FLAGS += -e
 endif
 
 ifdef BOTH_MANIFESTS
@@ -521,17 +521,17 @@ endif
 ifneq (WINNT_,$(OS_ARCH)_$(GNU_CC))
 LIBS_DIR	= -L$(DIST)/bin -L$(DIST)/lib
 ifdef LIBXUL_SDK
 LIBS_DIR	+= -L$(LIBXUL_SDK)/bin -L$(LIBXUL_SDK)/lib
 endif
 endif
 
 # Default location of include files
-IDL_PARSER_DIR = $(topsrcdir)/xpcom/idl-parser
+IDL_PARSER_DIR = $(topsrcdir)/../xpcom/idl-parser
 IDL_PARSER_CACHE_DIR = $(DEPTH)/xpcom/idl-parser
 
 SDK_LIB_DIR = $(DIST)/sdk/lib
 SDK_BIN_DIR = $(DIST)/sdk/bin
 
 DEPENDENCIES	= .md
 
 MOZ_COMPONENT_LIBS=$(XPCOM_LIBS) $(MOZ_COMPONENT_NSPR_LIBS)
@@ -544,17 +544,17 @@ ELF_DYNSTR_GC	= :
 
 ifeq ($(MOZ_WIDGET_TOOLKIT),qt)
 OS_LIBS += $(MOZ_QT_LIBS)
 endif
 
 ifndef CROSS_COMPILE
 ifdef USE_ELF_DYNSTR_GC
 ifdef MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS
-ELF_DYNSTR_GC 	= $(MOZDEPTH)/config/elf-dynstr-gc
+ELF_DYNSTR_GC 	= $(DEPTH)/config/elf-dynstr-gc
 endif
 endif
 endif
 
 ifeq ($(OS_ARCH),Darwin)
 ifdef NEXT_ROOT
 export NEXT_ROOT
 PBBUILD = NEXT_ROOT= $(PBBUILD_BIN)
@@ -633,17 +633,17 @@ GARBAGE		+= $(DEPENDENCIES) core $(wildc
 
 ifeq ($(OS_ARCH),Darwin)
 ifndef NSDISTMODE
 NSDISTMODE=absolute_symlink
 endif
 PWD := $(CURDIR)
 endif
 
-NSINSTALL_PY := $(PYTHON) $(abspath $(MOZILLA_SRCDIR)/config/nsinstall.py)
+NSINSTALL_PY := $(PYTHON) $(abspath $(topsrcdir)/config/nsinstall.py)
 # For Pymake, whereever we use nsinstall.py we're also going to try to make it
 # a native command where possible. Since native commands can't be used outside
 # of single-line commands, we continue to provide INSTALL for general use.
 # Single-line commands should be switched over to install_cmd.
 NSINSTALL_NATIVECMD := %nsinstall nsinstall
 
 ifdef NSINSTALL_BIN
 NSINSTALL = $(NSINSTALL_BIN)
@@ -692,18 +692,18 @@ dir_install_cmd = install_cmd
 AB_CD = $(MOZ_UI_LOCALE)
 
 ifndef L10NBASEDIR
   L10NBASEDIR = $(error L10NBASEDIR not defined by configure)
 else
   IS_LANGUAGE_REPACK = 1
 endif
 
-EXPAND_LOCALE_SRCDIR = $(if $(filter en-US,$(AB_CD)),$(topsrcdir)/$(1)/en-US,$(or $(realpath $(L10NBASEDIR)),$(abspath $(L10NBASEDIR)))/$(AB_CD)/$(subst /locales,,$(1)))
-EXPAND_MOZLOCALE_SRCDIR = $(if $(filter en-US,$(AB_CD)),$(MOZILLA_SRCDIR)/$(1)/en-US,$(or $(realpath $(L10NBASEDIR)),$(abspath $(L10NBASEDIR)))/$(AB_CD)/$(subst /locales,,$(1)))
+EXPAND_LOCALE_SRCDIR = $(if $(filter en-US,$(AB_CD)),$(topsrcdir)/../$(1)/en-US,$(or $(realpath $(L10NBASEDIR)),$(abspath $(L10NBASEDIR)))/$(AB_CD)/$(subst /locales,,$(1)))
+EXPAND_MOZLOCALE_SRCDIR = $(if $(filter en-US,$(AB_CD)),$(topsrcdir)/$(1)/en-US,$(or $(realpath $(L10NBASEDIR)),$(abspath $(L10NBASEDIR)))/$(AB_CD)/$(subst /locales,,$(1)))
 
 ifdef relativesrcdir
 LOCALE_SRCDIR = $(call EXPAND_LOCALE_SRCDIR,$(relativesrcdir))
 endif
 
 ifdef relativesrcdir
 MAKE_JARS_FLAGS += --relativesrcdir=$(relativesrcdir)
 ifneq (en-US,$(AB_CD))
@@ -729,24 +729,24 @@ else
 MERGE_FILE = $(LOCALE_SRCDIR)/$(1)
 endif
 MERGE_FILES = $(foreach f,$(1),$(call MERGE_FILE,$(f)))
 
 ifneq (WINNT,$(OS_ARCH))
 RUN_TEST_PROGRAM = $(DIST)/bin/run-mozilla.sh
 endif # ! WINNT
 
-CREATE_PRECOMPLETE_CMD = $(PYTHON) $(abspath $(MOZILLA_SRCDIR)/config/createprecomplete.py)
+CREATE_PRECOMPLETE_CMD = $(PYTHON) $(abspath $(topsrcdir)/config/createprecomplete.py)
 
 # MDDEPDIR is the subdirectory where dependency files are stored
 MDDEPDIR := .deps
 
-EXPAND_LIBS = $(PYTHON) $(MOZILLA_SRCDIR)/config/expandlibs.py
-EXPAND_LIBS_EXEC = $(PYTHON) $(MOZILLA_SRCDIR)/config/expandlibs_exec.py $(if $@,--depend $(MDDEPDIR)/$(basename $(@F)).pp --target $@)
-EXPAND_LIBS_GEN = $(PYTHON) $(MOZILLA_SRCDIR)/config/expandlibs_gen.py $(if $@,--depend $(MDDEPDIR)/$(basename $(@F)).pp)
+EXPAND_LIBS = $(PYTHON) $(topsrcdir)/config/expandlibs.py
+EXPAND_LIBS_EXEC = $(PYTHON) $(topsrcdir)/config/expandlibs_exec.py $(if $@,--depend $(MDDEPDIR)/$(basename $(@F)).pp --target $@)
+EXPAND_LIBS_GEN = $(PYTHON) $(topsrcdir)/config/expandlibs_gen.py $(if $@,--depend $(MDDEPDIR)/$(basename $(@F)).pp)
 EXPAND_AR = $(EXPAND_LIBS_EXEC) --extract -- $(AR)
 EXPAND_CC = $(EXPAND_LIBS_EXEC) --uselist -- $(CC)
 EXPAND_CCC = $(EXPAND_LIBS_EXEC) --uselist -- $(CCC)
 EXPAND_LD = $(EXPAND_LIBS_EXEC) --uselist -- $(LD)
 EXPAND_MKSHLIB = $(EXPAND_LIBS_EXEC) --uselist -- $(MKSHLIB)
 
 # EXPAND_LIBNAME - $(call EXPAND_LIBNAME,foo)
 # expands to $(LIB_PREFIX)foo.$(LIB_SUFFIX) or -lfoo, depending on linker
@@ -770,20 +770,20 @@ EXPAND_MOZLIBNAME = $(foreach lib,$(1),$
 ifndef MOZ_SYSTEM_PLY
 PLY_INCLUDE = -I$(MOZILLA_DIR)/other-licenses/ply
 endif
  
 export CL_INCLUDES_PREFIX
 
 ifneq (,$(MOZ_LIBSTDCXX_TARGET_VERSION)$(MOZ_LIBSTDCXX_HOST_VERSION))
 ifdef MOZ_LIBSTDCXX_TARGET_VERSION
-EXTRA_LIBS += $(call EXPAND_LIBNAME_PATH,stdc++compat,$(DEPTH)/mozilla/build/unix/stdc++compat)
+EXTRA_LIBS += $(call EXPAND_LIBNAME_PATH,stdc++compat,$(DEPTH)/build/unix/stdc++compat)
 endif
 ifdef MOZ_LIBSTDCXX_HOST_VERSION
-HOST_EXTRA_LIBS += $(call EXPAND_LIBNAME_PATH,host_stdc++compat,$(DEPTH)/mozilla/build/unix/stdc++compat)
+HOST_EXTRA_LIBS += $(call EXPAND_LIBNAME_PATH,host_stdc++compat,$(DEPTH)/build/unix/stdc++compat)
 endif
 endif
 
 # autoconf.mk sets OBJ_SUFFIX to an error to avoid use before including
 # this file
 OBJ_SUFFIX := $(_OBJ_SUFFIX)
 
 DEFINES += -DNO_NSPR_10_SUPPORT
--- a/config/makefiles/makeutils.mk
+++ b/config/makefiles/makeutils.mk
@@ -102,17 +102,17 @@ checkIfEmpty =$(foreach var,$(wordlist 2
 errorIfEmpty =$(call checkIfEmpty,error $(argv))
 warnIfEmpty  =$(call checkIfEmpty,warning $(argv))
 
 endif #}
 
 ###########################################################################
 ## Common makefile library loader
 ###########################################################################
-topORerr =$(if $(topsrcdir),$(topsrcdir),$(error topsrcdir is not defined))
+topORerr =$(if $(topsrcdir)/..,$(topsrcdir)/..,$(error topsrcdir is not defined))
 
 ifdef USE_AUTOTARGETS_MK # mkdir_deps
   include $(topORerr)/config/makefiles/autotargets.mk
 endif
 
 ifdef USE_RCS_MK
   include $(topORerr)/config/makefiles/rcs.mk
 endif
--- a/config/makefiles/rcs.mk
+++ b/config/makefiles/rcs.mk
@@ -5,31 +5,31 @@
 # 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/.
 #
 
 ifdef USE_RCS_MK #{
 
 ifndef INCLUDED_RCS_MK #{
 
-MOZ_RCS_TYPE_HG ?= $(notdir $(wildcard $(topsrcdir)/.hg))
-MOZ_RCS_TYPE_GIT ?= $(notdir $(wildcard $(topsrcdir)/.git))
+MOZ_RCS_TYPE_HG ?= $(notdir $(wildcard $(topsrcdir)/../.hg))
+MOZ_RCS_TYPE_GIT ?= $(notdir $(wildcard $(topsrcdir)/../.git))
 
 
 ###########################################################################
 # HAVE_MERCURIAL_RCS
 ###########################################################################
 ifeq (.hg,$(MOZ_RCS_TYPE_HG)) #{
 
 # Intent: Retrieve the http:// repository path for a directory.
 # Usage: $(call getSourceRepo[,repo_dir|args])
 # Args:
-#   path (optional): repository to query.  Defaults to $(topsrcdir)
+#   path (optional): repository to query.  Defaults to $(topsrcdir)/..
 getSourceRepo = \
-  $(call FUNC_getSourceRepo,$(if $(1),cd $(1) && hg,hg --repository $(topsrcdir)))
+  $(call FUNC_getSourceRepo,$(if $(1),cd $(1) && hg,hg --repository $(topsrcdir)/..))
 
 # return: http://hg.mozilla.org/mozilla-central
 FUNC_getSourceRepo = \
   $(strip \
     $(patsubst %/,%,\
     $(patsubst ssh://%,http://%,\
     $(firstword $(shell $(getargv) showconfig paths.default))\
     )))
@@ -38,17 +38,17 @@ FUNC_getSourceRepo = \
 
 ###########################################################################
 # HAVE_GIT_RCS
 ###########################################################################
 else ifeq (.git,$(MOZ_RCS_TYPE_GIT)) #{
 
 GIT ?= git
 getSourceRepo = \
-  $(shell cd $(topsrcdir) && $(GIT) rev-parse --verify HEAD)
+  $(shell cd $(topsrcdir)/.. && $(GIT) rev-parse --verify HEAD)
 
 endif #} HAVE_GIT_RCS
 
 
 INCLUDED_RCS_MK := 1
 endif #}
 
 endif #}
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -20,17 +20,17 @@ INCLUDED_RULES_MK = 1
 _eval_for_side_effects := $(CHECK_MOZBUILD_VARIABLES)
 
 ifdef TIERS
 DIRS += $(foreach tier,$(TIERS),$(tier_$(tier)_dirs))
 STATIC_DIRS += $(foreach tier,$(TIERS),$(tier_$(tier)_staticdirs))
 endif
 
 ifndef MOZILLA_DIR
-MOZILLA_DIR = $(MOZILLA_SRCDIR)
+MOZILLA_DIR = $(topsrcdir)
 endif
 
 ifndef INCLUDED_CONFIG_MK
 include $(topsrcdir)/config/config.mk
 endif
 
 ifndef INCLUDED_VERSION_MK
 include $(topsrcdir)/config/version.mk
@@ -584,27 +584,27 @@ endif # LIBRARY_NAME
 
 ifneq (,$(filter-out %.$(LIB_SUFFIX),$(SHARED_LIBRARY_LIBS)))
 $(error SHARED_LIBRARY_LIBS must contain .$(LIB_SUFFIX) files only)
 endif
 
 HOST_LIBS_DEPS = $(filter %.$(LIB_SUFFIX),$(HOST_LIBS))
 
 # Dependencies which, if modified, should cause everything to rebuild
-GLOBAL_DEPS += Makefile $(DEPTH)/config/autoconf.mk $(topsrcdir)/config/config.mk
+GLOBAL_DEPS += Makefile $(DEPTH)/config/autoconf.mk $(topsrcdir)/../config/config.mk
 
 ##############################################
 compile:: $(MAKE_DIRS) $(OBJS) $(HOST_OBJS)
 
 ifdef EXPORT_LIBRARY
 ifeq ($(EXPORT_LIBRARY),1)
 ifdef IS_COMPONENT
-EXPORT_LIBRARY = $(MOZDEPTH)/staticlib/components
+EXPORT_LIBRARY = $(DEPTH)/staticlib/components
 else
-EXPORT_LIBRARY = $(MOZDEPTH)/staticlib
+EXPORT_LIBRARY = $(DEPTH)/staticlib
 endif
 else
 # If EXPORT_LIBRARY has a value, we'll be installing there. We also need to cleanup there
 GARBAGE += $(foreach lib,$(LIBRARY),$(EXPORT_LIBRARY)/$(lib))
 endif
 endif # EXPORT_LIBRARY
 
 libs:: $(MAKE_DIRS) $(HOST_LIBRARY) $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY) $(HOST_PROGRAM) $(PROGRAM) $(HOST_SIMPLE_PROGRAMS) $(SIMPLE_PROGRAMS)
@@ -675,32 +675,32 @@ ifdef PROGRAM
 endif
 
 # In the second pass, we need to merge the pgc files into the pgd file.
 # The compiler would do this for us automatically if they were in the right
 # place, but they're in dist/bin.
 ifneq (,$(SHARED_LIBRARY)$(PROGRAM))
 export::
 ifdef PROGRAM
-	$(PYTHON) $(MOZILLA_SRCDIR)/build/win32/pgomerge.py \
+	$(PYTHON) $(topsrcdir)/build/win32/pgomerge.py \
 	  $(PROGRAM:$(BIN_SUFFIX)=) $(DIST)/bin
 endif
 ifdef SHARED_LIBRARY
-	$(PYTHON) $(MOZILLA_SRCDIR)/build/win32/pgomerge.py \
+	$(PYTHON) $(topsrcdir)/build/win32/pgomerge.py \
 	  $(SHARED_LIBRARY_NAME) $(DIST)/bin
 endif
 endif # SHARED_LIBRARY || PROGRAM
 endif # WINNT_
 endif # MOZ_PROFILE_GENERATE || MOZ_PROFILE_USE
 endif # NO_PROFILE_GUIDED_OPTIMIZE
 
 ##############################################
 
 checkout:
-	$(PYTHON) $(topsrcdir)/client.py checkout
+	$(PYTHON) $(topsrcdir)/../client.py checkout
 
 clean clobber realclean clobber_all::
 	-$(RM) $(ALL_TRASH)
 	-$(RM) -r $(ALL_TRASH_DIRS)
 	$(foreach dir,$(PARALLEL_DIRS) $(DIRS) $(STATIC_DIRS) $(TOOL_DIRS),-$(call SUBMAKE,$@,$(dir)))
 
 distclean::
 	$(foreach dir,$(PARALLEL_DIRS) $(DIRS) $(STATIC_DIRS) $(TOOL_DIRS),-$(call SUBMAKE,$@,$(dir)))
@@ -708,17 +708,17 @@ distclean::
 	-$(RM) $(ALL_TRASH)  \
 	Makefile .HSancillary \
 	$(wildcard *.$(OBJ_SUFFIX)) $(wildcard *.ho) $(wildcard host_*.o*) \
 	$(wildcard *.$(LIB_SUFFIX)) $(wildcard *$(DLL_SUFFIX)) \
 	$(wildcard *.$(IMPORT_LIB_SUFFIX))
 
 alltags:
 	$(RM) TAGS
-	find $(topsrcdir) -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' -o -name '*.idl' \) -print | $(TAG_PROGRAM)
+	find $(topsrcdir)/.. -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' -o -name '*.idl' \) -print | $(TAG_PROGRAM)
 
 #
 # PROGRAM = Foo
 # creates OBJS, links with LIBS to create Foo
 #
 $(PROGRAM): $(PROGOBJS) $(EXTRA_DEPS) $(EXE_DEF_FILE) $(RESFILE) $(GLOBAL_DEPS)
 	@$(RM) $@.manifest
 ifeq (_WINNT,$(GNU_CC)_$(OS_ARCH))
@@ -1055,25 +1055,25 @@ endif
 ###############################################################################
 
 ifdef MOZBUILD_DERIVED
 
 # If this Makefile is derived from moz.build files, substitution for all .in
 # files is handled by SUBSTITUTE_FILES. This includes Makefile.in.
 ifneq ($(SUBSTITUTE_FILES),,)
 $(SUBSTITUTE_FILES): % : $(srcdir)/%.in $(DEPTH)/config/autoconf.mk
-	@$(PYTHON) $(MOZDEPTH)/config.status -n --file=$@
+	@$(PYTHON) $(DEPTH)/config.status -n --file=$@
 	@$(TOUCH) $@
 endif
 
 # Detect when the backend.mk needs rebuilt. This will cause a full scan and
 # rebuild. While relatively expensive, it should only occur once per recursion.
 ifneq ($(BACKEND_INPUT_FILES),,)
 backend.mk: $(BACKEND_INPUT_FILES)
-	@$(PYTHON) $(MOZDEPTH)/config.status -n
+	@$(PYTHON) $(DEPTH)/config.status -n
 	@$(TOUCH) $@
 endif
 
 endif # MOZBUILD_DERIVED
 
 ###############################################################################
 # Bunch of things that extend the 'export' rule (in order):
 ###############################################################################
@@ -1134,17 +1134,17 @@ endif
 # Copy testing-only JS modules to appropriate destination.
 #
 # For each file defined in TESTING_JS_MODULES, copy it to
 # objdir/_tests/modules/. If TESTING_JS_MODULE_DIR is defined, that path
 # wlll be appended to the output directory.
 
 ifdef ENABLE_TESTS
 ifdef TESTING_JS_MODULES
-testmodulesdir = $(MOZDEPTH)/_tests/modules/$(TESTING_JS_MODULE_DIR)
+testmodulesdir = $(DEPTH)/_tests/modules/$(TESTING_JS_MODULE_DIR)
 
 libs::
 	$(NSINSTALL) -D $(testmodulesdir)
 
 libs:: $(TESTING_JS_MODULES)
 ifndef NO_DIST_INSTALL
 	$(INSTALL) $(IFLAGS) $^ $(testmodulesdir)
 endif
@@ -1167,17 +1167,17 @@ endif
 endif
 
 ################################################################################
 # Install a linked .xpt into the appropriate place.
 # This should ideally be performed by the non-recursive idl make file. Some day.
 ifdef XPT_NAME #{
 
 ifndef NO_DIST_INSTALL
-_XPT_NAME_FILES := $(MOZDEPTH)/config/makefiles/xpidl/xpt/$(XPT_NAME)
+_XPT_NAME_FILES := $(DEPTH)/config/makefiles/xpidl/xpt/$(XPT_NAME)
 _XPT_NAME_DEST := $(FINAL_TARGET)/components
 INSTALL_TARGETS += _XPT_NAME
 
 ifndef NO_INTERFACES_MANIFEST
 libs:: $(call mkdir_deps,$(FINAL_TARGET)/components)
 	$(call py_action,buildlist,$(FINAL_TARGET)/components/interfaces.manifest "interfaces $(XPT_NAME)")
 	$(call py_action,buildlist,$(FINAL_TARGET)/chrome.manifest "manifest components/interfaces.manifest")
 endif
@@ -1557,23 +1557,23 @@ echo-tier-dirs:
 
 echo-dirs:
 	@echo $(DIRS)
 
 echo-module:
 	@echo $(MODULE)
 
 echo-depth-path:
-	@$(MOZILLA_SRCDIR)/build/unix/print-depth-path.sh
+	@$(topsrcdir)/build/unix/print-depth-path.sh
 
 echo-module-name:
-	@$(MOZILLA_SRCDIR)/build/package/rpm/print-module-name.sh
+	@$(topsrcdir)/build/package/rpm/print-module-name.sh
 
 echo-module-filelist:
-	@$(MOZILLA_SRCDIR)/build/package/rpm/print-module-filelist.sh
+	@$(topsrcdir)/build/package/rpm/print-module-filelist.sh
 
 showtargs:
 ifneq (,$(filter $(PROGRAM) $(HOST_PROGRAM) $(SIMPLE_PROGRAMS) $(HOST_LIBRARY) $(LIBRARY) $(SHARED_LIBRARY),$(TARGETS)))
 	@echo --------------------------------------------------------------------------------
 	@echo "PROGRAM             = $(PROGRAM)"
 	@echo "SIMPLE_PROGRAMS     = $(SIMPLE_PROGRAMS)"
 	@echo "LIBRARY             = $(LIBRARY)"
 	@echo "SHARED_LIBRARY      = $(SHARED_LIBRARY)"
--- a/config/static-checking-config.mk
+++ b/config/static-checking-config.mk
@@ -1,34 +1,34 @@
 # 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/.
 
 # The entire tree should be subject to static analysis using the XPCOM
 # script. Additional scripts may be added by specific subdirectories.
 
-DEHYDRA_SCRIPT = $(MOZILLA_SRCDIR)/config/static-checking.js
+DEHYDRA_SCRIPT = $(topsrcdir)/config/static-checking.js
 
 DEHYDRA_MODULES = \
-  $(MOZILLA_SRCDIR)/xpcom/analysis/final.js \
-  $(MOZILLA_SRCDIR)/xpcom/analysis/override.js \
-  $(MOZILLA_SRCDIR)/xpcom/analysis/must-override.js \
+  $(topsrcdir)/xpcom/analysis/final.js \
+  $(topsrcdir)/xpcom/analysis/override.js \
+  $(topsrcdir)/xpcom/analysis/must-override.js \
   $(NULL)
 
 TREEHYDRA_MODULES = \
-  $(MOZILLA_SRCDIR)/xpcom/analysis/outparams.js \
-  $(MOZILLA_SRCDIR)/xpcom/analysis/stack.js \
-  $(MOZILLA_SRCDIR)/xpcom/analysis/flow.js \
-  $(MOZILLA_SRCDIR)/js/src/jsstack.js \
-  $(MOZILLA_SRCDIR)/layout/generic/frame-verify.js \
+  $(topsrcdir)/xpcom/analysis/outparams.js \
+  $(topsrcdir)/xpcom/analysis/stack.js \
+  $(topsrcdir)/xpcom/analysis/flow.js \
+  $(topsrcdir)/js/src/jsstack.js \
+  $(topsrcdir)/layout/generic/frame-verify.js \
   $(NULL)
 
 DEHYDRA_ARGS = \
-  --topsrcdir=$(topsrcdir) \
-  --objdir=$(MOZDEPTH) \
+  --topsrcdir=$(topsrcdir)/.. \
+  --objdir=$(DEPTH) \
   --dehydra-modules=$(subst $(NULL) ,$(COMMA),$(strip $(DEHYDRA_MODULES))) \
   --treehydra-modules=$(subst $(NULL) ,$(COMMA),$(strip $(TREEHYDRA_MODULES))) \
   $(NULL)
 
 DEHYDRA_FLAGS = -fplugin=$(DEHYDRA_PATH) -fplugin-arg='$(DEHYDRA_SCRIPT) $(DEHYDRA_ARGS)'
 
 ifdef DEHYDRA_PATH
 OS_CXXFLAGS += $(DEHYDRA_FLAGS)
--- a/config/static-rules.mk
+++ b/config/static-rules.mk
@@ -7,17 +7,17 @@ ifdef _NO_AUTO_VARS
 _TARGET = $(srcdir)/$(@F)
 else
 _TARGET = $@
 endif
 
 $(warning FINAL_LINK_COMP_NAMES = $(FINAL_LINK_COMP_NAMES))
 $(warning FINAL_LINK_COMPS = $(FINAL_LINK_COMPS))
 
-nsStaticComponents.cpp: $(MOZILLA_SRCDIR)/config/nsStaticComponents.cpp.in $(GLOBAL_DEPS) $(FINAL_LINK_COMP_NAMES)
+nsStaticComponents.cpp: $(topsrcdir)/config/nsStaticComponents.cpp.in $(GLOBAL_DEPS) $(FINAL_LINK_COMP_NAMES)
 	rm -f $@
 	cat $< | \
 	sed -e "s|%MODULE_LIST%|$(foreach m, $(STATIC_COMPONENT_LIST),MODULE($(m)))|" \
 	> $(_TARGET)
 
 GARBAGE += nsStaticComponents.cpp
 
 ifeq ($(OS_ARCH),IRIX)
--- a/config/version.mk
+++ b/config/version.mk
@@ -10,17 +10,17 @@ INCLUDED_VERSION_MK=1
 # TODO:
 # PBI      : Private build info.  Not used currently.
 #            Guessing the best way would be to set an env var.
 # BINARY   : Binary name.  Not used currently.
 ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
 ifndef RESFILE
 RCFILE=./module.rc
 RESFILE=./module.res
-_RC_STRING = -QUIET 1 -DEPTH $(MOZDEPTH) -TOPSRCDIR $(MOZILLA_SRCDIR) -OBJDIR . -SRCDIR $(srcdir) -DISPNAME $(MOZ_APP_DISPLAYNAME) -APPVERSION $(MOZ_APP_VERSION)
+_RC_STRING = -QUIET 1 -DEPTH $(DEPTH) -TOPSRCDIR $(topsrcdir) -OBJDIR . -SRCDIR $(srcdir) -DISPNAME $(MOZ_APP_DISPLAYNAME) -APPVERSION $(MOZ_APP_VERSION)
 ifdef MOZILLA_OFFICIAL
 _RC_STRING += -OFFICIAL 1
 endif
 ifdef MOZ_DEBUG
 _RC_STRING += -DEBUG 1
 endif
 ifdef MODULE
 _RC_STRING += -MODNAME $(MODULE)
@@ -40,15 +40,15 @@ ifdef RCINCLUDE
 _RC_STRING += -RCINCLUDE $(srcdir)/$(RCINCLUDE)
 endif
 
 GARBAGE += $(RESFILE) $(RCFILE)
 
 #dummy target so $(RCFILE) doesn't become the default =P
 all::
 
-$(RCFILE): $(RCINCLUDE) $(MOZILLA_SRCDIR)/config/version_win.pl
-	$(PERL) $(MOZILLA_SRCDIR)/config/version_win.pl $(_RC_STRING)
+$(RCFILE): $(RCINCLUDE) $(topsrcdir)/config/version_win.pl
+	$(PERL) $(topsrcdir)/config/version_win.pl $(_RC_STRING)
 
 endif  # RESFILE
 endif  # Windows
 
 endif
--- a/im/app/Makefile.in
+++ b/im/app/Makefile.in
@@ -6,27 +6,27 @@ DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 AB_CD = $(MOZ_UI_LOCALE)
 
-GRE_MILESTONE = $(shell $(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build Milestone)
-GRE_BUILDID = $(shell $(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build BuildID)
+GRE_MILESTONE = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build Milestone)
+GRE_BUILDID = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build BuildID)
 
-LICENSE_TXT_FILE = $(topsrcdir)/im/LICENSE.txt
+LICENSE_TXT_FILE = $(topsrcdir)/../im/LICENSE.txt
 
-MOZ_SOURCE_STAMP = $(firstword $(shell hg -R $(topsrcdir) parent --template="{node|short}\n" 2>/dev/null))
+MOZ_SOURCE_STAMP = $(firstword $(shell hg -R $(topsrcdir)/.. parent --template="{node|short}\n" 2>/dev/null))
 ifdef MOZ_SOURCE_STAMP
 DEFINES += -DMOZ_SOURCE_STAMP="$(MOZ_SOURCE_STAMP)"
 endif
 
-SOURCE_REPO := $(shell hg -R $(topsrcdir) showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/http:/")
+SOURCE_REPO := $(shell hg -R $(topsrcdir)/.. showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/http:/")
 ifdef SOURCE_REPO
 DEFINES += -DMOZ_SOURCE_REPO="$(SOURCE_REPO)"
 endif
 
 ifdef MOZILLA_OFFICIAL
 DEFINES += -DMOZILLA_OFFICIAL
 endif
 
@@ -82,24 +82,24 @@ WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStar
 endif
 
 ifeq ($(OS_ARCH),WINNT)
 # png to ico converter. The function takes 5 arguments, in order: source png
 # file, left, top, size, output ico file.
 png2ico = $(PYTHON) $(srcdir)/png2ico.py $(1) $(2) $(3) $(4) $(5)
 
 # Extract the icons we care about embedding into the EXE
-available-16.ico: $(topsrcdir)/chat/themes/available-16.png $(srcdir)/png2ico.py
-	$(call png2ico,$(topsrcdir)/chat/themes/available-16.png,0,0,16,available-16.ico)
+available-16.ico: $(topsrcdir)/../chat/themes/available-16.png $(srcdir)/png2ico.py
+	$(call png2ico,$(topsrcdir)/../chat/themes/available-16.png,0,0,16,available-16.ico)
 
-away-16.ico: $(topsrcdir)/chat/themes/away-16.png $(srcdir)/png2ico.py
-	$(call png2ico,$(topsrcdir)/chat/themes/away-16.png,0,0,16,away-16.ico)
+away-16.ico: $(topsrcdir)/../chat/themes/away-16.png $(srcdir)/png2ico.py
+	$(call png2ico,$(topsrcdir)/../chat/themes/away-16.png,0,0,16,away-16.ico)
 
-offline-16.ico: $(topsrcdir)/chat/themes/offline-16.png $(srcdir)/png2ico.py
-	$(call png2ico,$(topsrcdir)/chat/themes/offline-16.png,0,0,16,offline-16.ico)
+offline-16.ico: $(topsrcdir)/../chat/themes/offline-16.png $(srcdir)/png2ico.py
+	$(call png2ico,$(topsrcdir)/../chat/themes/offline-16.png,0,0,16,offline-16.ico)
 
 embedded-icons:: available-16.ico away-16.ico offline-16.ico
 GARBAGE += available-16.ico away-16.ico offline-16.ico
 
 RCINCLUDE = splash.rc
 # Rebuild instantbird.exe if the manifest changes - it's included by splash.rc.
 # (this dependency should really be just for instantbird.exe, not other targets)
 EXTRA_DEPS += $(PROGRAM).manifest
@@ -240,18 +240,18 @@ GARBAGE += module.ver
 libs:: $(srcdir)/profile/prefs.js
 	$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin/defaults/profile
 
 ifdef ENABLE_TESTS
 # XXX This is a hack to ensure that we get the right xpcshell.ini for our tests.
 # mozilla-central does this in testing/xpcshell-tests which means that it is very
 # hard for anyone to specify anything else.
 libs::
-	$(INSTALL) $(topsrcdir)/im/test/xpcshell.ini $(MOZDEPTH)/_tests/xpcshell
-	cp $(topsrcdir)/im/test/xpcshell.ini $(MOZDEPTH)/_tests/xpcshell/all-test-dirs.list
+	$(INSTALL) $(topsrcdir)/../im/test/xpcshell.ini $(DEPTH)/_tests/xpcshell
+	cp $(topsrcdir)/../im/test/xpcshell.ini $(DEPTH)/_tests/xpcshell/all-test-dirs.list
 endif
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 
 MAC_APP_NAME = $(MOZ_APP_DISPLAYNAME)
 
 ifdef MOZ_DEBUG
 MAC_APP_NAME := $(MAC_APP_NAME)Debug
--- a/im/build.mk
+++ b/im/build.mk
@@ -1,18 +1,18 @@
 # 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/.
 
 ifdef COMM_BUILD
 
 ifndef MOZILLA_DIR
-MOZILLA_DIR = $(MOZILLA_SRCDIR)
+MOZILLA_DIR = $(topsrcdir)
 endif
-include $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/package-name.mk
+include $(topsrcdir)olkit/mozapps/installer/package-name.mk
 
 BUILD_YEAR := $(shell echo $(BUILDID) | cut -c 1-4)
 BUILD_MONTH := $(shell echo $(BUILDID) | cut -c 5-6)
 BUILD_DAY := $(shell echo $(BUILDID) | cut -c 7-8)
 BUILD_HOUR := $(shell echo $(BUILDID) | cut -c 9-10)
 
 ifndef PKG_SUFFIX
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
@@ -71,53 +71,53 @@ FORCE_UPDATE := components/components.li
 
 #If there's a symbol server:
 # SYMBOL_SERVER_HOST=symbols.instantbird.org
 # SYMBOL_SERVER_PATH=/www/instantbird/socorro/symbols
 # SYMBOL_SERVER_PORT=22
 # SYMBOL_SERVER_USER=buildbot
 
 distribution:
-	@$(MAKE) -C mozilla MAKE_SYM_STORE_PATH=$(MAKE_SYM_STORE_PATH) SYM_STORE_SOURCE_DIRS='$(topsrcdir)/mozilla/extensions/purple $(topsrcdir)/mozilla $(topsrcdir)' buildsymbols
+	@$(MAKE) -C mozilla MAKE_SYM_STORE_PATH=$(MAKE_SYM_STORE_PATH) SYM_STORE_SOURCE_DIRS='$(topsrcdir)/../extensions/purple $(topsrcdir)/.. $(topsrcdir)/..' buildsymbols
 	@$(MAKE) -C im/installer libs installer
 ifdef ENABLE_TESTS
 	$(MAKE) xpcshell-tests
 endif
 ifdef MOZ_UPDATE_PACKAGING
-	$(MAKE) -C $(MOZDEPTH)/tools/update-packaging full-update PKG_INST_PATH=
+	$(MAKE) -C $(DEPTH)/tools/update-packaging full-update PKG_INST_PATH=
 endif
 ifdef L10NBASEDIR
 	$(foreach locale,$(SHIPPED_LOCALES),$(MAKE) -C im/locales/ repack-$(locale) LOCALE_MERGEDIR=mergedir MOZ_MAKE_COMPLETE_MAR=$(MOZ_UPDATE_PACKAGING) ;)
 endif
 ifdef MOZ_UPDATE_PACKAGING
 ifdef LIST_PREVIOUS_MAR_CMD
 	rm -rf $(PREVIOUS_MAR_DIR) $(PATCH_FILE)
 	mkdir $(PREVIOUS_MAR_DIR)
 	touch $(PATCH_FILE)
 	$(foreach marline,$(shell $(LIST_PREVIOUS_MAR_CMD)),\
 	  $(foreach MAR_FILE_SRC,$(shell echo $(marline) |cut -d : -f 3),\
 	    $(foreach AB_CD,$(filter $(shell echo $(marline) |cut -d : -f 2),$(AB_CD) $(SHIPPED_LOCALES)),\
 	      $(foreach buildid,$(shell echo $(marline) |cut -d : -f 1),\
 		mkdir -p $(PREVIOUS_MAR_DIR)/$(buildid) ; \
 	        $(DOWNLOAD_MAR_CMD) ; \
 		echo "$(MAR_FILE_DEST),$(DIST)/$(COMPLETE_MAR),$(DIST)/$(PKG_UPDATE_PATH)$(PKG_UPDATE_BASENAME).partial.from-$(buildid).mar,$(FORCE_UPDATE)" >> $(PATCH_FILE) ;))))
-	PATH="$(realpath $(LIBXUL_DIST)/host/bin):$(PATH)" $(PYTHON) $(MOZILLA_SRCDIR)/tools/update-packaging/make_incremental_updates.py -f $(PATCH_FILE)
+	PATH="$(realpath $(LIBXUL_DIST)/host/bin):$(PATH)" $(PYTHON) $(topsrcdir)/tools/update-packaging/make_incremental_updates.py -f $(PATCH_FILE)
 endif
 endif
 ifdef SYMBOL_SERVER_HOST
 	@$(MAKE) uploadsymbols
 endif
 ifdef UPLOAD_CMD
 	$(MAKE) upload
 endif
 
 installer:
 	@$(MAKE) -C im/installer installer
 
-SHIPPED_LOCALES_FILE = $(topsrcdir)/im/locales/shipped-locales
+SHIPPED_LOCALES_FILE = $(topsrcdir)/../im/locales/shipped-locales
 SHIPPED_LOCALES := $(shell if test -f $(SHIPPED_LOCALES_FILE); then cat $(SHIPPED_LOCALES_FILE); fi)
 
 package:
 	@$(MAKE) -C im/installer
 
 install::
 	@$(MAKE) -C im/installer install
 
--- a/im/installer/Makefile.in
+++ b/im/installer/Makefile.in
@@ -104,18 +104,18 @@ endif
 NON_OMNIJAR_FILES =
 
 ifndef LIBXUL_SDK
 INSTALL_SDK = 1
 endif
 
 GENERATE_CACHE=1
 
-include $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/signing.mk
-include $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/packager.mk
+include $(topsrcdir)olkit/mozapps/installer/signing.mk
+include $(topsrcdir)olkit/mozapps/installer/packager.mk
 
 ifeq (Darwin, $(OS_ARCH))
 BINPATH = $(_BINPATH)
 DEFINES += -DAPPNAME=$(_APPNAME)
 else
 BINPATH = bin
 endif
 DEFINES += -DBINPATH=$(BINPATH)
@@ -151,12 +151,12 @@ ifdef MOZ_PKG_MANIFEST_P
 	rm -f $(DIST)/pack-list.txt $(DIST)/bin-list.txt
 endif
 
 installer:
 ifdef INSTALLER_DIR
 	$(MAKE) -C $(INSTALLER_DIR)
 endif
 
-APP_SOURCE_STAMP = $(firstword $(shell hg -R $(topsrcdir) parent --template="{node|short}\n" 2>/dev/null))
-APP_SOURCE_REPO = $(shell hg -R $(topsrcdir) showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/http:/")
+APP_SOURCE_STAMP = $(firstword $(shell hg -R $(topsrcdir)/.. parent --template="{node|short}\n" 2>/dev/null))
+APP_SOURCE_REPO = $(shell hg -R $(topsrcdir)/.. showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/http:/")
 make-sourcestamp-file::
 	@echo "$(APP_SOURCE_REPO)/rev/$(APP_SOURCE_STAMP)" >> $(MOZ_SOURCESTAMP_FILE)
--- a/im/installer/windows/Makefile.in
+++ b/im/installer/windows/Makefile.in
@@ -4,23 +4,23 @@
 
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-include $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/package-name.mk
+include $(topsrcdir)olkit/mozapps/installer/package-name.mk
 
 PKG_INST_PATH =
 CONFIG_DIR = instgen
-SFX_MODULE = $(topsrcdir)/other-licenses/7zstub/instantbird/7zSD.sfx
+SFX_MODULE = $(topsrcdir)/../other-licenses/7zstub/instantbird/7zSD.sfx
 DEFINES += -DMOZ_APP_VERSION=$(MOZ_APP_VERSION)
-PRE_RELEASE_SUFFIX := $(shell $(PYTHON) $(topsrcdir)/mozilla/config/printprereleasesuffix.py $(MOZ_APP_VERSION))
+PRE_RELEASE_SUFFIX := $(shell $(PYTHON) $(topsrcdir)/../config/printprereleasesuffix.py $(MOZ_APP_VERSION))
 DEFINES += -DPRE_RELEASE_SUFFIX="$(PRE_RELEASE_SUFFIX)"
 
 ifdef MOZ_UPDATER
 DEFINES += -DMOZ_UPDATER=1
 endif
 
 INSTALLER_FILES = \
 	app.tag \
@@ -52,24 +52,24 @@ installer::
 # For building the uninstaller during the application build so it can be
 # included for mar file generation.
 uninstaller::
 	$(RM) -rf $(CONFIG_DIR) && mkdir $(CONFIG_DIR)
 	$(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
 	$(INSTALL) $(addprefix $(DIST)/branding/,$(BRANDING_FILES)) $(CONFIG_DIR)
 	$(call py_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \
 	  $(srcdir)/nsis/defines.nsi.in -o $(CONFIG_DIR)/defines.nsi)
-	$(PYTHON) $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
-          --preprocess-locale $(MOZILLA_SRCDIR) \
+	$(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
+          --preprocess-locale $(topsrcdir) \
 	  $(call EXPAND_LOCALE_SRCDIR,im/locales)/installer $(AB_CD) $(CONFIG_DIR)
 
 $(CONFIG_DIR)/setup.exe::
 	$(RM) -rf $(CONFIG_DIR) && mkdir $(CONFIG_DIR)
 	$(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
 	$(INSTALL) $(addprefix $(DIST)/branding/,$(BRANDING_FILES)) $(CONFIG_DIR)
 	$(call py_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \
 	  $(srcdir)/nsis/defines.nsi.in -o $(CONFIG_DIR)/defines.nsi)
-	$(PYTHON) $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
-	  --preprocess-locale $(MOZILLA_SRCDIR) \
+	$(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
+	  --preprocess-locale $(topsrcdir) \
 	  $(call EXPAND_LOCALE_SRCDIR,im/locales)/installer $(AB_CD) $(CONFIG_DIR)
 
 include $(topsrcdir)/config/rules.mk
-include $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/windows/nsis/makensis.mk
+include $(topsrcdir)olkit/mozapps/installer/windows/nsis/makensis.mk
--- a/im/locales/Makefile.in
+++ b/im/locales/Makefile.in
@@ -12,17 +12,17 @@ include $(DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/config.mk
 
 DEFINES += -DMOZ_APP_MAXVERSION=$(MOZ_APP_MAXVERSION)
 
 vpath %.xml @srcdir@/en-US/searchplugins
 vpath %.xml $(LOCALE_SRCDIR)/searchplugins
 
-_ABS_SRCDIR := $(abspath $(topsrcdir))
+_ABS_SRCDIR := $(abspath $(topsrcdir)/..)
 
 ifndef MOZ_BRANDING_DIRECTORY
 MOZ_BRANDING_DIRECTORY = im/branding/nightly
 endif
 
 SUBMAKEFILES += \
 	$(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/Makefile \
 	$(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales/Makefile \
@@ -58,17 +58,17 @@ UNINSTALLER_PACKAGE_HOOK = $(RM) -r $(ST
     cp ../installer/windows/l10ngen/helper.exe $(STAGEDIST)/uninstall; \
     $(RM) $(_ABS_DIST)/l10n-stage/setup.exe; \
     cp ../installer/windows/l10ngen/setup.exe $(_ABS_DIST)/l10n-stage; \
     $(NULL)
 endif
 
 include $(topsrcdir)/config/rules.mk
 
-include $(topsrcdir)/mozilla/toolkit/locales/l10n.mk
+include $(topsrcdir)/toolkit/locales/l10n.mk
 
 # Remove installer/sea/ from installer paths.
 PKG_INST_PATH =
 
 $(STAGEDIST): $(DIST)/branding
 
 $(DIST)/branding:
 	$(NSINSTALL) -D $@
@@ -78,20 +78,20 @@ SEARCH_PLUGINS = $(shell cat $(call MERG
 libs:: $(addsuffix .xml,$(SEARCH_PLUGINS))
 	$(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/searchplugins
 
 install:: $(addsuffix .xml,$(SEARCH_PLUGINS))
 	$(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)/searchplugins
 
 libs-%:
 	$(NSINSTALL) -D $(DIST)/install
-	@$(MAKE) -C ../../mozilla/toolkit/locales libs-$*
+	@$(MAKE) -C ../../toolkit/locales libs-$*
 	@$(MAKE) -C ../../chat/locales AB_CD=$* XPI_NAME=locale-$*
-	@$(MAKE) -C ../../mozilla/extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$*
-	@$(MAKE) -C ../../mozilla/intl/locales AB_CD=$* XPI_NAME=locale-$*
+	@$(MAKE) -C ../../extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$*
+	@$(MAKE) -C ../../intl/locales AB_CD=$* XPI_NAME=locale-$*
 	@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=defaults/pref
 	@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$*
 
 
 # Note the funny extra "../" in SFX_HEADER is because the repackage-zip command
 # is actually run effectively from within the mozilla/ part of the objdir, so
 # topsrcdir points to the wrong place and we have to go one directory higher.
 repackage-win32-installer: WIN32_INSTALLER_OUT="$(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe"
@@ -154,23 +154,23 @@ else
 	  sed -e "s/^InfoText=/Info=/" -e "s/^TitleText=/Title=/" | \
 	  sed -e "s/%MOZ_APP_DISPLAYNAME%/$(MOZ_APP_DISPLAYNAME)/" > \
 	  $(FINAL_TARGET)/updater.ini
 endif
 endif
 
 ident:
 	@printf "ib_revision "
-	@$(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py \
+	@$(PYTHON) $(topsrcdir)/config/printconfigsetting.py \
 	    $(STAGEDIST)/application.ini App SourceStamp
 	@printf "moz_revision "
-	@$(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py \
+	@$(PYTHON) $(topsrcdir)/config/printconfigsetting.py \
 	    $(STAGEDIST)/platform.ini Build SourceStamp
 	@printf "buildid "
-	@$(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py \
+	@$(PYTHON) $(topsrcdir)/config/printconfigsetting.py \
 	    $(STAGEDIST)/application.ini App BuildID
 
 #These make targets call prepare-repackages by setting different UPLOAD_DIR
 prepare-upload-latest-%:
 	@$(MAKE) prepare-repackages-$* UPLOAD_DIR=$(DIST)/upload/latest
 
 prepare-upload-dated-%:
 	@$(MAKE) prepare-repackages-$* UPLOAD_DIR=$(DIST)/upload/`date "+%Y-%m-%d-%H"`-$(MOZ_PKG_APPNAME)$(MOZ_APP_VERSION)-l10n
@@ -209,16 +209,16 @@ ifdef LOCALE_MERGEDIR
 endif
 	@echo
 
 IB_L10N_REPO_BASE = https://hg.instantbird.org/l10n
 MOZ_L10N_REPO_BASE = http://hg.mozilla.org/releases/l10n-mozilla-2.0
 
 checkout-%: AB_CD=$*
 checkout-%:
-	mkdir -p $(topsrcdir)/$(L10NBASEDIR)
-	$(PYTHON) $(topsrcdir)/client.py checkout-l10n --skip-instantbird --clean --l10n-base-dir $(L10NBASEDIR) --locale $(AB_CD)
+	mkdir -p $(topsrcdir)/../$(L10NBASEDIR)
+	$(PYTHON) $(topsrcdir)/../client.py checkout-l10n --skip-instantbird --clean --l10n-base-dir $(L10NBASEDIR) --locale $(AB_CD)
 
 repack-%: AB_CD=$*
 repack-%:
 	make checkout-$(AB_CD)
 	make merge-$(AB_CD)
 	make installers-$(AB_CD)
--- a/mail/Makefile.in
+++ b/mail/Makefile.in
@@ -8,18 +8,18 @@ topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(topsrcdir)/config/config.mk
 
 ifdef ENABLE_TESTS
 
 check-sync-dirs::
-	@$(PYTHON) $(topsrcdir)/mail/check-sync-dirs.py \
-	   $(srcdir)/config/tooltool-manifests $(MOZILLA_SRCDIR)/browser/config/tooltool-manifests
+	@$(PYTHON) $(topsrcdir)/../mail/check-sync-dirs.py \
+	   $(srcdir)/config/tooltool-manifests $(topsrcdir)/browser/config/tooltool-manifests
 
 check:: check-sync-dirs
 endif
 
 include $(topsrcdir)/config/rules.mk
 
 ifeq ($(OS_ARCH),WINNT)
 # For Windows build the uninstaller during the application build since the
--- a/mail/app/Makefile.in
+++ b/mail/app/Makefile.in
@@ -6,25 +6,25 @@ DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 AB_CD = $(MOZ_UI_LOCALE) 
 
-GRE_MILESTONE = $(shell $(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build Milestone)
-GRE_BUILDID = $(shell $(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build BuildID)
+GRE_MILESTONE = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build Milestone)
+GRE_BUILDID = $(shell $(PYTHON) $(topsrcdir)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/platform.ini Build BuildID)
 
-MOZ_SOURCE_STAMP = $(firstword $(shell hg -R $(topsrcdir) parent --template="{node|short}\n" 2>/dev/null))
+MOZ_SOURCE_STAMP = $(firstword $(shell hg -R $(topsrcdir)/.. parent --template="{node|short}\n" 2>/dev/null))
 ifdef MOZ_SOURCE_STAMP
 DEFINES += -DMOZ_SOURCE_STAMP="$(MOZ_SOURCE_STAMP)"
 endif
 
-SOURCE_REPO := $(shell hg -R $(topsrcdir) showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/http:/")
+SOURCE_REPO := $(shell hg -R $(topsrcdir)/.. showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/http:/")
 ifdef SOURCE_REPO
 DEFINES += -DMOZ_SOURCE_REPO="$(SOURCE_REPO)"
 endif
 
 ifdef MOZILLA_OFFICIAL
 DEFINES += -DMOZILLA_OFFICIAL
 endif
 
@@ -76,17 +76,17 @@ include $(topsrcdir)/config/config.mk
 ifdef _MSC_VER
 # Always enter a Windows program through wmain, whether or not we're
 # a console application.
 WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
 endif
 
 ifeq ($(OS_ARCH),WINNT)
 # Extract the icons we care about embedding into the EXE
-mailtoolbar = $(topsrcdir)/mail/themes/windows/mail/icons/mail-toolbar-aero.png
+mailtoolbar = $(topsrcdir)/../mail/themes/windows/mail/icons/mail-toolbar-aero.png
 
 # png to ico converter. The function takes 5 arguments, in order: source png
 # file, left, top, size, output ico file.
 png2ico = $(PYTHON) $(srcdir)/png2ico.py $(1) $(2) $(3) $(4) $(5)
 
 # Each icon is 18x18 in the toolbar, and we want a 16x16 icon here, so we cut
 # off a pixel at each end.
 write-message.ico: $(mailtoolbar) $(srcdir)/png2ico.py
--- a/mail/base/Makefile.in
+++ b/mail/base/Makefile.in
@@ -5,17 +5,17 @@
 
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-PRE_RELEASE_SUFFIX := $(shell $(PYTHON) $(topsrcdir)/mozilla/config/printprereleasesuffix.py \
+PRE_RELEASE_SUFFIX := $(shell $(PYTHON) $(topsrcdir)/../config/printprereleasesuffix.py \
                       $(MOZ_APP_VERSION))
 
 DEFINES += -DMOZ_APP_VERSION=$(MOZ_APP_VERSION) \
            -DPRE_RELEASE_SUFFIX=""
 
 ifdef MOZILLA_OFFICIAL
 DEFINES += -DOFFICIAL_BUILD=1
 endif
--- a/mail/installer/Makefile.in
+++ b/mail/installer/Makefile.in
@@ -96,18 +96,18 @@ MOZ_PKG_MAC_EXTRA=--symlink "/Applicatio
 endif
 
 NON_OMNIJAR_FILES = defaults/messenger/mailViews.dat
 
 ifndef LIBXUL_SDK
 INSTALL_SDK = 1
 endif
 
-include $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/signing.mk
-include $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/packager.mk
+include $(topsrcdir)olkit/mozapps/installer/signing.mk
+include $(topsrcdir)olkit/mozapps/installer/packager.mk
 
 ifeq (Darwin, $(OS_ARCH))
 BINPATH = $(_BINPATH)
 DEFINES += -DAPPNAME=$(_APPNAME)
 else
 BINPATH = bin
 endif
 DEFINES += -DBINPATH=$(BINPATH)
@@ -143,12 +143,12 @@ ifdef MOZ_PKG_MANIFEST_P
 	rm -f $(DIST)/pack-list.txt $(DIST)/bin-list.txt
 endif
 
 installer:
 ifdef INSTALLER_DIR
 	$(MAKE) -C $(INSTALLER_DIR)
 endif
 
-APP_SOURCE_STAMP = $(firstword $(shell hg -R $(topsrcdir) parent --template="{node|short}\n" 2>/dev/null))
-APP_SOURCE_REPO = $(shell hg -R $(topsrcdir) showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/http:/")
+APP_SOURCE_STAMP = $(firstword $(shell hg -R $(topsrcdir)/.. parent --template="{node|short}\n" 2>/dev/null))
+APP_SOURCE_REPO = $(shell hg -R $(topsrcdir)/.. showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/http:/")
 make-sourcestamp-file::
 	@echo "$(APP_SOURCE_REPO)/rev/$(APP_SOURCE_STAMP)" >> $(MOZ_SOURCESTAMP_FILE)
--- a/mail/installer/windows/Makefile.in
+++ b/mail/installer/windows/Makefile.in
@@ -4,20 +4,20 @@
 
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-include $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/package-name.mk
+include $(topsrcdir)olkit/mozapps/installer/package-name.mk
 
 CONFIG_DIR = instgen
-SFX_MODULE = $(topsrcdir)/other-licenses/7zstub/thunderbird/7zSD.sfx
+SFX_MODULE = $(topsrcdir)/../other-licenses/7zstub/thunderbird/7zSD.sfx
 
 DEFINES += -DMOZ_APP_VERSION=$(MOZ_APP_VERSION)
 PRE_RELEASE_SUFFIX := ""
 DEFINES += -DPRE_RELEASE_SUFFIX="$(PRE_RELEASE_SUFFIX)"
 
 ifdef MOZ_UPDATER
 DEFINES += -DMOZ_UPDATER=1
 endif
@@ -60,35 +60,35 @@ installer::
 # For building the uninstaller during the application build so it can be
 # included for mar file generation.
 uninstaller::
 	$(RM) -r $(CONFIG_DIR) && mkdir $(CONFIG_DIR)
 	$(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
 	$(INSTALL) $(addprefix $(DIST)/branding/,$(BRANDING_FILES)) $(CONFIG_DIR)
 	$(call py_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \
 	  $(srcdir)/nsis/defines.nsi.in -o $(CONFIG_DIR)/defines.nsi)
-	$(PYTHON) $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
-	  --preprocess-locale $(MOZILLA_SRCDIR) \
+	$(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
+	  --preprocess-locale $(topsrcdir) \
 	  $(call EXPAND_LOCALE_SRCDIR,mail/locales)/installer $(AB_CD) $(CONFIG_DIR)
 
 # For building the maintenanceservice installer
 ifdef MOZ_MAINTENANCE_SERVICE
 maintenanceservice_installer::
 	$(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
 	$(call py_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \
 	  $(srcdir)/nsis/defines.nsi.in -o $(CONFIG_DIR)/defines.nsi)
-	$(PYTHON) $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
-	  --preprocess-locale $(MOZILLA_SRCDIR) \
+	$(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
+	  --preprocess-locale $(topsrcdir) \
 	  $(call EXPAND_LOCALE_SRCDIR,mail/locales)/installer $(AB_CD) $(CONFIG_DIR)
 endif
 
 $(CONFIG_DIR)/setup.exe::
 	$(RM) -r $(CONFIG_DIR) && mkdir $(CONFIG_DIR)
 	$(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
 	$(INSTALL) $(addprefix $(DIST)/branding/,$(BRANDING_FILES)) $(CONFIG_DIR)
 	$(call py_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \
 	  $(srcdir)/nsis/defines.nsi.in -o $(CONFIG_DIR)/defines.nsi)
-	$(PYTHON) $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
-	  --preprocess-locale $(MOZILLA_SRCDIR) \
+	$(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
+	  --preprocess-locale $(topsrcdir) \
 	  $(call EXPAND_LOCALE_SRCDIR,mail/locales)/installer $(AB_CD) $(CONFIG_DIR)
 
 include $(topsrcdir)/config/rules.mk
-include $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/windows/nsis/makensis.mk
+include $(topsrcdir)olkit/mozapps/installer/windows/nsis/makensis.mk
--- a/mail/locales/Makefile.in
+++ b/mail/locales/Makefile.in
@@ -12,17 +12,17 @@ include $(DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/config.mk
 
 DEFINES += -DMOZ_APP_MAXVERSION=$(MOZ_APP_MAXVERSION)
 
 vpath %.xml @srcdir@/en-US/searchplugins
 vpath %.xml $(LOCALE_SRCDIR)/searchplugins
 
-_ABS_SRCDIR := $(abspath $(topsrcdir))
+_ABS_SRCDIR := $(abspath $(topsrcdir)/..)
 
 SUBMAKEFILES += \
 	$(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/Makefile \
 	$(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales/Makefile \
 	$(NULL)
 
 # This makefile uses variable overrides from the libs-% target to
 # build non-default locales to non-default dist/ locations. Be aware!
@@ -56,38 +56,38 @@ UNINSTALLER_PACKAGE_HOOK = $(RM) -r $(ST
     cp ../installer/windows/l10ngen/setup.exe $(_ABS_DIST)/l10n-stage; \
     $(NULL)
 endif
 
 NON_OMNIJAR_FILES = defaults/messenger/mailViews.dat
 
 include $(topsrcdir)/config/rules.mk
 
-include $(topsrcdir)/mozilla/toolkit/locales/l10n.mk
+include $(topsrcdir)/toolkit/locales/l10n.mk
 
 $(STAGEDIST): $(DIST)/branding
 
 $(DIST)/branding:
 	$(NSINSTALL) -D $@
 
 SEARCH_PLUGINS = $(shell cat $(call MERGE_FILE,/searchplugins/list.txt))
 
 libs:: $(addsuffix .xml,$(SEARCH_PLUGINS))
 	$(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/searchplugins
 
 install:: $(addsuffix .xml,$(SEARCH_PLUGINS))
 	$(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)/searchplugins
 
 libs-%:
 	$(NSINSTALL) -D $(DIST)/install
-	@$(MAKE) -C ../../mozilla/toolkit/locales libs-$*
+	@$(MAKE) -C ../../toolkit/locales libs-$*
 	@$(MAKE) -C ../../chat/locales AB_CD=$* XPI_NAME=locale-$*
 	@$(MAKE) -C ../../editor/ui/locales AB_CD=$* XPI_NAME=locale-$*
-	@$(MAKE) -C ../../mozilla/extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$*
-	@$(MAKE) -C ../../mozilla/intl/locales AB_CD=$* XPI_NAME=locale-$*
+	@$(MAKE) -C ../../extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$*
+	@$(MAKE) -C ../../intl/locales AB_CD=$* XPI_NAME=locale-$*
 	@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=defaults/pref
 	@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$*
 
 
 # Note the funny extra "../" in SFX_HEADER is because the repackage-zip command
 # is actually run effectively from within the mozilla/ part of the objdir, so
 # topsrcdir points to the wrong place and we have to go one directory higher.
 repackage-win32-installer: WIN32_INSTALLER_OUT="$(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe"
@@ -142,23 +142,23 @@ else
 	  sed -e "s/^InfoText=/Info=/" -e "s/^TitleText=/Title=/" | \
 	  sed -e "s/%MOZ_APP_DISPLAYNAME%/$(MOZ_APP_DISPLAYNAME)/" > \
 	  $(FINAL_TARGET)/updater.ini
 endif
 endif
 
 ident:
 	@printf "comm_revision "
-	@$(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py \
+	@$(PYTHON) $(topsrcdir)/config/printconfigsetting.py \
 	    $(STAGEDIST)/application.ini App SourceStamp
 	@printf "moz_revision "
-	@$(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py \
+	@$(PYTHON) $(topsrcdir)/config/printconfigsetting.py \
 	    $(STAGEDIST)/platform.ini Build SourceStamp
 	@printf "buildid "
-	@$(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py \
+	@$(PYTHON) $(topsrcdir)/config/printconfigsetting.py \
 	    $(STAGEDIST)/application.ini App BuildID
 
 #These make targets call prepare-repackages by setting different UPLOAD_DIR
 prepare-upload-latest-%:
 	@$(MAKE) prepare-repackages-$* UPLOAD_DIR=$(DIST)/upload/latest
 
 prepare-upload-dated-%:
 	@$(MAKE) prepare-repackages-$* UPLOAD_DIR=$(DIST)/upload/`date "+%Y-%m-%d-%H"`-$(MOZ_PKG_APPNAME)$(MOZ_APP_VERSION)-l10n
--- a/mail/test/mozmill/Makefile.in
+++ b/mail/test/mozmill/Makefile.in
@@ -12,17 +12,17 @@ relativesrcdir = @relativesrcdir@
 include $(DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/rules.mk
 
 # We're installing to _tests/mozmill
 TARGET_DEPTH = ../..
 include $(MOZILLA_DIR)/build/automation-build.mk
 
-_DEST_DIR = $(MOZDEPTH)/_tests/mozmill
+_DEST_DIR = $(DEPTH)/_tests/mozmill
 
 _HARNESS_FILES = \
 	$(srcdir)/runtest.py \
 	$(srcdir)/runtestlist.py \
 	$(srcdir)/mozmilltests.list \
 	automation.py \
 	$(MOZILLA_DIR)/build/automationutils.py \
 	$(NULL)
@@ -36,33 +36,33 @@ GARBAGE += automation.py
 
 # Copy the mozmill bits to $(_DEST_DIR)
 libs:: $(_HARNESS_FILES)
 	echo $(_HARNESS_FILES)
 	$(INSTALL) $(_HARNESS_FILES) $(_DEST_DIR)
 
 # Copy the mailnews and mail resources that we require.
 libs::
-	$(INSTALL) $(topsrcdir)/mailnews/test/resources/* $(_DEST_DIR)/resources
-	$(INSTALL) $(topsrcdir)/mailnews/test/fakeserver/* $(_DEST_DIR)/resources
-	$(INSTALL) $(topsrcdir)/mail/base/test/unit/resources/* $(_DEST_DIR)/resources
+	$(INSTALL) $(topsrcdir)/../mailnews/test/resources/* $(_DEST_DIR)/resources
+	$(INSTALL) $(topsrcdir)/../mailnews/test/fakeserver/* $(_DEST_DIR)/resources
+	$(INSTALL) $(topsrcdir)/../mail/base/test/unit/resources/* $(_DEST_DIR)/resources
 
 # Copy MozMill and its dependencies over, and set up a virtualenv. The
 # virtualenv directory is outside because we don't want to bundle it up during
 # stage-package.
 VIRTUALENV_DIR = $(_DEST_DIR)/../mozmill-virtualenv
 mozmill-virtualenv: NSDISTMODE=copy
 mozmill-virtualenv:
-	$(INSTALL) $(topsrcdir)/mail/test/resources $(_DEST_DIR)
-	$(INSTALL) $(topsrcdir)/mozilla/python/virtualenv $(_DEST_DIR)/resources/
+	$(INSTALL) $(topsrcdir)/../mail/test/resources $(_DEST_DIR)
+	$(INSTALL) $(topsrcdir)/../python/virtualenv $(_DEST_DIR)/resources/
 	rm -rf $(VIRTUALENV_DIR) && \
 	mkdir $(VIRTUALENV_DIR) && \
 	unset MACOSX_DEPLOYMENT_TARGET && \
 	$(PYTHON) $(_DEST_DIR)/resources/installmozmill.py $(VIRTUALENV_DIR)
 
 libs:: mozmill-virtualenv
 
 PKG_STAGE = $(DIST)/test-stage
 
 stage-package:
 	$(NSINSTALL) -D $(PKG_STAGE)/mozmill/
-	@(cd $(topsrcdir)/mail/test/mozmill && tar $(TAR_CREATE_FLAGS) - *) | (cd $(PKG_STAGE)/mozmill/ && tar -xf -)
-	@(cd $(MOZDEPTH)/_tests/mozmill && tar $(TAR_CREATE_FLAGS) - *) | (cd $(PKG_STAGE)/mozmill/ && tar -xf -)
+	@(cd $(topsrcdir)/../mail/test/mozmill && tar $(TAR_CREATE_FLAGS) - *) | (cd $(PKG_STAGE)/mozmill/ && tar -xf -)
+	@(cd $(DEPTH)/_tests/mozmill && tar $(TAR_CREATE_FLAGS) - *) | (cd $(PKG_STAGE)/mozmill/ && tar -xf -)
--- a/mail/testsuite-targets.mk
+++ b/mail/testsuite-targets.mk
@@ -1,13 +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/.
 
-MOZMILLDIR=$(DEPTH)/mozilla/_tests/mozmill
+MOZMILLDIR=$(DEPTH)/_tests/mozmill
 ifeq ($(OS_ARCH),WINNT)
 VIRTUALENV_BIN = $(MOZMILLDIR)/../mozmill-virtualenv/Scripts
 else
 VIRTUALENV_BIN = $(MOZMILLDIR)/../mozmill-virtualenv/bin
 endif
 MOZMILLPYTHON = $(abspath $(VIRTUALENV_BIN)/python$(BIN_SUFFIX))
 
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
@@ -26,26 +26,26 @@ check-no-solo = $(foreach solo,SOLO_TEST
 find-solo-test = $(if $(and $(SOLO_TEST),$(SOLO_FILE)),$(error Both SOLO_TEST and SOLO_FILE are specified. You may only specify one.),$(if $(SOLO_TEST),$(SOLO_TEST),$(if $(SOLO_FILE),$(SOLO_FILE),$(error SOLO_TEST or SOLO_FILE needs to be specified.))))
 
 # PYTHONHOME messes very badly with virtualenv setups, so unset it.
 mozmill:
 	$(call check-no-solo,SOLOVAR is specified. Perhaps you meant mozmill-one.)
 	unset PYTHONHOME && cd $(MOZMILLDIR) && MACOSX_DEPLOYMENT_TARGET= \
 	$(MOZMILLPYTHON) runtestlist.py --list=mozmilltests.list \
 	--binary=$(PROGRAM) \
-	--dir=$(abspath $(topsrcdir))/mail/test/mozmill \
+	--dir=$(abspath $(topsrcdir)/..)/mail/test/mozmill \
 	--symbols-path=$(abspath $(DIST)/crashreporter-symbols) \
 	--plugins-path=$(abspath $(DIST)/plugins) \
 	$(MOZMILL_EXTRA)
 
 mozmill-one: solo-test = $(find-solo-test)
 mozmill-one:
 	unset PYTHONHOME && cd $(MOZMILLDIR) && MACOSX_DEPLOYMENT_TARGET= \
 	$(MOZMILLPYTHON) runtest.py \
-	--test=$(abspath $(topsrcdir))/mail/test/mozmill/$(solo-test) \
+	--test=$(abspath $(topsrcdir)/..)/mail/test/mozmill/$(solo-test) \
 	--binary=$(PROGRAM) \
 	--symbols-path=$(abspath $(DIST)/crashreporter-symbols) \
 	--plugins-path=$(abspath $(DIST)/plugins) \
 	$(MOZMILL_EXTRA)
 
 # XXX The mozilla/testing/testsuite-targets.mk doesn't really allow for hooks
 # outside of itself. Therefore we replicate the functionality we need here,
 # calling into the relevant mozilla dirs when necessary for the core tests.
@@ -74,29 +74,29 @@ endif
 
 make-stage-dir:
 	rm -rf $(PKG_STAGE) && $(NSINSTALL) -D $(PKG_STAGE) && $(NSINSTALL) -D $(PKG_STAGE)/bin && $(NSINSTALL) -D $(PKG_STAGE)/bin/components && $(NSINSTALL) -D $(PKG_STAGE)/certs && $(NSINSTALL) -D $(PKG_STAGE)/extensions
 
 # Of the core tests, we only currently support xpcshell. Unfortunately
 # some of the required xpcshell bits are packaged by mochitest, so we have to
 # package those as well.
 stage-mozilla-tests: make-stage-dir
-	$(MAKE) -C $(DEPTH)/mozilla/layout/tools/reftest stage-package
-	$(MAKE) -C $(DEPTH)/mozilla/testing/mochitest stage-package
-	$(MAKE) -C $(DEPTH)/mozilla/testing/xpcshell stage-package
-	$(MAKE) -C $(DEPTH)/mozilla/testing/mozbase stage-package
+	$(MAKE) -C $(DEPTH)/layout/tools/reftest stage-package
+	$(MAKE) -C $(DEPTH)/testing/mochitest stage-package
+	$(MAKE) -C $(DEPTH)/testing/xpcshell stage-package
+	$(MAKE) -C $(DEPTH)/testing/mozbase stage-package
 
 # Although we should probably depend on make-stage-dir here, we don't as the
 # make-stage-dir actually removes the package directory for us. Given that we
 # are running stage-mozilla-tests which calls testing/testsuite-targets.mk which
 # does do this for some tests, then we're actually fine.
 stage-mozmill: make-stage-dir
 	$(MAKE) -C $(DEPTH)/mail/test/mozmill stage-package
 
 stage-modules: make-stage-dir
 	$(NSINSTALL) -D $(PKG_STAGE)/modules
-	cp -RL $(DEPTH)/mozilla/_tests/modules $(PKG_STAGE)
+	cp -RL $(DEPTH)/_tests/modules $(PKG_STAGE)
 
 stage-calendar: make-stage-dir
 	$(MAKE) -C $(DEPTH)/calendar/lightning stage-package
 
 .PHONY: \
   package-tests make-stage-dir stage-mozmill stage-modules stage-calendar
--- a/mailnews/Makefile.in
+++ b/mailnews/Makefile.in
@@ -11,11 +11,11 @@ VPATH		= @srcdir@
 include $(DEPTH)/config/autoconf.mk
 
 PREF_JS_EXPORTS = $(srcdir)/mailnews.js
 
 include $(topsrcdir)/config/rules.mk
 
 ifdef ENABLE_TESTS
 libs::
-	$(INSTALL) $(wildcard $(srcdir)/test/resources/*.js) $(MOZDEPTH)/_tests/xpcshell/mailnews/resources
-	$(INSTALL) $(wildcard $(srcdir)/test/data/*) $(MOZDEPTH)/_tests/xpcshell/mailnews/data
+	$(INSTALL) $(wildcard $(srcdir)/test/resources/*.js) $(DEPTH)/_tests/xpcshell/mailnews/resources
+	$(INSTALL) $(wildcard $(srcdir)/test/data/*) $(DEPTH)/_tests/xpcshell/mailnews/data
 endif
--- a/mailnews/import/build/Makefile.in
+++ b/mailnews/import/build/Makefile.in
@@ -16,17 +16,17 @@ SHARED_LIBRARY_LIBS = ../../base/util/$(
 endif
 
 
 EXTRA_DSO_LDOPTS += \
 	$(LIBS_DIR) \
 	$(MOZ_JS_LIBS) \
 	$(XPCOM_GLUE_LDOPTS) \
 	$(call EXPAND_LIBNAME_PATH,unicharutil_external_s,$(LIBXUL_DIST)/lib) \
-	$(MOZDEPTH)/rdf/util/src/$(LIB_PREFIX)rdfutil_external_s.$(LIB_SUFFIX) \
+	$(DEPTH)/rdf/util/src/$(LIB_PREFIX)rdfutil_external_s.$(LIB_SUFFIX) \
 	$(NSPR_LIBS) \
 	$(XPCOM_LIBS) \
 	$(NULL)
 ifneq (WINNT,$(OS_ARCH))
 EXTRA_DSO_LDOPTS += \
 	$(MOZ_ZLIB_LIBS) \
 	$(NULL)
 endif
@@ -35,13 +35,13 @@ ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 EXTRA_DSO_LDOPTS += \
 	-framework Cocoa  \
 	$(TK_LIBS) \
 	$(NULL)
 endif
 
 ifeq ($(OS_ARCH),AIX)
 EXTRA_DSO_LDOPTS += \
-	$(MOZDEPTH)/rdf/util/src/$(LIB_PREFIX)rdfutil_external_s.$(LIB_SUFFIX) \
+	$(DEPTH)/rdf/util/src/$(LIB_PREFIX)rdfutil_external_s.$(LIB_SUFFIX) \
 	$(NULL)
 endif
 
 include $(topsrcdir)/config/rules.mk
--- a/suite/app/Makefile.in
+++ b/suite/app/Makefile.in
@@ -85,19 +85,19 @@ ifeq ($(OS_TEST),x86_64)
 LDFLAGS += -STACK:2097152
 endif
 endif
 endif
 
 libs::
 ifeq ($(OS_ARCH),WINNT)
 	$(EXIT_ON_ERROR) \
-	$(PERL) -pe 's/(?<!\r)\n/\r\n/g;' < $(topsrcdir)/suite/installer/license.txt > $(DIST)/bin/license.txt
+	$(PERL) -pe 's/(?<!\r)\n/\r\n/g;' < $(topsrcdir)/../suite/installer/license.txt > $(DIST)/bin/license.txt
 else
-	$(INSTALL) $(IFLAGS1) $(topsrcdir)/suite/installer/license.txt $(DIST)/bin/
+	$(INSTALL) $(IFLAGS1) $(topsrcdir)/../suite/installer/license.txt $(DIST)/bin/
 endif
 
 ifneq ($(OS_ARCH),WINNT)
 
 libs:: 
 	cp -p $(MOZ_APP_NAME)$(BIN_SUFFIX) $(DIST)/bin/$(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
 
 endif
--- a/suite/browser/test/Makefile.in
+++ b/suite/browser/test/Makefile.in
@@ -90,15 +90,15 @@ ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 _BROWSER_FILES += browser_bug462289.js
 endif
 
 _CHROME_FILES = \
                  test_maxSniffing.html \
     $(NULL)
 
 libs:: $(addprefix mochitest/, $(_TEST_FILES))
-	$(INSTALL) $(foreach f,$^,"$f") $(MOZDEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
+	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir)
 
 libs:: $(addprefix browser/, $(_BROWSER_FILES))
-	$(INSTALL) $(foreach f,$^,"$f") $(MOZDEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
+	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
 
 libs:: $(addprefix chrome/, $(_CHROME_FILES))
-	$(INSTALL) $(foreach f,$^,"$f") $(MOZDEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)
+	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)
--- a/suite/common/dataman/tests/Makefile.in
+++ b/suite/common/dataman/tests/Makefile.in
@@ -14,9 +14,9 @@ include $(topsrcdir)/config/rules.mk
     browser_dataman_basics.js \
     dataman_storage.appcache \
     dataman_storage.appcache^headers^ \
     dataman_storage.html \
     browser_dataman_callviews.js \
     $(NULL)
 
 libs:: $(_BROWSER_FILES)
-	$(INSTALL) $(foreach f,$^,"$f") $(MOZDEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
+	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
--- a/suite/common/downloads/tests/Makefile.in
+++ b/suite/common/downloads/tests/Makefile.in
@@ -32,12 +32,12 @@ include $(topsrcdir)/config/rules.mk
     test_space_key_retries.xul \
     test_ui_stays_open_on_alert_clickback.xul \
     $(NULL)
 
 _BROWSER_FILES = browser_nsISuiteDownloadManagerUI.js \
     $(NULL)
 
 libs:: $(addprefix chrome/, $(_CHROME_FILES))
-	$(INSTALL) $(foreach f,$^,"$f") $(MOZDEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)
+	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)
 
 libs:: $(addprefix browser/, $(_BROWSER_FILES))
-	$(INSTALL) $(foreach f,$^,"$f") $(MOZDEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
+	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
--- a/suite/common/places/tests/Makefile.in
+++ b/suite/common/places/tests/Makefile.in
@@ -34,12 +34,12 @@ include $(topsrcdir)/config/rules.mk
     browser_library_open_leak.js \
     browser_library_left_pane_commands.js \
     browser_drag_bookmarks_on_toolbar.js \
     browser_library_views_liveupdate.js \
     browser_library_infoBox.js \
     $(NULL)
 
 libs:: $(addprefix chrome/, $(_CHROME_FILES))
-	$(INSTALL) $(foreach f,$^,"$f") $(MOZDEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)
+	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)
 
 libs:: $(addprefix browser/, $(_BROWSER_FILES))
-	$(INSTALL) $(foreach f,$^,"$f") $(MOZDEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
+	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
--- a/suite/common/tests/browser/Makefile.in
+++ b/suite/common/tests/browser/Makefile.in
@@ -82,9 +82,9 @@ include $(topsrcdir)/config/rules.mk
 	browser_isempty.js \
 	browser_markPageAsFollowedLink.js \
 	framedPage.html \
 	frameLeft.html \
 	frameRight.html \
 	$(NULL)
 
 libs:: $(_BROWSER_FILES)
-	$(INSTALL) $(foreach f,$^,"$f") $(MOZDEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
+	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
--- a/suite/common/tests/chrome/Makefile.in
+++ b/suite/common/tests/chrome/Makefile.in
@@ -8,13 +8,13 @@ topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 relativesrcdir  = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/rules.mk
 
 _TEST_FILES = 	test_idcheck.xul \
-		$(topsrcdir)/mailnews/test/resources/mailTestUtils.js \
+		$(topsrcdir)/../mailnews/test/resources/mailTestUtils.js \
 		$(NULL)
 
 libs:: $(_TEST_FILES)
-	$(INSTALL) $(foreach f,$^,"$f") $(MOZDEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)
+	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/chrome/$(relativesrcdir)
--- a/suite/common/tests/preferences/Makefile.in
+++ b/suite/common/tests/preferences/Makefile.in
@@ -11,9 +11,9 @@ relativesrcdir  = @relativesrcdir@
 include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/rules.mk
 
 _BROWSER_FILES = \
     browser_bug410900.js \
     $(NULL)
 
 libs::	$(_BROWSER_FILES)
-	$(INSTALL) $(foreach f,$^,"$f") $(MOZDEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
+	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
--- a/suite/installer/Makefile.in
+++ b/suite/installer/Makefile.in
@@ -138,17 +138,17 @@ NON_OMNIJAR_FILES = \
 	defaults/profile/localstore.rdf \
 	defaults/profile/panels.rdf \
 	$(NULL)
 
 ifndef LIBXUL_SDK
 INSTALL_SDK = 1
 endif
  
-include $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/packager.mk
+include $(topsrcdir)olkit/mozapps/installer/packager.mk
 
 ifeq (Darwin, $(OS_ARCH))
 BINPATH = $(_BINPATH)
 DEFINES += -DAPPNAME=$(_APPNAME)
 else
 BINPATH = bin
 endif
 DEFINES += -DBINPATH=$(BINPATH)
@@ -184,12 +184,12 @@ ifdef MOZ_PKG_MANIFEST_P
 	rm -f $(DIST)/pack-list.txt $(DIST)/bin-list.txt
 endif
 
 installer:
 ifdef INSTALLER_DIR
 	$(MAKE) -C $(INSTALLER_DIR)
 endif
 
-APP_SOURCE_STAMP = $(firstword $(shell hg -R $(topsrcdir) parent --template="{node|short}\n" 2>/dev/null))
-APP_SOURCE_REPO = $(shell hg -R $(topsrcdir) showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/http:/")
+APP_SOURCE_STAMP = $(firstword $(shell hg -R $(topsrcdir)/.. parent --template="{node|short}\n" 2>/dev/null))
+APP_SOURCE_REPO = $(shell hg -R $(topsrcdir)/.. showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/http:/")
 make-sourcestamp-file::
 	@echo "$(APP_SOURCE_REPO)/rev/$(APP_SOURCE_STAMP)" >> $(MOZ_SOURCESTAMP_FILE)
--- a/suite/installer/windows/Makefile.in
+++ b/suite/installer/windows/Makefile.in
@@ -4,20 +4,20 @@
 
 DEPTH		= @DEPTH@
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
-include $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/package-name.mk
+include $(topsrcdir)olkit/mozapps/installer/package-name.mk
 
 CONFIG_DIR = instgen
-SFX_MODULE = $(topsrcdir)/other-licenses/7zstub/seamonkey/7zSD.sfx
+SFX_MODULE = $(topsrcdir)/../other-licenses/7zstub/seamonkey/7zSD.sfx
 
 INSTALLER_FILES = \
 	app.tag \
 	nsis/installer.nsi \
 	nsis/uninstaller.nsi \
 	nsis/shared.nsh \
 	nsis/custom.nsi \
 	$(NULL)
@@ -52,26 +52,26 @@ installer::
 # For building the uninstaller during the application build so it can be
 # included for mar file generation.
 uninstaller::
 	$(RM) -r $(CONFIG_DIR) && mkdir $(CONFIG_DIR)
 	$(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
 	$(INSTALL) $(addprefix $(DIST)/branding/,$(BRANDING_FILES)) $(CONFIG_DIR)
 	$(call py_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \
 	  $(srcdir)/nsis/defines.nsi.in -o $(CONFIG_DIR)/defines.nsi)
-	$(PYTHON) $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
-	  --preprocess-locale $(MOZILLA_SRCDIR) \
+	$(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
+	  --preprocess-locale $(topsrcdir) \
 	  $(call EXPAND_LOCALE_SRCDIR,suite/locales)/installer/windows $(AB_CD) $(CONFIG_DIR)
 
 $(CONFIG_DIR)/setup.exe::
 	$(RM) -r $(CONFIG_DIR) && mkdir $(CONFIG_DIR)
 	$(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
 	$(INSTALL) $(addprefix $(DIST)/branding/,$(BRANDING_FILES)) $(CONFIG_DIR)
-	$(PYTHON) $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
-	  --convert-utf8-utf16le $(topsrcdir)/suite/installer/license.txt $(CONFIG_DIR)/license.txt
+	$(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
+	  --convert-utf8-utf16le $(topsrcdir)/../suite/installer/license.txt $(CONFIG_DIR)/license.txt
 	$(call py_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \
 	  $(srcdir)/nsis/defines.nsi.in -o $(CONFIG_DIR)/defines.nsi)
-	$(PYTHON) $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
-	  --preprocess-locale $(MOZILLA_SRCDIR) \
+	$(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
+	  --preprocess-locale $(topsrcdir) \
 	  $(call EXPAND_LOCALE_SRCDIR,suite/locales)/installer/windows $(AB_CD) $(CONFIG_DIR)
 
 include $(topsrcdir)/config/rules.mk
-include $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/windows/nsis/makensis.mk
+include $(topsrcdir)olkit/mozapps/installer/windows/nsis/makensis.mk
--- a/suite/locales/Makefile.in
+++ b/suite/locales/Makefile.in
@@ -9,17 +9,17 @@ VPATH          = @srcdir@
 relativesrcdir = @relativesrcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 include $(topsrcdir)/config/config.mk
 
 DEFINES += -DMOZ_APP_MAXVERSION=$(MOZ_APP_MAXVERSION)
 
-_ABS_SRCDIR := $(abspath $(topsrcdir))
+_ABS_SRCDIR := $(abspath $(topsrcdir)/..)
 
 vpath %.xml @srcdir@/en-US/searchplugins
 vpath %.xml $(LOCALE_SRCDIR)/searchplugins
 
 SUBMAKEFILES += \
 	$(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/Makefile \
 	$(NULL)
 
@@ -59,17 +59,17 @@ endif
 NON_OMNIJAR_FILES = \
 	defaults/messenger/mailViews.dat \
 	defaults/profile/localstore.rdf \
 	defaults/profile/panels.rdf \
 	$(NULL)
 
 include $(topsrcdir)/config/rules.mk
 
-include $(topsrcdir)/mozilla/toolkit/locales/l10n.mk
+include $(topsrcdir)/toolkit/locales/l10n.mk
 
 $(STAGEDIST): $(DIST)/branding
 
 $(DIST)/branding:
 	$(NSINSTALL) -D $@
 
 PROFILE_FILES = \
 	localstore.rdf \
@@ -136,27 +136,27 @@ install:: $(addsuffix .xml,$(SEARCH_PLUG
 
 # Extend l10n.mk clobber-% target for our localised extensions
 clobber-%:
 	$(RM) -rf $(DIST)/xpi-stage/chatzilla-$* $(DIST)/xpi-stage/chatzilla-*.$*.xpi
 	$(RM) -rf $(DIST)/xpi-stage/venkman-$* $(DIST)/xpi-stage/venkman-*.$*.xpi
 
 libs-%:
 	$(NSINSTALL) -D $(DIST)/install
-	@$(MAKE) -C ../../mozilla/toolkit/locales libs-$*
-	@$(MAKE) -C ../../mozilla/services/sync/locales AB_CD=$* XPI_NAME=locale-$*
+	@$(MAKE) -C ../../toolkit/locales libs-$*
+	@$(MAKE) -C ../../services/sync/locales AB_CD=$* XPI_NAME=locale-$*
 	@$(MAKE) -C ../../editor/ui/locales AB_CD=$* XPI_NAME=locale-$*
-	@if test -d ../../mozilla/extensions/irc; then \
-	  $(MAKE) -C ../../mozilla/extensions/irc/locales libs-$*; \
+	@if test -d ../../extensions/irc; then \
+	  $(MAKE) -C ../../extensions/irc/locales libs-$*; \
 	fi
-	@if test -d ../../mozilla/extensions/venkman; then \
-	  $(MAKE) -C ../../mozilla/extensions/venkman/locales libs-$*; \
+	@if test -d ../../extensions/venkman; then \
+	  $(MAKE) -C ../../extensions/venkman/locales libs-$*; \
 	fi
-	@$(MAKE) -C ../../mozilla/extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$*
-	@$(MAKE) -C ../../mozilla/intl/locales AB_CD=$* XPI_NAME=locale-$*
+	@$(MAKE) -C ../../extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$*
+	@$(MAKE) -C ../../intl/locales AB_CD=$* XPI_NAME=locale-$*
 	@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=defaults/pref
 
 repackage-win32-installer: WIN32_INSTALLER_OUT=$(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe
 repackage-win32-installer: $(call ESCAPE_WILDCARD,$(WIN32_INSTALLER_IN)) $(SUBMAKEFILES)
 	@echo "Repackaging $(WIN32_INSTALLER_IN) into $(WIN32_INSTALLER_OUT)."
 	$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY) export
 	$(MAKE) -C ../installer/windows CONFIG_DIR=l10ngen l10ngen/setup.exe l10ngen/7zSD.sfx
 	$(MAKE) repackage-zip \
@@ -192,21 +192,21 @@ clobber-zip:
 	  $(STAGEDIST)/defaults/profile \
 	  $(STAGEDIST)/chrome/$(AB_CD) \
 	  $(STAGEDIST)/extensions/langpack-$(AB_CD)@* \
 	  $(STAGEDIST)/distribution/extensions/langpack-$(AB_CD)@* \
 
 repackage-zip: repackage-extensions
 
 repackage-extensions: $(STAGEDIST)
-	if test -d ../../mozilla/extensions/irc; then \
-	  $(MAKE) -C ../../mozilla/extensions/irc/locales repackage-zip-$(AB_CD) STAGEDIST=$(STAGEDIST); \
+	if test -d ../../extensions/irc; then \
+	  $(MAKE) -C ../../extensions/irc/locales repackage-zip-$(AB_CD) STAGEDIST=$(STAGEDIST); \
 	fi
-	if test -d ../../mozilla/extensions/venkman; then \
-	  $(MAKE) -C ../../mozilla/extensions/venkman/locales repackage-zip-$(AB_CD) STAGEDIST=$(STAGEDIST); \
+	if test -d ../../extensions/venkman; then \
+	  $(MAKE) -C ../../extensions/venkman/locales repackage-zip-$(AB_CD) STAGEDIST=$(STAGEDIST); \
 	fi
 ifdef MOZ_OMNIJAR
 	$(MAKE) -C ../app pack-ext AB_CD=$(AB_CD) STAGEDIST=$(STAGEDIST);
 endif
 
 repackage-zip-%: $(call ESCAPE_WILDCARD,$(ZIP_IN)) $(STAGEDIST) libs-%
 	@$(MAKE) repackage-zip AB_CD=$* ZIP_IN=$(ZIP_IN)
 
@@ -236,23 +236,23 @@ endif
 
 ifdef MOZ_CRASHREPORTER
 libs:: $(call MERGE_FILE,crashreporter/crashreporter-override.ini)
 	$(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)
 endif
 
 ident:
 	@printf "comm_revision "
-	@$(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py \
+	@$(PYTHON) $(topsrcdir)/config/printconfigsetting.py \
 	    $(STAGEDIST)/application.ini App SourceStamp
 	@printf "moz_revision "
-	@$(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py \
+	@$(PYTHON) $(topsrcdir)/config/printconfigsetting.py \
 	    $(STAGEDIST)/platform.ini Build SourceStamp
 	@printf "buildid "
-	@$(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py \
+	@$(PYTHON) $(topsrcdir)/config/printconfigsetting.py \
 	    $(STAGEDIST)/application.ini App BuildID
 
 merge-%:
 ifdef LOCALE_MERGEDIR
 	$(RM) -rf $(LOCALE_MERGEDIR)
 	MACOSX_DEPLOYMENT_TARGET= compare-locales -m $(LOCALE_MERGEDIR) $(srcdir)/l10n.ini $(L10NBASEDIR) $*
 endif
 	@echo
--- a/suite/smile/test/Makefile.in
+++ b/suite/smile/test/Makefile.in
@@ -19,9 +19,9 @@ include $(topsrcdir)/config/rules.mk
 	browser_Bookmarks.js \
 	browser_Browser.js \
 	ContentA.html \
 	ContentB.html \
 	ContentWithFrames.html \
 	$(NULL)
 
 libs::	$(_BROWSER_FILES)
-	$(INSTALL) $(foreach f,$^,"$f") $(MOZDEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
+	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)