2010-06-02 14:55:28 -07: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 the Mozilla browser.
|
|
|
|
#
|
|
|
|
# The Initial Developer of the Original Code is
|
|
|
|
# Mozilla Foundation
|
|
|
|
# Portions created by the Initial Developer are Copyright (C) 2009-2010
|
|
|
|
# the Initial Developer. All Rights Reserved.
|
|
|
|
#
|
|
|
|
# Contributor(s):
|
|
|
|
# Vladimir Vukicevic <vladimir@pobox.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-06-25 13:12:03 -07:00
|
|
|
include $(topsrcdir)/ipc/app/defs.mk
|
2010-06-02 14:55:28 -07:00
|
|
|
|
|
|
|
JAVAFILES = \
|
|
|
|
GeckoApp.java \
|
|
|
|
GeckoAppShell.java \
|
|
|
|
GeckoEvent.java \
|
|
|
|
GeckoSurfaceView.java \
|
2010-06-29 21:13:44 -07:00
|
|
|
GeckoInputConnection.java \
|
2010-06-02 14:55:28 -07:00
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
DEFINES += \
|
|
|
|
-DMOZ_APP_DISPLAYNAME=$(MOZ_APP_DISPLAYNAME) \
|
2010-06-25 13:12:03 -07:00
|
|
|
-DMOZ_APP_NAME=$(MOZ_APP_NAME) \
|
2010-08-17 14:22:00 -07:00
|
|
|
-DMOZ_APP_VERSION=$(MOZ_APP_VERSION) \
|
2010-06-25 13:12:03 -07:00
|
|
|
-DMOZ_CHILD_PROCESS_NAME=$(MOZ_CHILD_PROCESS_NAME)
|
2010-06-02 14:55:28 -07:00
|
|
|
|
|
|
|
GARBAGE += \
|
|
|
|
AndroidManifest.xml \
|
|
|
|
classes.dex \
|
|
|
|
$(MOZ_APP_NAME).apk \
|
|
|
|
App.java \
|
|
|
|
Restarter.java \
|
|
|
|
gecko.ap_ \
|
|
|
|
gecko-unaligned.apk \
|
|
|
|
gecko-unsigned-unaligned.apk \
|
|
|
|
$(NULL)
|
|
|
|
|
|
|
|
GARBAGE_DIRS += res libs dist classes
|
|
|
|
|
2010-07-16 08:52:01 -07:00
|
|
|
DIRS = utils
|
|
|
|
|
2010-06-02 14:55:28 -07:00
|
|
|
# Bug 567884 - Need a way to find appropriate icons during packaging
|
|
|
|
ifeq ($(MOZ_APP_NAME),fennec)
|
|
|
|
ICON_PATH = $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/content/fennec_48x48.png
|
|
|
|
ICON_PATH_HI = $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/content/fennec_72x72.png
|
|
|
|
else
|
|
|
|
ICON_PATH = $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/content/icon48.png
|
|
|
|
ICON_PATH_HI = $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/content/icon64.png
|
|
|
|
endif
|
|
|
|
|
2010-07-16 08:52:01 -07:00
|
|
|
NATIVE_LIBS = $(shell cat $(DIST)/bin/dependentlibs.list) libxpcom.so libnssckbi.so libfreebl3.so libmozutils.so
|
2010-06-02 14:55:28 -07:00
|
|
|
FULL_LIBS = $(addprefix libs/armeabi/,$(NATIVE_LIBS))
|
|
|
|
|
|
|
|
# We'll strip all the libs by default, due to size, but we might
|
|
|
|
# want to have a non-stripped version for debugging. We should
|
|
|
|
# really pull out debuginfo and stuff.
|
|
|
|
ifdef NO_STRIP
|
|
|
|
DO_STRIP=echo not stripping
|
|
|
|
else
|
|
|
|
DO_STRIP=$(STRIP)
|
|
|
|
endif
|
|
|
|
|
|
|
|
# The set of files/directories from the dist/bin dir that we'll make available in the apk
|
|
|
|
# some directories not listed due to special handling
|
|
|
|
DIST_LINK_FILES = \
|
|
|
|
modules \
|
|
|
|
res \
|
|
|
|
application.ini \
|
|
|
|
platform.ini \
|
|
|
|
greprefs.js \
|
|
|
|
browserconfig.properties \
|
|
|
|
blocklist.xml \
|
2010-08-09 17:57:47 -07:00
|
|
|
chrome.manifest \
|
2010-06-02 14:55:28 -07:00
|
|
|
$(NULL)
|
|
|
|
|
2010-06-25 13:12:03 -07:00
|
|
|
ifdef MOZ_IPC
|
|
|
|
DIST_LINK_FILES += $(MOZ_CHILD_PROCESS_NAME)
|
|
|
|
endif
|
|
|
|
|
2010-06-21 14:26:55 -07:00
|
|
|
JAVA_CLASSPATH = $(ANDROID_SDK)/android.jar
|
|
|
|
|
2010-06-02 14:55:28 -07:00
|
|
|
include $(topsrcdir)/config/rules.mk
|
|
|
|
|
2010-06-21 14:26:55 -07:00
|
|
|
# Override the Java settings with some specific android settings
|
|
|
|
include $(topsrcdir)/config/android-common.mk
|
2010-06-02 14:55:28 -07:00
|
|
|
|
|
|
|
tools:: $(MOZ_APP_NAME).apk
|
|
|
|
|
|
|
|
# Note that we're going to set up a dependency directly between embed_android.dex and the java files
|
|
|
|
# Instead of on the .class files, since more than one .class file might be produced per .java file
|
|
|
|
classes.dex: $(JAVAFILES) App.java Restarter.java
|
|
|
|
$(NSINSTALL) -D classes
|
|
|
|
$(JAVAC) $(JAVAC_FLAGS) -d classes $(addprefix $(srcdir)/,$(JAVAFILES)) App.java Restarter.java
|
|
|
|
$(DX) --dex --output=$@ classes
|
|
|
|
|
|
|
|
AndroidManifest.xml App.java Restarter.java : % : %.in
|
|
|
|
$(PYTHON) $(topsrcdir)/config/Preprocessor.py \
|
|
|
|
$(AUTOMATION_PPARGS) $(DEFINES) $(ACDEFINES) $< > $@
|
|
|
|
|
|
|
|
res/drawable/icon.png: $(MOZ_APP_ICON)
|
|
|
|
$(NSINSTALL) -D res/drawable
|
|
|
|
cp $(ICON_PATH) $@
|
|
|
|
|
|
|
|
res/drawable-hdpi/icon.png: $(MOZ_APP_ICON)
|
|
|
|
$(NSINSTALL) -D res/drawable-hdpi
|
|
|
|
cp $(ICON_PATH_HI) $@
|
|
|
|
|
|
|
|
gecko.ap_: AndroidManifest.xml res/drawable/icon.png res/drawable-hdpi/icon.png
|
|
|
|
$(AAPT) package -f -M AndroidManifest.xml -I $(ANDROID_SDK)/android.jar -S res -F $@
|
|
|
|
|
|
|
|
libs/armeabi/%: $(DIST)/lib/%
|
|
|
|
@$(NSINSTALL) -D libs/armeabi
|
|
|
|
@cp -L -v $< $@
|
|
|
|
@$(DO_STRIP) $@
|
|
|
|
|
|
|
|
# Bug 567873 - Android packaging should use standard packaging code
|
|
|
|
dist: FORCE
|
|
|
|
$(NSINSTALL) -D dist/components
|
2010-07-16 08:52:01 -07:00
|
|
|
rm -rf dist/components/*
|
|
|
|
@(for f in $(DIST)/bin/components/* ; do $(NSINSTALL) $$f dist/components ; done)
|
2010-06-02 14:55:28 -07:00
|
|
|
$(NSINSTALL) -D dist/chrome
|
2010-07-16 08:52:01 -07:00
|
|
|
rm -rf dist/chrome/*
|
|
|
|
@(for f in $(DIST)/bin/chrome/* ; do $(NSINSTALL) $$f dist/chrome ; done)
|
2010-06-02 14:55:28 -07:00
|
|
|
$(NSINSTALL) -D dist/defaults
|
2010-07-16 08:52:01 -07:00
|
|
|
rm -rf dist/defaults/*
|
|
|
|
@(for f in $(DIST)/bin/defaults/* ; do $(NSINSTALL) $$f dist/defaults ; done )
|
2010-06-02 14:55:28 -07:00
|
|
|
@(for f in $(DIST_LINK_FILES) ; do if [ -e $(DIST)/bin/$$f ] ; then echo $$f ; ln -sf ../$(DIST)/bin/$$f dist ; fi ; done)
|
|
|
|
|
|
|
|
gecko-unsigned-unaligned.apk: gecko.ap_ classes.dex dist $(FULL_LIBS)
|
|
|
|
$(APKBUILDER) $@ -v $(APKBUILDER_FLAGS) -z gecko.ap_ -f classes.dex -nf `pwd`/libs -rf dist
|
|
|
|
|
|
|
|
gecko-unaligned.apk: gecko-unsigned-unaligned.apk
|
|
|
|
cp gecko-unsigned-unaligned.apk $@
|
|
|
|
ifdef JARSIGNER
|
|
|
|
$(JARSIGNER) $@
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(MOZ_APP_NAME).apk: gecko-unaligned.apk
|
|
|
|
$(ZIPALIGN) -f -v 4 gecko-unaligned.apk $@
|
|
|
|
|