2008-04-18 13:41:49 +00:00
|
|
|
# ***** BEGIN LICENSE BLOCK *****
|
|
|
|
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
#
|
|
|
|
# The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
# 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
# the License. You may obtain a copy of the License at
|
|
|
|
# http://www.mozilla.org/MPL/
|
|
|
|
#
|
|
|
|
# Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
# for the specific language governing rights and limitations under the
|
|
|
|
# License.
|
|
|
|
#
|
|
|
|
# The Original Code is Mozilla.
|
|
|
|
#
|
|
|
|
# The Initial Developer of the Original Code is
|
|
|
|
# the Mozilla Foundation <http://www.mozilla.org/>.
|
|
|
|
# Portions created by the Initial Developer are Copyright (C) 2007
|
|
|
|
# the Initial Developer. All Rights Reserved.
|
|
|
|
#
|
|
|
|
# Contributor(s):
|
|
|
|
# Mark Finkle <mfinkle@mozilla.com>
|
|
|
|
#
|
|
|
|
# Alternatively, the contents of this file may be used under the terms of
|
|
|
|
# either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
# in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
# 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 = ../..
|
|
|
|
topsrcdir = @top_srcdir@
|
|
|
|
srcdir = @srcdir@
|
|
|
|
VPATH = @srcdir@
|
|
|
|
|
|
|
|
include $(DEPTH)/config/autoconf.mk
|
|
|
|
|
2010-09-11 02:52:48 +00:00
|
|
|
DIRS = profile/extensions
|
|
|
|
|
2008-04-18 13:41:49 +00:00
|
|
|
PREF_JS_EXPORTS = $(srcdir)/mobile.js
|
2008-12-01 13:24:31 +00:00
|
|
|
DIST_FILES = application.ini
|
2008-04-18 13:41:49 +00:00
|
|
|
|
2010-01-29 16:15:37 +00:00
|
|
|
ifndef LIBXUL_SDK
|
|
|
|
PROGRAM=$(MOZ_APP_NAME)$(BIN_SUFFIX)
|
|
|
|
|
|
|
|
CPPSRCS = nsBrowserApp.cpp
|
|
|
|
|
|
|
|
LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
|
2010-11-15 15:38:21 +00:00
|
|
|
LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/base
|
2010-01-29 16:15:37 +00:00
|
|
|
|
2010-06-11 03:50:51 +00:00
|
|
|
LIBS += $(JEMALLOC_LIBS)
|
|
|
|
|
2010-04-06 12:48:34 +00:00
|
|
|
ifeq (Linux_1, $(OS_ARCH)_$(GNU_LD))
|
|
|
|
OS_LDFLAGS += -Wl,-rpath='$$ORIGIN'
|
|
|
|
NSDISTMODE = copy
|
|
|
|
endif
|
|
|
|
|
2011-05-23 16:54:47 +00:00
|
|
|
LIBS += \
|
|
|
|
$(XPCOM_GLUE_LDOPTS) \
|
|
|
|
$(NSPR_LIBS) \
|
|
|
|
$(NULL)
|
2010-01-29 16:15:37 +00:00
|
|
|
|
2010-04-06 12:48:34 +00:00
|
|
|
ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
|
|
|
|
LIBS += $(DIST)/bin/XUL
|
|
|
|
else
|
|
|
|
EXTRA_DSO_LIBS += xul
|
|
|
|
LIBS += $(EXTRA_DSO_LIBS)
|
2010-01-29 16:15:37 +00:00
|
|
|
endif
|
2010-04-06 12:48:34 +00:00
|
|
|
ifeq ($(OS_ARCH),WINNT)
|
|
|
|
OS_LIBS += $(call EXPAND_LIBNAME,version)
|
2010-01-29 16:15:37 +00:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef _MSC_VER
|
|
|
|
# Always enter a Windows program through wmain, whether or not we're
|
|
|
|
# a console application.
|
|
|
|
WIN32_EXE_LDFLAGS += -ENTRY:wmainCRTStartup
|
|
|
|
endif
|
|
|
|
endif #LIBXUL_SDK
|
|
|
|
|
2008-04-18 13:41:49 +00:00
|
|
|
include $(topsrcdir)/config/rules.mk
|
|
|
|
|
|
|
|
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)
|
2008-12-01 13:24:31 +00:00
|
|
|
APP_BUILDID = $(shell $(PYTHON) $(topsrcdir)/toolkit/xre/make-platformini.py --print-buildid)
|
2009-01-23 21:29:27 +00:00
|
|
|
APP_ICON = mobile
|
2009-06-17 16:39:26 +00:00
|
|
|
APP_SPLASH = splash
|
2008-04-18 13:41:49 +00:00
|
|
|
|
2009-10-26 16:11:20 +00:00
|
|
|
DEFINES += -DGRE_MILESTONE=$(GRE_MILESTONE) \
|
|
|
|
-DGRE_BUILDID=$(GRE_BUILDID) \
|
|
|
|
-DAPP_BUILDID=$(APP_BUILDID) \
|
2009-10-29 20:57:05 +00:00
|
|
|
-DAPP_NAME=$(MOZ_APP_NAME) \
|
2009-10-26 16:11:20 +00:00
|
|
|
-DAPP_VERSION=$(MOZ_APP_VERSION) \
|
2010-01-21 17:48:08 +00:00
|
|
|
-DMOZ_UPDATER=$(MOZ_UPDATER) \
|
2009-10-26 16:11:20 +00:00
|
|
|
$(NULL)
|
2008-04-18 13:41:49 +00:00
|
|
|
|
2010-05-20 15:17:08 +00:00
|
|
|
ifdef MOZILLA_OFFICIAL
|
|
|
|
DEFINES += -DMOZILLA_OFFICIAL
|
|
|
|
endif
|
|
|
|
|
2009-01-29 16:01:14 +00:00
|
|
|
SOURCE_STAMP := $(shell cd $(srcdir)/.. && hg identify 2>/dev/null | cut -f1 -d' ')
|
2009-01-29 15:40:41 +00:00
|
|
|
ifdef SOURCE_STAMP
|
|
|
|
DEFINES += -DMOZ_SOURCE_STAMP="$(SOURCE_STAMP)"
|
|
|
|
endif
|
|
|
|
|
2009-01-29 16:01:14 +00:00
|
|
|
# strip a trailing slash from the repo URL because it's not always present,
|
|
|
|
# and we want to construct a working URL in buildconfig.html
|
|
|
|
# make+shell+sed = awful
|
|
|
|
_dollar=$$
|
2009-02-23 23:19:18 +00:00
|
|
|
SOURCE_REPO := $(shell cd $(srcdir)/.. && hg showconfig paths.default 2>/dev/null | head -n1 | sed -e "s/^ssh:/http:/" -e "s/\/$(_dollar)//" )
|
2009-01-29 16:01:14 +00:00
|
|
|
# extra sanity check for old versions of hg
|
|
|
|
# that don't support showconfig
|
|
|
|
ifeq (http,$(patsubst http%,http,$(SOURCE_REPO)))
|
2009-01-29 15:40:41 +00:00
|
|
|
DEFINES += -DMOZ_SOURCE_REPO="$(SOURCE_REPO)"
|
|
|
|
endif
|
|
|
|
|
2009-05-19 05:47:48 +00:00
|
|
|
ifeq ($(OS_ARCH),WINNT)
|
|
|
|
REDIT_PATH = $(LIBXUL_DIST)/bin
|
|
|
|
endif
|
|
|
|
|
2008-04-18 13:41:49 +00:00
|
|
|
APP_BINARY = $(MOZ_APP_NAME)$(BIN_SUFFIX)
|
|
|
|
|
2010-04-06 12:48:34 +00:00
|
|
|
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
|
2008-04-18 13:41:49 +00:00
|
|
|
|
|
|
|
APP_NAME = $(MOZ_APP_DISPLAYNAME)
|
|
|
|
APP_VERSION = $(MOZ_APP_VERSION)
|
|
|
|
|
|
|
|
ifdef MOZ_DEBUG
|
|
|
|
APP_NAME := $(APP_NAME)Debug
|
|
|
|
endif
|
|
|
|
|
|
|
|
AB_CD = $(MOZ_UI_LOCALE)
|
|
|
|
|
|
|
|
AB := $(firstword $(subst -, ,$(AB_CD)))
|
|
|
|
|
|
|
|
clean clobber repackage::
|
|
|
|
rm -rf $(DIST)/$(APP_NAME).app
|
|
|
|
|
2010-04-06 12:48:34 +00:00
|
|
|
ifdef LIBXUL_SDK
|
2008-04-18 13:41:49 +00:00
|
|
|
APPFILES = Resources
|
2010-04-06 12:48:34 +00:00
|
|
|
else
|
|
|
|
APPFILES = MacOS
|
|
|
|
endif
|
2008-04-18 13:41:49 +00:00
|
|
|
|
|
|
|
libs repackage:: application.ini
|
|
|
|
mkdir -p $(DIST)/$(APP_NAME).app/Contents/MacOS
|
2011-07-17 10:07:42 +00:00
|
|
|
rsync -a --exclude "*.in" $(srcdir)/macbuild/Contents $(DIST)/$(APP_NAME).app --exclude English.lproj
|
2008-04-18 13:41:49 +00:00
|
|
|
mkdir -p $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj
|
2011-07-17 10:07:42 +00:00
|
|
|
rsync -a --exclude "*.in" $(srcdir)/macbuild/Contents/Resources/English.lproj/ $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj
|
2008-04-18 13:41:49 +00:00
|
|
|
sed -e "s/%APP_VERSION%/$(APP_VERSION)/" -e "s/%APP_NAME%/$(APP_NAME)/" -e "s/%APP_BINARY%/$(APP_BINARY)/" $(srcdir)/macbuild/Contents/Info.plist.in > $(DIST)/$(APP_NAME).app/Contents/Info.plist
|
|
|
|
sed -e "s/%APP_VERSION%/$(APP_VERSION)/" -e "s/%APP_NAME%/$(APP_NAME)/" $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj/InfoPlist.strings
|
|
|
|
rsync -a $(DIST)/bin/ $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)
|
|
|
|
$(RM) $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)/mangle $(DIST)/$(APP_NAME).app/Contents/$(APPFILES)/shlibsign
|
2010-04-06 12:48:34 +00:00
|
|
|
ifdef LIBXUL_SDK
|
2008-04-18 13:41:49 +00:00
|
|
|
cp $(LIBXUL_DIST)/bin/xulrunner$(BIN_SUFFIX) $(DIST)/$(APP_NAME).app/Contents/MacOS/$(APP_BINARY)
|
|
|
|
rsync -a --exclude nsinstall --copy-unsafe-links $(LIBXUL_DIST)/XUL.framework $(DIST)/$(APP_NAME).app/Contents/Frameworks
|
|
|
|
else
|
2010-04-06 12:48:34 +00:00
|
|
|
rm -f $(DIST)/$(APP_NAME).app/Contents/MacOS/$(PROGRAM)
|
|
|
|
rsync -aL $(PROGRAM) $(DIST)/$(APP_NAME).app/Contents/MacOS
|
|
|
|
endif
|
|
|
|
printf "APPLMOZB" > $(DIST)/$(APP_NAME).app/Contents/PkgInfo
|
2008-04-18 13:41:49 +00:00
|
|
|
|
2010-04-06 12:48:34 +00:00
|
|
|
else # MOZ_WIDGET_TOOLKIT != cocoa
|
2010-01-29 16:15:37 +00:00
|
|
|
|
2008-04-18 13:41:49 +00:00
|
|
|
libs::
|
2010-01-29 16:15:37 +00:00
|
|
|
ifdef LIBXUL_SDK
|
2008-04-18 13:41:49 +00:00
|
|
|
cp $(LIBXUL_DIST)/bin/xulrunner-stub$(BIN_SUFFIX) $(DIST)/bin/$(APP_BINARY)
|
2010-01-29 16:15:37 +00:00
|
|
|
endif
|
2009-08-16 22:20:45 +00:00
|
|
|
ifndef SKIP_COPY_XULRUNNER
|
2010-01-29 16:15:37 +00:00
|
|
|
ifdef LIBXUL_SDK
|
2008-04-18 13:41:49 +00:00
|
|
|
$(NSINSTALL) -D $(DIST)/bin/xulrunner
|
|
|
|
(cd $(LIBXUL_SDK)/bin && tar $(TAR_CREATE_FLAGS) - .) | (cd $(DIST)/bin/xulrunner && tar -xf -)
|
2010-01-29 16:15:37 +00:00
|
|
|
endif
|
2009-08-16 22:20:45 +00:00
|
|
|
endif # SKIP_COPY_XULRUNNER
|
2008-04-18 13:41:49 +00:00
|
|
|
|
2009-01-23 21:29:27 +00:00
|
|
|
$(NSINSTALL) -D $(DIST)/bin/chrome/icons/default
|
|
|
|
|
2011-04-14 17:54:59 +00:00
|
|
|
ifeq ($(OS_ARCH),WINNT)
|
2009-01-23 21:29:27 +00:00
|
|
|
cp $(srcdir)/$(APP_ICON).ico $(DIST)/bin/chrome/icons/default/$(APP_ICON).ico
|
2009-06-17 16:39:26 +00:00
|
|
|
cp $(srcdir)/$(APP_SPLASH).bmp $(DIST)/bin/$(APP_SPLASH).bmp
|
2010-03-04 05:46:36 +00:00
|
|
|
$(REDIT_PATH)/redit$(HOST_BIN_SUFFIX) $(DIST)/bin/$(APP_BINARY) $(srcdir)/$(APP_ICON).ico
|
2009-01-23 21:29:27 +00:00
|
|
|
endif
|
|
|
|
|
2008-04-18 13:41:49 +00:00
|
|
|
endif
|