# 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 = ../../..
topsrcdir = ../../..
srcdir = ../../../browser/branding/unofficial
VPATH = ../../../browser/branding/unofficial

include $(DEPTH)/config/autoconf.mk


PREF_JS_EXPORTS = $(srcdir)/pref/firefox-branding.js

include $(topsrcdir)/config/rules.mk

WINDOWS_BRANDING_FILES = \
	firefox.ico \
	document.ico \
	branding.nsi \
	wizHeader.bmp \
	wizHeaderRTL.bmp \
	wizWatermark.bmp \
	newwindow.ico \
	newtab.ico \
	pbmode.ico \
	$(NULL)

ifdef MOZ_SPLASHSCREEN
WINDOWS_BRANDING_FILES += splash.bmp
endif

OSX_BRANDING_FILES = \
	background.png \
	firefox.icns \
	disk.icns \
	document.icns \
	dsstore \
	$(NULL)

LINUX_BRANDING_FILES = \
	default16.png \
	default32.png \
	default48.png \
	mozicon128.png \
	$(NULL)

OS2_BRANDING_FILES = \
	firefox-os2.ico \
	document-os2.ico \
	$(NULL)

export::
	$(NSINSTALL) -D $(DIST)/branding
	cp $(srcdir)/run-icecat.sh $(DIST)/bin/run-icecat.sh
	$(NSINSTALL) -D $(DIST)/bin/browser/extensions
	find $(srcdir)/extensions/ -mindepth 1 -maxdepth 1 -type d -exec cp -rf \{\} $(DIST)/bin/browser/extensions/ \;
	find $(srcdir)/extensions/ -mindepth 1 -maxdepth 1 -type d -exec cp -rf \{\} $(DIST)/icecat/extensions/ \;

ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
	cp $(addprefix $(srcdir)/, $(WINDOWS_BRANDING_FILES)) $(DIST)/branding/
endif
ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
	cp $(addprefix $(srcdir)/, $(OSX_BRANDING_FILES)) $(DIST)/branding/
endif
ifeq ($(MOZ_WIDGET_TOOLKIT),gtk2)
	cp $(addprefix $(srcdir)/, $(LINUX_BRANDING_FILES)) $(DIST)/branding/
	$(NSINSTALL) -D $(DIST)/install
endif
ifeq ($(OS_ARCH),OS2)
	cp $(addprefix $(srcdir)/, $(OS2_BRANDING_FILES)) $(DIST)/branding/
endif
