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-10-01 14:21:21 -07:00
|
|
|
AlertNotification.java \
|
2010-06-02 14:55:28 -07:00
|
|
|
$(NULL)
|
|
|
|
|
2010-06-14 19:17:37 -07:00
|
|
|
PROCESSEDJAVAFILES = \
|
|
|
|
App.java \
|
|
|
|
Restarter.java \
|
|
|
|
NotificationHandler.java \
|
|
|
|
$(NULL)
|
|
|
|
|
2010-09-27 18:08:55 -07:00
|
|
|
|
|
|
|
ifneq (,$(findstring -march=armv7,$(OS_CFLAGS)))
|
|
|
|
MIN_CPU_VERSION=7
|
|
|
|
else
|
|
|
|
MIN_CPU_VERSION=5
|
|
|
|
endif
|
|
|
|
|
2010-06-02 14:55:28 -07:00
|
|
|
DEFINES += \
|
|
|
|
-DMOZ_APP_DISPLAYNAME=$(MOZ_APP_DISPLAYNAME) \
|
2010-06-25 13:12:03 -07:00
|
|
|
-DMOZ_APP_NAME=$(MOZ_APP_NAME) \
|
2010-08-30 08:52:28 -07:00
|
|
|
-DMOZ_APP_VERSION=$(MOZ_APP_VERSION) \
|
2010-09-27 18:08:55 -07:00
|
|
|
-DMOZ_CHILD_PROCESS_NAME=$(MOZ_CHILD_PROCESS_NAME) \
|
|
|
|
-DMOZ_MIN_CPU_VERSION=$(MIN_CPU_VERSION) \
|
2010-10-15 20:18:07 -07:00
|
|
|
-DMOZ_CRASHREPORTER=$(MOZ_CRASHREPORTER) \
|
2010-09-27 18:08:55 -07:00
|
|
|
$(NULL)
|
2010-06-02 14:55:28 -07:00
|
|
|
|
|
|
|
GARBAGE += \
|
|
|
|
AndroidManifest.xml \
|
|
|
|
classes.dex \
|
2010-06-14 19:17:37 -07:00
|
|
|
$(PROCESSEDJAVAFILES) \
|
2010-06-02 14:55:28 -07:00
|
|
|
gecko.ap_ \
|
2010-09-28 11:59:22 -07:00
|
|
|
res/values/strings.xml \
|
|
|
|
R.java \
|
2010-06-02 14:55:28 -07:00
|
|
|
$(NULL)
|
|
|
|
|
2010-10-15 20:18:07 -07:00
|
|
|
GARBAGE_DIRS += classes res
|
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
|
2010-06-14 19:17:37 -07:00
|
|
|
ICON_PATH_HDPI = $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/content/fennec_72x72.png
|
2010-06-02 14:55:28 -07:00
|
|
|
else
|
|
|
|
ICON_PATH = $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/content/icon48.png
|
2010-06-14 19:17:37 -07:00
|
|
|
ICON_PATH_HDPI = $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/content/icon64.png
|
2010-06-02 14:55:28 -07:00
|
|
|
endif
|
|
|
|
|
2010-10-01 14:21:21 -07:00
|
|
|
RES_LAYOUT = \
|
|
|
|
res/layout/notification_progress.xml \
|
2010-10-15 20:18:07 -07:00
|
|
|
res/layout/notification_progress_text.xml \
|
2010-06-14 19:17:37 -07:00
|
|
|
$(NULL)
|
|
|
|
|
2010-06-21 14:26:55 -07:00
|
|
|
JAVA_CLASSPATH = $(ANDROID_SDK)/android.jar
|
|
|
|
|
2010-09-28 11:59:22 -07:00
|
|
|
DEFAULT_BRANDPATH = $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales/en-US/brand.dtd
|
|
|
|
DEFAULT_STRINGSPATH = android_strings.dtd
|
|
|
|
|
2010-10-15 20:18:07 -07:00
|
|
|
ifdef MOZ_CRASHREPORTER
|
|
|
|
PROCESSEDJAVAFILES += CrashReporter.java
|
|
|
|
MOZ_ANDROID_DRAWABLES += embedding/android/resources/drawable/crash_reporter.png
|
|
|
|
RES_LAYOUT += res/layout/crash_reporter.xml
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
# 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
|
2010-06-14 19:17:37 -07:00
|
|
|
classes.dex: $(JAVAFILES) $(PROCESSEDJAVAFILES) R.java
|
2010-06-02 14:55:28 -07:00
|
|
|
$(NSINSTALL) -D classes
|
2010-06-14 19:17:37 -07:00
|
|
|
$(JAVAC) $(JAVAC_FLAGS) -d classes $(addprefix $(srcdir)/,$(JAVAFILES)) $(PROCESSEDJAVAFILES) R.java
|
2010-06-02 14:55:28 -07:00
|
|
|
$(DX) --dex --output=$@ classes
|
|
|
|
|
2010-10-26 08:08:04 -07:00
|
|
|
AndroidManifest.xml $(PROCESSEDJAVAFILES): % : %.in
|
2010-06-02 14:55:28 -07:00
|
|
|
$(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
|
2010-06-14 19:17:37 -07:00
|
|
|
cp $(ICON_PATH_HDPI) $@
|
|
|
|
|
2010-10-01 14:21:21 -07:00
|
|
|
RES_DRAWABLE = $(addprefix res/drawable/,$(notdir $(MOZ_ANDROID_DRAWABLES)))
|
|
|
|
|
|
|
|
$(RES_DRAWABLE): $(addprefix $(topsrcdir)/,$(MOZ_ANDROID_DRAWABLES))
|
2010-06-14 19:17:37 -07:00
|
|
|
$(NSINSTALL) -D res/drawable
|
2010-10-01 14:21:21 -07:00
|
|
|
$(NSINSTALL) $^ res/drawable/
|
2010-06-14 19:17:37 -07:00
|
|
|
|
2010-10-01 14:21:21 -07:00
|
|
|
$(RES_LAYOUT): $(subst res/,$(srcdir)/resources/,$(RES_LAYOUT))
|
|
|
|
$(NSINSTALL) -D res/layout
|
|
|
|
$(NSINSTALL) $(srcdir)/resources/layout/* res/layout/
|
2010-06-14 19:17:37 -07:00
|
|
|
|
2010-10-01 14:21:21 -07:00
|
|
|
R.java: $(MOZ_APP_ICON) $(RES_LAYOUT) $(RES_DRAWABLE) res/values/strings.xml $(LOCALIZED_STRINGS_XML) AndroidManifest.xml
|
2010-06-14 19:17:37 -07:00
|
|
|
$(AAPT) package -f -M AndroidManifest.xml -I $(ANDROID_SDK)/android.jar -S res -J . --custom-package org.mozilla.gecko
|
2010-06-02 14:55:28 -07:00
|
|
|
|
2010-10-01 14:21:21 -07:00
|
|
|
gecko.ap_: AndroidManifest.xml res/drawable/icon.png res/drawable-hdpi/icon.png $(RES_LAYOUT) $(RES_DRAWABLE) res/values/strings.xml $(LOCALIZED_STRINGS_XML)
|
2010-06-02 14:55:28 -07:00
|
|
|
$(AAPT) package -f -M AndroidManifest.xml -I $(ANDROID_SDK)/android.jar -S res -F $@
|
|
|
|
|
2010-09-28 11:59:22 -07:00
|
|
|
res/values/strings.xml: FORCE
|
|
|
|
mkdir -p res/values
|
|
|
|
$(PYTHON) $(topsrcdir)/config/Preprocessor.py $(DEFINES) \
|
|
|
|
-DBRANDPATH="$(DEFAULT_BRANDPATH)" \
|
|
|
|
-DSTRINGSPATH="$(DEFAULT_STRINGSPATH)" \
|
|
|
|
$(srcdir)/strings.xml.in \
|
|
|
|
> $@
|
2010-10-12 12:30:41 -07:00
|
|
|
|
|
|
|
libs:: gecko.ap_ classes.dex
|
|
|
|
$(INSTALL) classes.dex $(FINAL_TARGET)
|
|
|
|
$(UNZIP) -o gecko.ap_ -d $(FINAL_TARGET)
|