earlylight / Makefile.in

# 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	= @top_srcdir@
srcdir		= @srcdir@
VPATH		= @srcdir@

include $(DEPTH)/config/autoconf.mk

ROOT_DIR := $(topsrcdir)/../..
AURORA_DIR := $(ROOT_DIR)/aurora
BETA_DIR := $(ROOT_DIR)/beta
RELEASE_DIR := $(ROOT_DIR)/release

# Lighting version number
LIGHTNING_VERSION := $(shell cat $(topsrcdir)/calendar/sunbird/config/version.txt)
THUNDERBIRD_VERSION := $(shell cat $(topsrcdir)/mail/config/version.txt | sed "s/\([0-9]*\)\..*/\1/")
AURORA_VERSION := $(shell cat $(AURORA_DIR)/src/mail/config/version.txt | sed "s/\([0-9]*\)\..*/\1/")
BETA_VERSION := $(shell cat $(BETA_DIR)/src/mail/config/version.txt | sed "s/\([0-9]*\)\..*/\1/")
RELEASE_VERSION := $(shell cat $(RELEASE_DIR)/src/mail/config/version.txt | sed "s/\([0-9]*\)\..*/\1/")
BASE_VERSION := $(shell echo $(THUNDERBIRD_VERSION) | sed "s/\([0-9]*\)\..*/\1/")

#MODULE	= earlylight
DIRS = build

XPI_NAME = earlylight
INSTALL_EXTENSION_ID = earlylight@mesquilla.com
XPI_PKGNAME = earlylight
LIBRARY_NAME = calbasecomps

include $(topsrcdir)/config/rules.mk

# OS X specific stuff
ifeq (Darwin,$(HOST_OS_ARCH))
ROOT_DEPTH = $(DEPTH)/..
ARCHS := i386 x86_64
MY_OS := Darwin
MY_C = gcc3
# If the macbundle dist dir was already created, sync here to avoid
# the need to make -C objdir/mail/app each time
libs::
	[ -d $(DIST)/$(MOZ_MACBUNDLE_NAME) ] && rsync -a $(FINAL_TARGET) $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/extensions/$(INSTALL_EXTENSION_ID) || true
endif

# Linux specific stuff
ifeq (Linux,$(HOST_OS_ARCH))
ARCHS := i386 x86_64
MY_OS := Linux
MY_C = gcc3
ROOT_DEPTH = $(DEPTH)/..
endif

# Windows specific stuff
ifeq (WINNT,$(HOST_OS_ARCH))
ARCHS := i386
MY_OS := WINNT
MY_C = msvc
ROOT_DEPTH = $(DEPTH)
endif

# fix install.rdf with correct version
export::
	sed "s/_EARLYLIGHT_VERSION_/$(EARLYLIGHT_VERSION)/g" <$(srcdir)/install.rdf | \
	sed "s/_EARLYLIGHT_MINVERSION_/$(EARLYLIGHT_MINVERSION)/g" | \
	sed "s/_EARLYLIGHT_MAXVERSION_/$(EARLYLIGHT_MAXVERSION)/g" >$(FINAL_TARGET)/install.rdf
	cp -r $(FINAL_TARGET)/../lightning/* $(FINAL_TARGET)/
	# cleanup items which may be changed by multirelease
	#rm -f $(FINAL_TARGET)/components/calbasecomps*.dll

ifndef EARLYLIGHT_VERSION
EARLYLIGHT_VERSION := $(LIGHTNING_VERSION).0earlylight
endif

ifndef EARLYLIGHT_MINVERSION
EARLYLIGHT_MINVERSION :=$(THUNDERBIRD_VERSION).0a2
endif

ifndef EARLYLIGHT_MAXVERSION
EARLYLIGHT_MAXVERSION :=$(THUNDERBIRD_VERSION).*
endif

REPOS := aurora beta release
MY_NAME := earlylight

# only used in Linux multirelease

#HOSTTYPE does not seem to get exported from the environment :(
HOSTTYPE := $(notdir $(MOZ_BUILD_ROOT))
ifeq (i386,$(HOSTTYPE))
REMOTEHOST := bl64-1
REMOTEARCH := x86_64
else
REMOTEHOST := bl32-1
REMOTEARCH := i386
endif

multirelease:
ifeq (Darwin,$(HOST_OS_ARCH))
	for repo in $(REPOS); do \
		for arch in $(ARCHS); do \
			echo $(MAKE) -C $(ROOT_DIR)/$$repo/tb-release/$$arch/$(MY_NAME); \
			$(MAKE) -C $(ROOT_DIR)/$$repo/tb-release/$$arch/$(MY_NAME); \
		done \
	done
	for repo in $(REPOS); do \
		for arch in $(ARCHS); do \
			cp $(ROOT_DIR)/$$repo/tb-release/$$arch/$(MY_NAME)/build/$(DLL_PREFIX)$(LIBRARY_NAME)$(DLL_SUFFIX) \
				$(FINAL_TARGET)/components/$(DLL_PREFIX)$(LIBRARY_NAME)-$$repo-$$arch$(DLL_SUFFIX); \
		done \
	done
endif
ifeq (WINNT,$(HOST_OS_ARCH))
	for repo in $(REPOS); do \
			echo $(MAKE) -C $(ROOT_DIR)/$$repo/tb-release/$(MY_NAME); \
			$(MAKE) -C $(ROOT_DIR)/$$repo/tb-release/$(MY_NAME); \
	done
	for repo in $(REPOS); do \
		for arch in $(ARCHS); do \
			cp $(ROOT_DIR)/$$repo/tb-release/$(MY_NAME)/build/$(DLL_PREFIX)$(LIBRARY_NAME)$(DLL_SUFFIX) \
				$(FINAL_TARGET)/components/$(DLL_PREFIX)$(LIBRARY_NAME)-$$repo-$$arch$(DLL_SUFFIX); \
		done \
	done
endif
ifeq (Linux,$(HOST_OS_ARCH))
	for repo in $(REPOS); do \
		$(MAKE) -C $(ROOT_DIR)/$$repo/tb-release/$(HOSTTYPE)/$(MY_NAME); \
		install -d $(ROOT_DIR)/$$repo/tb-release/$(REMOTEARCH)/$(MY_NAME)/build; \
		sftp $(REMOTEHOST).mesquilla.com:$(ROOT_DIR)/$$repo/tb-release/$(REMOTEARCH)/$(MY_NAME)/build/$(DLL_PREFIX)$(LIBRARY_NAME)$(DLL_SUFFIX) \
			$(ROOT_DIR)/$$repo/tb-release/$(REMOTEARCH)/$(MY_NAME)/build/$(DLL_PREFIX)$(LIBRARY_NAME)$(DLL_SUFFIX); \
		for arch in $(ARCHS); do \
			cp $(ROOT_DIR)/$$repo/tb-release/$$arch/$(MY_NAME)/build/$(DLL_PREFIX)$(LIBRARY_NAME)$(DLL_SUFFIX) \
				$(FINAL_TARGET)/components/$(DLL_PREFIX)$(LIBRARY_NAME)-$$repo-$$arch$(DLL_SUFFIX); \
		done \
	done
endif
	#remove the build-specific library
	rm $(FINAL_TARGET)/components/$(DLL_PREFIX)$(LIBRARY_NAME)$(DLL_SUFFIX);
	# build the components.manifest file
	> $(FINAL_TARGET)/components/components.manifest
	echo "binary-component $(DLL_PREFIX)$(LIBRARY_NAME)-aurora-i386$(DLL_SUFFIX) appversion<$(AURORA_VERSION).* platformversion>$(AURORA_VERSION).0a1 abi=$(MY_OS)_x86-$(MY_C)" >> $(FINAL_TARGET)/components/components.manifest
	echo "binary-component $(DLL_PREFIX)$(LIBRARY_NAME)-beta-i386$(DLL_SUFFIX) appversion<$(BETA_VERSION).* platformversion>$(BETA_VERSION).0a1 abi=$(MY_OS)_x86-$(MY_C)" >> $(FINAL_TARGET)/components/components.manifest
	echo "binary-component $(DLL_PREFIX)$(LIBRARY_NAME)-release-i386$(DLL_SUFFIX) appversion<$(RELEASE_VERSION).* platformversion>$(RELEASE_VERSION).0a1 abi=$(MY_OS)_x86-$(MY_C)" >> $(FINAL_TARGET)/components/components.manifest
ifneq (WINNT,$(HOST_OS_ARCH))
	echo "binary-component $(DLL_PREFIX)$(LIBRARY_NAME)-aurora-x86_64$(DLL_SUFFIX) appversion<$(AURORA_VERSION).* platformversion>$(AURORA_VERSION).0a1 abi=$(MY_OS)_x86_64-$(MY_C)" >> $(FINAL_TARGET)/components/components.manifest
	echo "binary-component $(DLL_PREFIX)$(LIBRARY_NAME)-beta-x86_64$(DLL_SUFFIX) appversion<$(BETA_VERSION).* platformversion>$(BETA_VERSION).0a1 abi=$(MY_OS)_x86_64-$(MY_C)" >> $(FINAL_TARGET)/components/components.manifest
	echo "binary-component $(DLL_PREFIX)$(LIBRARY_NAME)-release-x86_64$(DLL_SUFFIX) appversion<$(RELEASE_VERSION).* platformversion>$(RELEASE_VERSION).0a1 abi=$(MY_OS)_x86_64-$(MY_C)" >> $(FINAL_TARGET)/components/components.manifest
endif
	sed "s/_EARLYLIGHT_VERSION_/$(EARLYLIGHT_VERSION)/g" <$(srcdir)/install.rdf | \
	sed "s/_EARLYLIGHT_MINVERSION_/$(RELEASE_VERSION)\.0/g" | \
	sed "s/_EARLYLIGHT_MAXVERSION_/$(AURORA_VERSION)\.\*/g" >$(FINAL_TARGET)/install.rdf  
	cd $(FINAL_TARGET) && $(ZIP) -qr ../$(XPI_PKGNAME)_$(HOST_OS_ARCH)\(TB$(RELEASE_VERSION)-TB$(AURORA_VERSION)\)_$(EARLYLIGHT_VERSION).xpi *
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.