calendar/installer/windows/Makefile.in
author Mark Banner <bugzilla@standard8.plus.com>
Mon, 01 Oct 2012 21:33:18 +0100
changeset 13467 f521dad4966d897becf28c7f976455677bda2459
parent 13273 6ce4c3cdaf3c3bace2bd82a9c46543a682fe262f
permissions -rw-r--r--
Bug 674742 Improve error handling to do our best to avoid removing folder files when rename fails during the compact process. Based on a patch suggested by Andrew (skm) r=rkent,a=Standard8

# 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 $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/package-name.mk

CONFIG_DIR = instgen
SFX_MODULE = $(topsrcdir)/other-licenses/7zstub/sunbird/7zSD.sfx

ifdef MOZ_UPDATER
DEFINES += -DMOZ_UPDATER=1
endif

PP_LOCALIZED_FILES = \
	packages-static \
	$(NULL)

INSTALLER_FILES = \
	app.tag \
	nsis/installer.nsi \
	nsis/uninstaller.nsi \
	nsis/shared.nsh \
	$(NULL)

BRANDING_FILES = \
	branding.nsi \
	wizHeader.bmp \
	wizHeaderRTL.bmp \
	wizWatermark.bmp \
	$(NULL)

DEFINES += \
	-DAB_CD=$(AB_CD) \
	-DPKG_BASENAME=$(PKG_BASENAME) \
	-DMOZ_APP_VERSION=$(MOZ_APP_VERSION) \
	-DMOZ_APP_DISPLAYNAME=${MOZ_APP_DISPLAYNAME} \
	-DMOZILLA_VERSION=${MOZILLA_VERSION} \
	$(NULL)

include $(topsrcdir)/config/config.mk

installer::
	$(MAKE) -C .. installer-stage
	$(MAKE) $(CONFIG_DIR)/setup.exe

# 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)
	$(EXIT_ON_ERROR) \
	for i in $(PP_LOCALIZED_FILES); do \
	  $(PYTHON) $(MOZILLA_SRCDIR)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $(srcdir)/$$i > $(CONFIG_DIR)/$$i; \
	done
	$(PYTHON) $(MOZILLA_SRCDIR)/config/Preprocessor.py -Fsubstitution $(DEFINES) $(ACDEFINES) \
	  $(srcdir)/nsis/defines.nsi.in > $(CONFIG_DIR)/defines.nsi
	$(PYTHON) $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
	  --preprocess-locale $(MOZILLA_SRCDIR) \
	  $(call EXPAND_LOCALE_SRCDIR,calendar/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)
	$(PYTHON) $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
	  --convert-utf8-utf16le $(DIST)/branding/license.txt $(CONFIG_DIR)/license.txt
	$(EXIT_ON_ERROR) \
	for i in $(PP_LOCALIZED_FILES); do \
	  $(PYTHON) $(MOZILLA_SRCDIR)/config/Preprocessor.py $(DEFINES) $(ACDEFINES) $(srcdir)/$$i > $(CONFIG_DIR)/$$i; \
	done
	$(PYTHON) $(MOZILLA_SRCDIR)/config/Preprocessor.py -Fsubstitution $(DEFINES) $(ACDEFINES) \
	  $(srcdir)/nsis/defines.nsi.in > $(CONFIG_DIR)/defines.nsi
	$(PYTHON) $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
	  --preprocess-locale $(MOZILLA_SRCDIR) \
	  $(call EXPAND_LOCALE_SRCDIR,calendar/locales)/installer $(AB_CD) $(CONFIG_DIR)

include $(topsrcdir)/config/rules.mk
include $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/windows/nsis/makensis.mk