2012-05-21 04:12:37 -07:00
|
|
|
# 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/.
|
2011-12-06 15:52:26 -08:00
|
|
|
|
2013-02-15 14:00:12 -08:00
|
|
|
USE_RCS_MK := 1
|
|
|
|
include $(topsrcdir)/config/makefiles/rcs.mk
|
2011-12-06 15:52:26 -08:00
|
|
|
|
|
|
|
PREF_JS_EXPORTS = $(srcdir)/b2g.js
|
|
|
|
|
|
|
|
ifndef LIBXUL_SDK
|
|
|
|
|
2012-11-28 10:43:19 -08:00
|
|
|
ifeq (gonk,$(MOZ_WIDGET_TOOLKIT))
|
|
|
|
LIBS += \
|
|
|
|
-lui \
|
2013-05-07 20:58:22 -07:00
|
|
|
-lEGL \
|
2012-11-28 10:43:19 -08:00
|
|
|
-lhardware_legacy \
|
|
|
|
-lhardware \
|
|
|
|
-lcutils \
|
|
|
|
$(DEPTH)/media/libpng/$(LIB_PREFIX)mozpng.$(LIB_SUFFIX) \
|
2013-05-07 20:58:22 -07:00
|
|
|
$(DEPTH)/widget/gonk/libdisplay/$(LIB_PREFIX)display.$(LIB_SUFFIX) \
|
2012-11-28 10:43:19 -08:00
|
|
|
$(MOZ_ZLIB_LIBS) \
|
|
|
|
$(NULL)
|
2014-01-08 21:59:31 -08:00
|
|
|
ifeq ($(ANDROID_VERSION),$(findstring $(ANDROID_VERSION),17 18 19))
|
2013-05-07 20:58:22 -07:00
|
|
|
LIBS += \
|
|
|
|
-lgui \
|
|
|
|
-lsuspend \
|
|
|
|
$(NULL)
|
|
|
|
endif
|
2012-11-28 10:43:19 -08:00
|
|
|
OS_LDFLAGS += -Wl,--export-dynamic
|
2013-05-07 20:58:22 -07:00
|
|
|
LOCAL_INCLUDES += -I$(topsrcdir)/widget/gonk/libdisplay
|
2012-11-28 10:43:19 -08:00
|
|
|
endif
|
|
|
|
|
2011-12-06 15:52:26 -08:00
|
|
|
LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
|
|
|
|
LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/base
|
|
|
|
LOCAL_INCLUDES += -I$(topsrcdir)/xpcom/build
|
|
|
|
LOCAL_INCLUDES += -I$(DEPTH)/build
|
|
|
|
|
|
|
|
STL_FLAGS=
|
|
|
|
|
|
|
|
LIBS += $(JEMALLOC_LIBS)
|
|
|
|
|
|
|
|
LIBS += \
|
|
|
|
$(XPCOM_STANDALONE_GLUE_LDOPTS) \
|
|
|
|
$(NULL)
|
|
|
|
|
2013-03-08 11:43:32 -08:00
|
|
|
ifeq (gonk,$(MOZ_WIDGET_TOOLKIT))
|
|
|
|
LIBS += \
|
|
|
|
-lbinder \
|
|
|
|
-lutils \
|
|
|
|
$(NULL)
|
|
|
|
endif
|
|
|
|
|
2011-12-06 15:52:26 -08:00
|
|
|
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 #LIBXUL_SDK
|
|
|
|
|
2013-09-18 07:57:08 -07:00
|
|
|
UA_UPDATE_FILE = ua-update.json
|
|
|
|
|
|
|
|
$(UA_UPDATE_FILE): % : %.in
|
|
|
|
# strip out comment lines, which are not valid in JSON
|
2013-12-02 13:34:21 -08:00
|
|
|
sed -e '/^ *\/\//d' -e '/^ *$$/d' $^ > $@
|
2013-09-18 07:57:08 -07:00
|
|
|
|
|
|
|
UA_UPDATE_FILES = $(UA_UPDATE_FILE)
|
|
|
|
UA_UPDATE_DEST = $(FINAL_TARGET)
|
|
|
|
INSTALL_TARGETS += UA_UPDATE
|
|
|
|
|
2011-12-06 15:52:26 -08:00
|
|
|
# Make sure the standalone glue doesn't try to get libxpcom.so from b2g/app.
|
|
|
|
NSDISTMODE = copy
|
|
|
|
|
|
|
|
include $(topsrcdir)/config/rules.mk
|
|
|
|
|
|
|
|
APP_ICON = b2g
|
|
|
|
|
2013-02-15 14:00:12 -08:00
|
|
|
source_repo ?= $(call getSourceRepo,$(srcdir)/..)
|
|
|
|
ifneq (,$(filter http%,$(source_repo)))
|
2013-12-02 13:34:21 -08:00
|
|
|
DEFINES += -DMOZ_SOURCE_REPO='$(source_repo)'
|
2011-12-06 15:52:26 -08:00
|
|
|
endif
|
|
|
|
|
|
|
|
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)))
|
|
|
|
|
2013-11-07 18:42:22 -08:00
|
|
|
clean clobber repackage::
|
2011-12-06 15:52:26 -08:00
|
|
|
rm -rf $(DIST)/$(APP_NAME).app
|
|
|
|
|
|
|
|
ifdef LIBXUL_SDK
|
|
|
|
APPFILES = Resources
|
|
|
|
else
|
|
|
|
APPFILES = MacOS
|
|
|
|
endif
|
|
|
|
|
2012-04-03 13:08:16 -07:00
|
|
|
libs-preqs = \
|
|
|
|
$(call mkdir_deps,$(DIST)/$(APP_NAME).app/Contents/MacOS) \
|
|
|
|
$(call mkdir_deps,$(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj) \
|
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
.PHONY: repackage
|
2013-11-07 18:42:22 -08:00
|
|
|
tools repackage:: $(libs-preqs)
|
2013-12-02 13:34:21 -08:00
|
|
|
rsync -a --exclude '*.in' $(srcdir)/macbuild/Contents $(DIST)/$(APP_NAME).app --exclude English.lproj
|
|
|
|
rsync -a --exclude '*.in' $(srcdir)/macbuild/Contents/Resources/English.lproj/ $(DIST)/$(APP_NAME).app/Contents/Resources/$(AB).lproj
|
|
|
|
sed -e 's/%MOZ_APP_VERSION%/$(MOZ_APP_VERSION)/' -e 's/%MOZ_APP_NAME%/$(MOZ_APP_NAME)/' -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
|
2013-11-07 18:42:22 -08:00
|
|
|
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
|
2011-12-06 15:52:26 -08:00
|
|
|
ifdef LIBXUL_SDK
|
|
|
|
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
|
2013-11-07 18:42:22 -08:00
|
|
|
else
|
|
|
|
$(RM) $(DIST)/$(APP_NAME).app/Contents/MacOS/$(PROGRAM)
|
|
|
|
rsync -aL $(PROGRAM) $(DIST)/$(APP_NAME).app/Contents/MacOS
|
2011-12-06 15:52:26 -08:00
|
|
|
endif
|
2013-05-30 15:56:34 -07:00
|
|
|
cp -RL $(srcdir)/b2g.icns $(DIST)/$(APP_NAME).app/Contents/Resources/$(MOZ_APP_NAME).icns
|
2013-12-02 13:34:21 -08:00
|
|
|
printf APPLMOZB > $(DIST)/$(APP_NAME).app/Contents/PkgInfo
|
2011-12-06 15:52:26 -08:00
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
$(NSINSTALL) -D $(DIST)/bin/chrome/icons/default
|
|
|
|
|
2013-05-06 05:51:25 -07:00
|
|
|
# Copy the app icon for b2g-desktop
|
2011-12-06 15:52:26 -08:00
|
|
|
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
|
2013-05-06 05:51:25 -07:00
|
|
|
cp $(srcdir)/$(APP_ICON).ico $(DIST)/bin/chrome/icons/default/default.ico
|
|
|
|
else ifneq (gonk,$(MOZ_WIDGET_TOOLKIT))
|
|
|
|
cp $(srcdir)/default.png $(DIST)/bin/chrome/icons/default/default.png
|
2011-12-06 15:52:26 -08:00
|
|
|
endif
|
|
|
|
|
|
|
|
endif
|