Bug 1138063 - Clean up a bunch of make rules that install things to FINAL_TARGET; r=jcranmer,fallen,florian draft
authorBrian O'Keefe <bokeefe@alum.wpi.edu>
Tue, 17 Mar 2015 12:53:48 -0400
changeset 18035 37e2991ba3ff124ac077e6c249461a9168c23516
parent 18034 70b7b5e51839c0d5462215f7dc7d1e95f8ed41e0
child 18036 da6633be61429feae95a68f2667ab3ae23c4fac9
push id49
push userbokeefe@alum.wpi.edu
push dateThu, 14 May 2015 15:30:07 +0000
reviewersjcranmer, fallen, florian
bugs1138063
Bug 1138063 - Clean up a bunch of make rules that install things to FINAL_TARGET; r=jcranmer,fallen,florian
calendar/base/Makefile.in
calendar/base/backend/libical/build/Makefile.in
calendar/base/moz.build
calendar/base/src/Makefile.in
calendar/base/src/moz.build
calendar/import-export/Makefile.in
calendar/import-export/moz.build
calendar/lightning/Makefile.in
calendar/lightning/moz.build
calendar/providers/caldav/Makefile.in
calendar/providers/caldav/moz.build
calendar/providers/wcap/Makefile.in
calendar/providers/wcap/moz.build
im/app/profile/Makefile.in
im/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/Makefile.in
im/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/moz.build
im/app/profile/moz.build
im/themes/Makefile.in
im/themes/moz.build
mail/app/profile/Makefile.in
mail/app/profile/moz.build
mail/themes/linux/Makefile.in
mail/themes/linux/moz.build
mail/themes/osx/Makefile.in
mail/themes/osx/moz.build
mail/themes/windows/Makefile.in
mail/themes/windows/moz.build
mailnews/base/ispdata/Makefile.in
mailnews/base/ispdata/moz.build
mailnews/base/search/src/Makefile.in
mailnews/base/search/src/moz.build
mailnews/extensions/dsn/Makefile.in
mailnews/extensions/dsn/moz.build
mailnews/extensions/mailviews/content/Makefile.in
mailnews/extensions/mailviews/content/moz.build
mailnews/extensions/mdn/Makefile.in
mailnews/extensions/mdn/moz.build
mailnews/extensions/newsblog/Makefile.in
mailnews/extensions/newsblog/moz.build
mailnews/extensions/smime/Makefile.in
mailnews/extensions/smime/moz.build
suite/branding/nightly/Makefile.in
suite/branding/nightly/moz.build
suite/locales/Makefile.in
suite/locales/moz.build
suite/themes/classic/Makefile.in
suite/themes/classic/moz.build
suite/themes/modern/Makefile.in
suite/themes/modern/moz.build
--- a/calendar/base/Makefile.in
+++ b/calendar/base/Makefile.in
@@ -1,38 +1,6 @@
 # 
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
 USE_EXTENSION_MANIFEST = 1
-
-WINDOW_ICONS = calendar-alarm-dialog \
-               calendar-event-dialog \
-               calendar-event-summary-dialog \
-               calendar-task-dialog \
-               calendar-task-summary-dialog \
-               $(NULL)
-
-include $(topsrcdir)/config/rules.mk
-
-# Window icons are not needed on mac
-ifneq (,$(filter windows gtk gtk2,$(MOZ_WIDGET_TOOLKIT)))
-
-# Set up the icon suffix to differ between windows and linux
-ifneq (,$(filter windows,$(MOZ_WIDGET_TOOLKIT)))
-ICON_SUFFIX = .ico
-else
-ICON_SUFFIX = .png
-endif
-
-# Copy the window icons into the correct directory
-libs:: $(addprefix themes/windows/icons/, $(addsuffix $(ICON_SUFFIX), $(WINDOW_ICONS)))
-	$(INSTALL) $^ $(FINAL_TARGET)/chrome/icons/default
-
-endif
--- a/calendar/base/backend/libical/build/Makefile.in
+++ b/calendar/base/backend/libical/build/Makefile.in
@@ -4,10 +4,11 @@
 
 NO_COMPONENTS_MANIFEST = 1
 
 # Ensure that we don't embed a manifest referencing the CRT
 EMBED_MANIFEST_AT =
 
 DEFINES += -DSHARED_LIBRARY=$(SHARED_LIBRARY)
 
-libs::
-	$(call py_action,preprocessor,$(DEFINES) $(srcdir)/libical-manifest -o $(FINAL_TARGET)/components/libical-manifest)
+BACKEND_MANIFESTS = libical-manifest
+BACKEND_MANIFESTS_PATH = $(FINAL_TARGET)/components
+PP_TARGETS += BACKEND_MANIFESTS
--- a/calendar/base/moz.build
+++ b/calendar/base/moz.build
@@ -14,16 +14,37 @@ JAR_MANIFESTS += ['jar.mn']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     DEFINES['THEME'] = 'windows'
 elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
     DEFINES['THEME'] = 'osx'
 else:
     DEFINES['THEME'] = 'linux'
 
+# Window icons are not needed on mac
+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk', 'gtk2'):
+    icon_path = 'themes/windows/icons/'
+    window_icons = [
+        'calendar-alarm-dialog',
+        'calendar-event-dialog',
+        'calendar-event-summary-dialog',
+        'calendar-task-dialog',
+        'calendar-task-summary-dialog',
+    ]
+
+    # Set up the icon suffix to differ between windows and linux
+    if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
+        icon_suffix = '.ico'
+    else:
+        icon_suffix = '.png'
+
+    FINAL_TARGET_FILES.chrome.icons.default += [
+        '%s%s%s' % (icon_path, icon, icon_suffix) for icon in window_icons
+    ]
+
 with Files('content/**'):
     BUG_COMPONENT = ('Calendar', 'Calendar Views')
 
 with Files('content/preferences/**'):
     BUG_COMPONENT = ('Calendar', 'Preferences')
 
 with Files('content/dialogs/**'):
     BUG_COMPONENT = ('Calendar', 'Dialogs')
deleted file mode 100644
--- a/calendar/base/src/Makefile.in
+++ /dev/null
@@ -1,48 +0,0 @@
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-DEPTH   = @DEPTH@
-topsrcdir = @top_srcdir@
-srcdir    = @srcdir@
-VPATH   = @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-EXTRA_SCRIPTS = \
-    calAlarm.js \
-    calAlarmService.js \
-    calAlarmMonitor.js \
-    calAttachment.js \
-    calAttendee.js \
-    calCalendarManager.js \
-    calCachedCalendar.js \
-    calDateTimeFormatter.js \
-    calDeletedItems.js \
-    calEvent.js \
-    calFilter.js \
-    calIcsParser.js \
-    calIcsSerializer.js \
-    calItemBase.js \
-    calItipItem.js \
-    calProtocolHandler.js \
-    calRecurrenceDate.js \
-    calRecurrenceInfo.js \
-    calRelation.js \
-    calStartupService.js \
-    calTimezone.js \
-    calTodo.js \
-    calUtils.js \
-    calWeekInfoService.js \
-    calTransactionManager.js \
-    calFreeBusyService.js \
-    calCalendarSearchService.js \
-    $(NULL)
-
-# Use NSINSTALL to make the directory, as there's no mtime to preserve.
-libs:: $(EXTRA_SCRIPTS)
-	if test ! -d $(FINAL_TARGET)/calendar-js; then $(NSINSTALL) -D $(FINAL_TARGET)/calendar-js; fi
-	$(INSTALL) $^ $(FINAL_TARGET)/calendar-js
-
-include $(topsrcdir)/config/rules.mk
--- a/calendar/base/src/moz.build
+++ b/calendar/base/src/moz.build
@@ -15,14 +15,44 @@ EXTRA_COMPONENTS += [
     'calItemModule.js',
     'calItemModule.manifest',
     'calSleepMonitor.js',
     'calSleepMonitor.manifest',
     'calTimezoneService.js',
     'calTimezoneService.manifest',
 ]
 
+FINAL_TARGET_FILES['calendar-js'] += [
+    'calAlarm.js',
+    'calAlarmMonitor.js',
+    'calAlarmService.js',
+    'calAttachment.js',
+    'calAttendee.js',
+    'calCachedCalendar.js',
+    'calCalendarManager.js',
+    'calCalendarSearchService.js',
+    'calDateTimeFormatter.js',
+    'calDeletedItems.js',
+    'calEvent.js',
+    'calFilter.js',
+    'calFreeBusyService.js',
+    'calIcsParser.js',
+    'calIcsSerializer.js',
+    'calItemBase.js',
+    'calItipItem.js',
+    'calProtocolHandler.js',
+    'calRecurrenceDate.js',
+    'calRecurrenceInfo.js',
+    'calRelation.js',
+    'calStartupService.js',
+    'calTimezone.js',
+    'calTodo.js',
+    'calTransactionManager.js',
+    'calUtils.js',
+    'calWeekInfoService.js',
+]
+
 with Files('**'):
     BUG_COMPONENT = ('Calendar', 'Internal Components')
 
 with Files('calAlarm*'):
     BUG_COMPONENT = ('Calendar', 'Alarms')
 
--- a/calendar/import-export/Makefile.in
+++ b/calendar/import-export/Makefile.in
@@ -1,27 +1,5 @@
 # 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/.
 
-DEPTH   = @DEPTH@
-topsrcdir = @top_srcdir@
-srcdir    = @srcdir@
-VPATH   = @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
 USE_EXTENSION_MANIFEST = 1
-EXTRA_SCRIPTS = \
-    calHtmlExport.js \
-    calIcsImportExport.js \
-    calListFormatter.js \
-    calMonthGridPrinter.js \
-    calOutlookCSVImportExport.js \
-    calWeekPrinter.js \
-    $(NULL)
-
-# Use NSINSTALL to make the directory, as there's no mtime to preserve.
-libs:: $(EXTRA_SCRIPTS)
-	if test ! -d $(FINAL_TARGET)/calendar-js; then $(NSINSTALL) -D $(FINAL_TARGET)/calendar-js; fi
-	$(INSTALL) $^ $(FINAL_TARGET)/calendar-js
-
-include $(topsrcdir)/config/rules.mk
--- a/calendar/import-export/moz.build
+++ b/calendar/import-export/moz.build
@@ -5,13 +5,22 @@
 
 EXTRA_COMPONENTS += [
     'calImportExportModule.js',
     'calImportExportModule.manifest',
 ]
 
 JAR_MANIFESTS += ['jar.mn']
 
+FINAL_TARGET_FILES['calendar-js'] += [
+    'calHtmlExport.js',
+    'calIcsImportExport.js',
+    'calListFormatter.js',
+    'calMonthGridPrinter.js',
+    'calOutlookCSVImportExport.js',
+    'calWeekPrinter.js',
+]
+
 with Files('**'):
     BUG_COMPONENT = ('Calendar', 'Import and Export')
 
 with Files('*Print*'):
     BUG_COMPONENT = ('Calendar', 'Printing')
--- a/calendar/lightning/Makefile.in
+++ b/calendar/lightning/Makefile.in
@@ -89,19 +89,16 @@ DEFINES += -DTHUNDERBIRD_VERSION=$(THUND
            -DLIGHTNING_VERSION=$(LIGHTNING_VERSION) \
            -DTARGET_PLATFORM=$(OS_TARGET)_$(TARGET_XPCOM_ABI) \
            -DXPI_EM_ID="$(XPI_EM_ID)" \
            $(NULL)
 
 GRE_BUILDID = $(shell $(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/application.ini App BuildID)
 DEFINES += -DGRE_BUILDID=$(GRE_BUILDID)
 
-libs::
-	$(NSINSTALL) -m 0644 $(srcdir)/../timezones/zones.json $(FINAL_TARGET)/timezones
-
 include $(topsrcdir)/config/rules.mk
 include $(srcdir)/lightning-packager.mk
 include $(srcdir)/lightning-tests.mk
 
 # For Lightning, we also need to preprocess the l10n prefs. Pull in the en-US
 # copy if the files doesn't exist.
 repack-process-extrafiles: lightning-extrafiles
 lightning-extrafiles: LTN_ABCD_L10NJS=$(call EXPAND_LOCALE_SRCDIR,calendar/locales)/lightning-l10n.js
--- a/calendar/lightning/moz.build
+++ b/calendar/lightning/moz.build
@@ -26,16 +26,20 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'co
     DEFINES['THEME'] = 'osx'
 else:
     DEFINES['THEME'] = 'linux'
 
 JS_PREFERENCE_FILES += [
     'content/lightning.js',
 ]
 
+FINAL_TARGET_FILES.timezones += [
+    '../timezones/zones.json',
+]
+
 with Files('**'):
     BUG_COMPONENT = ('Calendar', 'Lightning Only')
 
 with Files('content/suite-*'):
     BUG_COMPONENT = ('Calendar', 'Lightning: SeaMonkey Integration')
 
 with Files('build/**'):
     BUG_COMPONENT = ('Calendar', 'Build Config')
deleted file mode 100644
--- a/calendar/providers/caldav/Makefile.in
+++ /dev/null
@@ -1,18 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-EXTRA_SCRIPTS = calDavRequestHandlers.js
-
-libs:: $(EXTRA_SCRIPTS)
-	if test ! -d $(FINAL_TARGET)/calendar-js; then $(NSINSTALL) -D $(FINAL_TARGET)/calendar-js; fi
-	$(INSTALL) $^ $(FINAL_TARGET)/calendar-js
-
-include $(topsrcdir)/config/rules.mk
--- a/calendar/providers/caldav/moz.build
+++ b/calendar/providers/caldav/moz.build
@@ -5,10 +5,14 @@
 
 DIRS += ['public']
 
 EXTRA_COMPONENTS += [
     'calDavCalendar.js',
     'calDavCalendar.manifest',
 ]
 
+FINAL_TARGET_FILES['calendar-js'] += [
+    'calDavRequestHandlers.js',
+]
+
 with Files('**'):
     BUG_COMPONENT = ('Calendar', 'Provider: CalDAV')
deleted file mode 100644
--- a/calendar/providers/wcap/Makefile.in
+++ /dev/null
@@ -1,25 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-DEPTH           = @DEPTH@
-topsrcdir       = @top_srcdir@
-srcdir          = @srcdir@
-VPATH           = @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-EXTRA_SCRIPTS = \
-                calWcapUtils.js \
-                calWcapRequest.js \
-                calWcapErrors.js \
-                calWcapSession.js \
-                calWcapCalendarItems.js \
-                calWcapCalendar.js \
-                $(NULL)
-
-libs:: $(EXTRA_SCRIPTS)
-	if test ! -d $(FINAL_TARGET)/calendar-js; then $(NSINSTALL) -D $(FINAL_TARGET)/calendar-js; fi
-	$(INSTALL) $^ $(FINAL_TARGET)/calendar-js
-
-include $(topsrcdir)/config/rules.mk
--- a/calendar/providers/wcap/moz.build
+++ b/calendar/providers/wcap/moz.build
@@ -5,10 +5,19 @@
 
 DIRS += ['public']
 
 EXTRA_COMPONENTS += [
     'calWcapCalendarModule.js',
     'calWcapCalendarModule.manifest',
 ]
 
+FINAL_TARGET_FILES['calendar-js'] += [
+    'calWcapCalendar.js',
+    'calWcapCalendarItems.js',
+    'calWcapErrors.js',
+    'calWcapRequest.js',
+    'calWcapSession.js',
+    'calWcapUtils.js',
+]
+
 with Files('**'):
     BUG_COMPONENT = ('Calendar', 'Provider: WCAP')
deleted file mode 100644
--- a/im/app/profile/Makefile.in
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-include $(topsrcdir)/config/rules.mk
-
-FILES := \
-	mimeTypes.rdf \
-	localstore.rdf \
-	$(NULL)
-
-libs:: $(FILES)
-	$(SYSINSTALL) $(IFLAGS1) $^ $(DIST)/bin/defaults/profile
--- a/im/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/Makefile.in
+++ b/im/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/Makefile.in
@@ -1,26 +1,8 @@
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-include $(topsrcdir)/config/rules.mk
-
-FILES := \
-	install.rdf \
-	chrome.manifest \
-	preview.png \
-	$(NULL)
-
-install.rdf: install.rdf.in
-	$(call py_action,preprocessor,$(DEFINES) $(ACDEFINES) $< -o $@)
-
-libs:: $(FILES)
-	$(INSTALL) $(foreach f,$^,"$f") $(DIST)/bin/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
-
-GARBAGE += install.rdf
+THEME_FILES := install.rdf.in
+THEME_FILES_PATH := $(FINAL_TARGET)/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
+PP_TARGETS := THEME_FILES
--- a/im/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/moz.build
+++ b/im/app/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/moz.build
@@ -1,6 +1,11 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 DEFINES['INSTANTBIRD_VERSION'] = CONFIG['INSTANTBIRD_VERSION']
+
+FINAL_TARGET_FILES.extensions['{972ce4c6-7e08-4474-a285-3208198ce6fd}'] += [
+    'chrome.manifest',
+    'preview.png',
+]
--- a/im/app/profile/moz.build
+++ b/im/app/profile/moz.build
@@ -2,8 +2,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/.
 
 DIRS += ['extensions']
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'mac', 'cocoa'):
     DEFINES['HAVE_SHELL_SERVICE'] = 1
+
+FINAL_TARGET_FILES.defaults.profile += [
+    'localstore.rdf',
+    'mimeTypes.rdf',
+]
deleted file mode 100644
--- a/im/themes/Makefile.in
+++ /dev/null
@@ -1,16 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-ICON_FILES := icon.png
-ICON_DEST = $(FINAL_TARGET)/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
-INSTALL_TARGETS += ICON
-
-include $(topsrcdir)/config/rules.mk
--- a/im/themes/moz.build
+++ b/im/themes/moz.build
@@ -1,6 +1,10 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 JAR_MANIFESTS += ['jar.mn']
+
+FINAL_TARGET_Files.extensions['{972ce4c6-7e08-4474-a285-3208198ce6fd}'] += [
+    'icon.png',
+]
deleted file mode 100644
--- a/mail/app/profile/Makefile.in
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-include $(topsrcdir)/config/rules.mk
-
-FILES := \
-	mimeTypes.rdf \
-	localstore.rdf \
-	$(NULL)
-
-libs:: $(FILES)
-	$(SYSINSTALL) $(IFLAGS1) $^ $(DIST)/bin/defaults/profile
--- a/mail/app/profile/moz.build
+++ b/mail/app/profile/moz.build
@@ -1,7 +1,11 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 DIRS += ['extensions']
 
+FINAL_TARGET_FILES.defaults.profile += [
+    'localstore.rdf',
+    'mimeTypes.rdf',
+]
deleted file mode 100644
--- a/mail/themes/linux/Makefile.in
+++ /dev/null
@@ -1,23 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-include $(topsrcdir)/config/rules.mk
-
-CLASSIC_EXTENSION_DIR = {972ce4c6-7e08-4474-a285-3208198ce6fd}
-
-FILES := \
-  ../shared/mail/icon.png \
-  ../shared/mail/icon64.png \
-  mail/chrome.manifest \
-  $(NULL)
-
-libs:: $(FILES)
-	$(INSTALL) $(foreach f,$^,"$f") $(DIST)/bin/extensions/$(CLASSIC_EXTENSION_DIR)
--- a/mail/themes/linux/moz.build
+++ b/mail/themes/linux/moz.build
@@ -1,6 +1,12 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 JAR_MANIFESTS += ['jar.mn']
+
+FINAL_TARGET_FILES.extensions['{972ce4c6-7e08-4474-a285-3208198ce6fd}'] += [
+    '../shared/mail/icon.png',
+    '../shared/mail/icon64.png',
+    'mail/chrome.manifest',
+]
deleted file mode 100644
--- a/mail/themes/osx/Makefile.in
+++ /dev/null
@@ -1,23 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-include $(topsrcdir)/config/rules.mk
-
-CLASSIC_EXTENSION_DIR = {972ce4c6-7e08-4474-a285-3208198ce6fd}
-
-FILES := \
-  ../shared/mail/icon.png \
-  ../shared/mail/icon64.png \
-  mail/chrome.manifest \
-  $(NULL)
-
-libs:: $(FILES)
-	$(INSTALL) $(foreach f,$^,"$f") $(DIST)/bin/extensions/$(CLASSIC_EXTENSION_DIR)
--- a/mail/themes/osx/moz.build
+++ b/mail/themes/osx/moz.build
@@ -1,6 +1,12 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 JAR_MANIFESTS += ['jar.mn']
+
+FINAL_TARGET_FILES.extensions['{972ce4c6-7e08-4474-a285-3208198ce6fd}'] += [
+    '../shared/mail/icon.png',
+    '../shared/mail/icon64.png',
+    'mail/chrome.manifest',
+]
deleted file mode 100644
--- a/mail/themes/windows/Makefile.in
+++ /dev/null
@@ -1,23 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-include $(topsrcdir)/config/rules.mk
-
-CLASSIC_EXTENSION_DIR = {972ce4c6-7e08-4474-a285-3208198ce6fd}
-
-FILES := \
-  ../shared/mail/icon.png \
-  ../shared/mail/icon64.png \
-  mail/chrome.manifest \
-  $(NULL)
-
-libs:: $(FILES)
-	$(INSTALL) $(foreach f,$^,"$f") $(DIST)/bin/extensions/$(CLASSIC_EXTENSION_DIR)
--- a/mail/themes/windows/moz.build
+++ b/mail/themes/windows/moz.build
@@ -1,6 +1,12 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 JAR_MANIFESTS += ['jar.mn']
+
+FINAL_TARGET_FILES.extensions['{972ce4c6-7e08-4474-a285-3208198ce6fd}'] += [
+    '../shared/mail/icon.png',
+    '../shared/mail/icon64.png',
+    'mail/chrome.manifest',
+]
deleted file mode 100644
--- a/mailnews/base/ispdata/Makefile.in
+++ /dev/null
@@ -1,35 +0,0 @@
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-EXPORT_DIR      = $(DIST)/bin/isp
-
-EXPORT_RESOURCE_FILES =  \
-		$(NULL)
-
-ifdef MOZ_MOVEMAIL
-ifdef MOZ_THUNDERBIRD
-ifneq (cocoa,$(MOZ_WIDGET_TOOLKIT))
-EXPORT_RESOURCE_FILES += movemail.rdf
-endif
-else
-EXPORT_RESOURCE_FILES += movemail.rdf
-endif
-endif
-
-include $(topsrcdir)/config/rules.mk
-
-GARBAGE		+= $(addprefix $(EXPORT_DIR)/, $(EXPORT_RESOURCE_FILES)) 
-
-ifneq ($(EXPORT_RESOURCE_FILES),$(NULL))
-libs:: $(EXPORT_RESOURCE_FILES)
-	$(INSTALL) $^ $(EXPORT_DIR)
-endif
--- a/mailnews/base/ispdata/moz.build
+++ b/mailnews/base/ispdata/moz.build
@@ -1,4 +1,8 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+# Disable movemail for Thunderbird on OSX
+if CONFIG['MOZ_MOVEMAIL'] and not (CONFIG['MOZ_THUNDERBIRD'] and CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa'):
+    FINAL_TARGET_FILES.isp += ['movemail.rdf']
deleted file mode 100644
--- a/mailnews/base/search/src/Makefile.in
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-EXPORT_DIR	= $(DIST)/bin/isp
-
-
-EXPORT_RESOURCE_FILES	= \
-				  Bogofilter.sfd \
-				  DSPAM.sfd \
-				  POPFile.sfd \
-				  SpamAssassin.sfd \
-				  SpamPal.sfd \
-			        $(NULL)
-
-include $(topsrcdir)/config/rules.mk
-
-GARBAGE += $(addprefix $(EXPORT_DIR)/, $(EXPORT_RESOURCE_FILES)) 
-
-libs:: $(EXPORT_RESOURCE_FILES)
-	 $(INSTALL) $^ $(EXPORT_DIR)
--- a/mailnews/base/search/src/moz.build
+++ b/mailnews/base/search/src/moz.build
@@ -19,8 +19,15 @@ SOURCES += [
 
 EXTRA_COMPONENTS += [
     'nsMsgTraitService.js',
     'nsMsgTraitService.manifest',
 ]
 
 FINAL_LIBRARY = 'mail'
 
+FINAL_TARGET_FILES.isp += [
+    'Bogofilter.sfd',
+    'DSPAM.sfd',
+    'POPFile.sfd',
+    'SpamAssassin.sfd',
+    'SpamPal.sfd',
+]
deleted file mode 100644
--- a/mailnews/extensions/dsn/Makefile.in
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-include $(topsrcdir)/config/rules.mk
-
-libs::
-	$(INSTALL) $(srcdir)/content/dsn.js $(DIST)/bin/defaults/pref
--- a/mailnews/extensions/dsn/moz.build
+++ b/mailnews/extensions/dsn/moz.build
@@ -4,8 +4,12 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 EXTRA_COMPONENTS += [
     'src/dsn-service.js',
     'src/dsn-service.manifest',
 ]
 
 JAR_MANIFESTS += ['jar.mn']
+
+JS_PREFERENCE_FILES += [
+    'content/dsn.js',
+]
\ No newline at end of file
deleted file mode 100644
--- a/mailnews/extensions/mailviews/content/Makefile.in
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-DEPTH = @DEPTH@
-topsrcdir	= @top_srcdir@
-VPATH		= @srcdir@
-srcdir		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-EXPORT_DIR	= $(DIST)/bin/defaults/messenger
-
-EXPORT_RESOURCE_FILES	= \
-			mailViews.dat \
-			$(NULL)
-
-include $(topsrcdir)/config/rules.mk
-
-GARBAGE		+= $(addprefix $(EXPORT_DIR)/, $(EXPORT_RESOURCE_FILES))
-
-libs:: $(EXPORT_RESOURCE_FILES)
-	$(INSTALL) $^ $(EXPORT_DIR)
--- a/mailnews/extensions/mailviews/content/moz.build
+++ b/mailnews/extensions/mailviews/content/moz.build
@@ -1,5 +1,8 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
+FINAL_TARGET_FILES.defaults.messenger += [
+    'mailViews.dat',
+]
deleted file mode 100644
--- a/mailnews/extensions/mdn/Makefile.in
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-include $(topsrcdir)/config/rules.mk
-
-libs::
-	$(INSTALL) $(srcdir)/content/mdn.js $(DIST)/bin/defaults/pref
--- a/mailnews/extensions/mdn/moz.build
+++ b/mailnews/extensions/mdn/moz.build
@@ -2,8 +2,12 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 DIRS += ['src']
 TEST_DIRS += ['test']
 
 JAR_MANIFESTS += ['jar.mn']
+
+JS_PREFERENCE_FILES += [
+    'content/mdn.js',
+]
deleted file mode 100644
--- a/mailnews/extensions/newsblog/Makefile.in
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
- # of those above. If you wish to allow use of your version of this file only
-# under the terms of either the GPL or the LGPL, and not to allow others to
-# use your version of this file under the terms of the MPL, indicate your
-# decision by deleting the provisions above and replace them with the notice
-# and other provisions required by the GPL or the LGPL. If you do not delete
-# the provisions above, a recipient may use your version of this file under
-# the terms of any one of the MPL, the GPL or the LGPL.
-#
-# ***** END LICENSE BLOCK *****
-
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-EXPORT_DIR	= $(DIST)/bin/isp
-
-GARBAGE += $(EXPORT_DIR)/rss.rdf 
-
-libs:: rss.rdf
-	$(INSTALL) $^ $(EXPORT_DIR)
-
-include $(topsrcdir)/config/rules.mk
--- a/mailnews/extensions/newsblog/moz.build
+++ b/mailnews/extensions/newsblog/moz.build
@@ -7,8 +7,12 @@ EXTRA_COMPONENTS += [
     'js/newsblog.js',
     'js/newsblog.manifest',
 ]
 
 EXTRA_JS_MODULES += [
     'content/FeedUtils.jsm',
 ]
 JAR_MANIFESTS += ['jar.mn']
+
+FINAL_TARGET_FILES.isp += [
+    'rss.rdf',
+]
deleted file mode 100644
--- a/mailnews/extensions/smime/Makefile.in
+++ /dev/null
@@ -1,16 +0,0 @@
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-include $(topsrcdir)/config/rules.mk
-
-libs::
-	$(INSTALL) $(srcdir)/content/smime.js $(DIST)/bin/defaults/pref
--- a/mailnews/extensions/smime/moz.build
+++ b/mailnews/extensions/smime/moz.build
@@ -4,8 +4,12 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 DIRS += [
     'public',
     'src',
 ]
 
 JAR_MANIFESTS += ['jar.mn']
+
+JS_PREFERENCE_FILES += [
+    'content/smime.js',
+]
--- a/suite/branding/nightly/Makefile.in
+++ b/suite/branding/nightly/Makefile.in
@@ -1,84 +1,15 @@
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
 # Note: mac icons are handled in /suite/app during the final application
 # packaging
-ifneq (,$(filter windows gtk gtk2,$(MOZ_WIDGET_TOOLKIT)))
-ifneq (,$(filter windows,$(MOZ_WIDGET_TOOLKIT)))
-ICON_SUFFIX=.ico
-else
-ICON_SUFFIX=.png
-endif
-
-ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
-ICON_DIR=gtk
-else
-ICON_DIR=$(MOZ_WIDGET_TOOLKIT)
-endif
-
-DESKTOP_ICONS = \
-	abcardWindow \
-	ablistWindow \
-	addressbookWindow \
-	bookmarkproperties \
-	downloadManager \
-	editorWindow \
-	findBookmarkWindow \
-	findHistoryWindow \
-	history-window \
-	JSConsoleWindow \
-	main-window \
-	messengerWindow \
-	msgcomposeWindow \
-	places \
-	$(NULL) 
-
-ifeq (windows,$(MOZ_WIDGET_TOOLKIT))
-# Windows icons
-DESKTOP_ICONS += \
-	gif-file \
-	html-file \
-	misc-file \
-	image-file \
-	jpeg-file \
-	script-file \
-	xml-file \
-	xul-file \
-	$(NULL)
-endif
-
-ifeq ($(ICON_DIR),gtk)
-libs:: icons/gtk/seamonkey.png
-	$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin/chrome/icons/default
-
-GARBAGE	+= $(DIST)/bin/chrome/icons/default/seamonkey.png
-
-DESKTOP_ICONS += default
-DESKTOP_ICONS_SMALL = $(patsubst %,%16,$(DESKTOP_ICONS))
-DESKTOP_ICONS_LARGE = $(patsubst %,%48,$(DESKTOP_ICONS))
-endif
-
-DESKTOP_ICON_FILES = $(addsuffix $(ICON_SUFFIX), $(DESKTOP_ICONS) $(DESKTOP_ICONS_SMALL) $(DESKTOP_ICONS_LARGE))
-
-libs:: $(addprefix icons/$(ICON_DIR)/,$(DESKTOP_ICON_FILES))
-	$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin/chrome/icons/default
-
-GARBAGE	+= $(addprefix $(DIST)/bin/chrome/icons/default/,$(DESKTOP_ICON_FILES))
-endif
 
 include $(topsrcdir)/config/rules.mk
 
 export::
 	$(NSINSTALL) -D $(DIST)/branding
 ifeq ($(OS_ARCH),WINNT)
 	cp $(srcdir)/icons/windows/seamonkey.ico      $(DIST)/branding/seamonkey.ico
 	cp $(srcdir)/icons/windows/html-file.ico      $(DIST)/branding/html-file.ico
--- a/suite/branding/nightly/moz.build
+++ b/suite/branding/nightly/moz.build
@@ -1,6 +1,70 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 JAR_MANIFESTS += ['jar.mn']
+
+# Note: mac icons are handled in /suite/app during the final application
+# packaging
+if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk', 'gtk2'):
+    if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
+        icon_suffix = '.ico'
+    else:
+        icon_suffix = '.png'
+
+    if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk2':
+        icon_dir = 'gtk'
+    else:
+        icon_dir = CONFIG['MOZ_WIDGET_TOOLKIT']
+
+    desktop_icons = [
+        'abcardWindow',
+        'ablistWindow',
+        'addressbookWindow',
+        'bookmarkproperties',
+        'downloadManager',
+        'editorWindow',
+        'findBookmarkWindow',
+        'findHistoryWindow',
+        'history-window',
+        'JSConsoleWindow',
+        'main-window',
+        'messengerWindow',
+        'msgcomposeWindow',
+        'places',
+    ]
+
+    if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
+        # Windows icons
+        desktop_icons += [
+            'gif-file',
+            'html-file',
+            'misc-file',
+            'image-file',
+            'jpeg-file',
+            'script-file',
+            'xml-file',
+            'xul-file',
+        ]
+
+    desktop_icons_small = []
+    desktop_icons_large = []
+
+    if ICON_DIR == 'gtk':
+        FINAL_TARGET_FILES.chrome.icons.default += [
+            'icons/gtk/seamonkey.png'
+        ]
+
+        desktop_icons += [
+            'default'
+        ]
+
+        desktop_icons_small = [ '%s16' % i for i in desktop_icons ]
+        desktop_icons_large = [ '%s48' % i for i in desktop_icons ]
+
+    FINAL_TARGET_FILES.chrome.icons.default += [
+        'icons/%s/%s%s' % (icon_dir, i, icon_suffix) for i in sorted(
+            desktop_icons + desktop_icons_small + desktop_icons_large
+        ),
+    ]
--- a/suite/locales/Makefile.in
+++ b/suite/locales/Makefile.in
@@ -1,20 +1,12 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-DEPTH          = @DEPTH@
-topsrcdir      = @top_srcdir@
-srcdir         = @srcdir@
-VPATH          = @srcdir@
-relativesrcdir = @relativesrcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
 include $(topsrcdir)/config/config.mk
 
 _ABS_SRCDIR := $(abspath $(topsrcdir))
 
 vpath %.xml @srcdir@/en-US/searchplugins
 vpath %.xml $(LOCALE_SRCDIR)/searchplugins
 
 SUBMAKEFILES += \
@@ -76,20 +68,16 @@ include $(topsrcdir)/config/rules.mk
 
 include $(topsrcdir)/mozilla/toolkit/locales/l10n.mk
 
 $(STAGEDIST): $(DIST)/branding
 
 $(DIST)/branding:
 	$(NSINSTALL) -D $@
 
-PROFILE_FILES = \
-	mimeTypes.rdf \
-	$(NULL)
-
 PROFILE_CHROME = userChrome-example.css userContent-example.css
 
 NO_JA_JP_MAC_AB_CD := $(if $(filter ja-JP-mac, $(AB_CD)),ja,$(AB_CD))
 
 BOOKMARKS_INC_FILE = $(call MERGE_FILE,profile/bookmarks.inc)
 BOOKMARKS_XTRA_FILE = $(call MERGE_FILE,profile/bookmarks.extra)
 
 # the #include in the .in file requires all to be in the same dir, sadly.
@@ -115,19 +103,16 @@ PANELS_XTRA_FILE = $(call MERGE_FILE,pro
 	  -n 's/.*<RDF:Description about="\(.*\)">.*/        <RDF:li resource="\1"\/>/p' \
 	  profile/panels.extra > profile/panels-urn.inc
 	$(call py_action,preprocessor, \
 	  profile/panels.rdf.in -o $@)
 
 libs:: $(FINAL_TARGET)/defaults/profile/bookmarks.html ;
 libs:: $(FINAL_TARGET)/defaults/profile/panels.rdf ;
 
-libs:: $(addprefix generic/profile/,$(PROFILE_FILES))
-	$(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/defaults/profile
-
 libs:: $(call MERGE_FILES,$(addprefix profile/chrome/,$(PROFILE_CHROME)))
 	$(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/defaults/profile/chrome
 
 # Extend l10n.mk clobber-% target for our localised extensions
 clobber-%:
 	$(RM) -rf $(DIST)/xpi-stage/chatzilla-$* $(DIST)/xpi-stage/chatzilla-*.$*.xpi
 
 libs-%:
--- a/suite/locales/moz.build
+++ b/suite/locales/moz.build
@@ -1,8 +1,12 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 JAR_MANIFESTS += ['jar.mn']
 
 DEFINES['MOZ_APP_MAXVERSION'] = CONFIG['MOZ_APP_MAXVERSION']
+
+FINAL_TARGET_FILES.defaults.profile += [
+    'generic/profile/mimeTypes.rdf',
+]
--- a/suite/themes/classic/Makefile.in
+++ b/suite/themes/classic/Makefile.in
@@ -1,24 +1,7 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(DEPTH)/config/autoconf.mk
-
-include $(topsrcdir)/config/rules.mk
-
-CLASSIC_EXTENSION_DIR = {972ce4c6-7e08-4474-a285-3208198ce6fd}
-
-FILES = \
-	$(srcdir)/chrome.manifest \
-	$(srcdir)/icon.png \
-	$(srcdir)/preview.png \
-	$(NULL)
-
-libs::
-	$(INSTALL) $(FILES) $(DIST)/bin/extensions/$(CLASSIC_EXTENSION_DIR)
-	$(call py_action,preprocessor,$(DEFINES) $(ACDEFINES) $(srcdir)/install.rdf -o $(DIST)/bin/extensions/$(CLASSIC_EXTENSION_DIR)/install.rdf)
+THEME_FILES := install.rdf
+THEME_FILES_PATH := $(FINAL_TARGET)/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
+PP_TARGETS += THEME_FILES
--- a/suite/themes/classic/moz.build
+++ b/suite/themes/classic/moz.build
@@ -1,8 +1,14 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 JAR_MANIFESTS += ['jar.mn']
 
 DEFINES['SEAMONKEY_VERSION'] = CONFIG['SEAMONKEY_VERSION']
+
+FINAL_TARGET_FILES.extensions['{972ce4c6-7e08-4474-a285-3208198ce6fd}'] += [
+    'chrome.manifest',
+    'icon.png',
+    'preview.png',
+]
--- a/suite/themes/modern/Makefile.in
+++ b/suite/themes/modern/Makefile.in
@@ -1,21 +1,5 @@
 #
 # 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/.
 
-DEPTH		= @DEPTH@
-topsrcdir	= @top_srcdir@
-srcdir		= @srcdir@
-VPATH		= @srcdir@
-
-include $(topsrcdir)/config/config.mk
-
-FILES = \
-	$(srcdir)/preview.png \
-	$(srcdir)/icon.png \
-	$(NULL)
-
-libs::
-	$(INSTALL) $(FILES) $(FINAL_TARGET)
-
-include $(topsrcdir)/config/rules.mk
--- a/suite/themes/modern/moz.build
+++ b/suite/themes/modern/moz.build
@@ -7,8 +7,13 @@ DIST_FILES += ['install.rdf']
 
 DIST_SUBDIR = 'extensions/modern@themes.mozilla.org'
 
 JAR_MANIFESTS += ['jar.mn']
 
 USE_EXTENSION_MANIFEST = True
 
 DEFINES['SEAMONKEY_VERSION'] = CONFIG['SEAMONKEY_VERSION']
+
+FINAL_TARGET_FILES += [
+    'icon.png',
+    'preview.png',
+]