mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-01 06:35:42 +00:00
177 lines
5.6 KiB
Makefile
177 lines
5.6 KiB
Makefile
# ***** 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
|
|
|
|
DIRS = profile/extensions
|
|
dist_dest = $(DIST)/$(APP_NAME).app
|
|
|
|
PREF_JS_EXPORTS = $(srcdir)/mobile.js
|
|
DIST_FILES = recommended-addons.json
|
|
|
|
ifndef LIBXUL_SDK
|
|
ifneq (Android,$(OS_TARGET))
|
|
PROGRAM=$(MOZ_APP_NAME)$(BIN_SUFFIX)
|
|
|
|
LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
|
|
LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/base
|
|
LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/build
|
|
LOCAL_INCLUDES += -I$(DEPTH)/build
|
|
|
|
DEFINES += -DXPCOM_GLUE
|
|
STL_FLAGS=
|
|
|
|
LIBS += \
|
|
$(EXTRA_DSO_LIBS) \
|
|
$(XPCOM_STANDALONE_GLUE_LDOPTS) \
|
|
$(NULL)
|
|
|
|
ifeq ($(MOZ_PLATFORM_MAEMO),6)
|
|
LIBS += \
|
|
$(LIBXUL_DIST)/../widget/qt/faststartupqt/$(LIB_PREFIX)faststartupqt.$(LIB_SUFFIX) \
|
|
$(MOZ_QT_LIBS) \
|
|
$(NULL)
|
|
LOCAL_INCLUDES += -I$(topsrcdir)/widget/qt/faststartupqt $(TK_CFLAGS)
|
|
endif
|
|
|
|
ifeq ($(OS_ARCH),WINNT)
|
|
OS_LIBS += $(call EXPAND_LIBNAME,version)
|
|
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
|
|
endif #LIBXUL_SDK
|
|
|
|
# Make sure the standalone glue doesn't try to get libxpcom.so from mobile/app.
|
|
NSDISTMODE = copy
|
|
|
|
include $(topsrcdir)/config/rules.mk
|
|
|
|
APP_ICON = mobile
|
|
|
|
DEFINES += \
|
|
-DAPP_NAME=$(MOZ_APP_NAME) \
|
|
-DAPP_VERSION=$(MOZ_APP_VERSION) \
|
|
-DMOZ_UPDATER=$(MOZ_UPDATER) \
|
|
$(NULL)
|
|
|
|
ifeq ($(OS_ARCH),WINNT)
|
|
REDIT_PATH = $(LIBXUL_DIST)/bin
|
|
endif
|
|
|
|
APP_BINARY = $(MOZ_APP_NAME)$(BIN_SUFFIX)
|
|
|
|
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) #{
|
|
|
|
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) -r $(dist_dest)
|
|
|
|
ifdef LIBXUL_SDK
|
|
APPFILES = Resources
|
|
else
|
|
APPFILES = MacOS
|
|
endif
|
|
|
|
libs-preqs = \
|
|
$(call mkdir_deps,$(dist_dest)/Contents/MacOS) \
|
|
$(call mkdir_deps,$(dist_dest)/Contents/Resources/$(AB).lproj) \
|
|
$(NULL)
|
|
|
|
.PHONY: repackage
|
|
libs repackage:: $(libs-preqs)
|
|
rsync -a --exclude "*.in" $(srcdir)/macbuild/Contents $(dist_dest) --exclude English.lproj
|
|
rsync -a --exclude "*.in" $(srcdir)/macbuild/Contents/Resources/English.lproj/ $(dist_dest)/Contents/Resources/$(AB).lproj
|
|
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_dest)/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_dest)/Contents/Resources/$(AB).lproj/InfoPlist.strings
|
|
rsync -a $(DIST)/bin/ $(dist_dest)/Contents/$(APPFILES)
|
|
$(RM) $(dist_dest)/Contents/$(APPFILES)/mangle $(dist_dest)/Contents/$(APPFILES)/shlibsign
|
|
ifdef LIBXUL_SDK
|
|
cp $(LIBXUL_DIST)/bin/xulrunner$(BIN_SUFFIX) $(dist_dest)/Contents/MacOS/$(APP_BINARY)
|
|
rsync -a --exclude nsinstall --copy-unsafe-links $(LIBXUL_DIST)/XUL.framework $(dist_dest)/Contents/Frameworks
|
|
else
|
|
$(RM) $(dist_dest)/Contents/MacOS/$(PROGRAM)
|
|
rsync -aL $(PROGRAM) $(dist_dest)/Contents/MacOS
|
|
endif
|
|
printf "APPLMOZB" > $(dist_dest)/Contents/PkgInfo
|
|
|
|
else # MOZ_WIDGET_TOOLKIT != cocoa
|
|
|
|
libs::
|
|
ifdef LIBXUL_SDK
|
|
cp $(LIBXUL_DIST)/bin/xulrunner-stub$(BIN_SUFFIX) $(DIST)/bin/$(APP_BINARY)
|
|
endif
|
|
ifndef SKIP_COPY_XULRUNNER #{
|
|
ifdef LIBXUL_SDK
|
|
$(NSINSTALL) -D $(DIST)/bin/xulrunner
|
|
(cd $(LIBXUL_SDK)/bin && tar $(TAR_CREATE_FLAGS) - .) | (cd $(DIST)/bin/xulrunner && tar -xf -)
|
|
endif
|
|
endif #} SKIP_COPY_XULRUNNER
|
|
|
|
ifeq ($(MOZ_PLATFORM_MAEMO),6)
|
|
$(NSINSTALL) -D $(DIST)/bin/res/drawable
|
|
cp $(topsrcdir)/mobile/app/maemo/* $(DIST)/bin/res/drawable/
|
|
cp $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/content/favicon32.png $(DIST)/bin/res/drawable/
|
|
endif
|
|
$(NSINSTALL) -D $(DIST)/bin/chrome/icons/default
|
|
|
|
ifeq ($(OS_ARCH),WINNT)
|
|
cp $(srcdir)/$(APP_ICON).ico $(DIST)/bin/chrome/icons/default/$(APP_ICON).ico
|
|
$(REDIT_PATH)/redit$(HOST_BIN_SUFFIX) $(DIST)/bin/$(APP_BINARY) $(srcdir)/$(APP_ICON).ico
|
|
endif
|
|
|
|
endif #}
|