mobile/android/base/Makefile.in
author Nick Alexander <nalexander@mozilla.com>
Tue, 06 Mar 2018 20:09:37 -0800
changeset 417219 f0a4cabc8c940923aef39a2be39c10056eef891e
parent 417218 731eb2e4b5579cc727068d346a32a67d79ec6756
child 417493 fe5d46cd794bfb3e8974d8213cb3fa752902ef3b
permissions -rw-r--r--
Bug 1444546 - Part 4: Use GENERATED_FILES for Android JNI wrapper generation. r=froydnj,jchen MozReview-Commit-ID: 1IjoQdEMqr8

# 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/.

# Developer builds call mach -> Make -> gradle -> mach, which races to
# find and create .mozconfig files and to generate targets.
.NOTPARALLEL:

generated_resources := \
  AndroidManifest.xml \
  res/raw/browsersearch.json \
  res/raw/suggestedsites.json \
  res/values/strings.xml \
  $(NULL)

generated_files := \
  AndroidManifest.xml \
  generated/preprocessed/org/mozilla/gecko/AdjustConstants.java \
  generated/preprocessed/org/mozilla/gecko/AppConstants.java \
  generated/preprocessed/org/mozilla/gecko/MmaConstants.java \
  $(NULL)

include $(topsrcdir)/config/AB_rCD.mk

chrome-%:: AB_CD=$*
chrome-%::
	$(MAKE) \
	  res/values$(AB_rCD)/strings.xml \
	  res/raw$(AB_rCD)/suggestedsites.json \
	  res/raw$(AB_rCD)/browsersearch.json \
	  AB_CD=$*

include $(topsrcdir)/config/rules.mk

# Override the Java settings with some specific android settings
include $(topsrcdir)/config/android-common.mk

# This target is only used by IDE integrations. It rebuilds resources
# that end up in omni.ja using the equivalent of |mach build faster|,
# does most of the packaging step, and then updates omni.ja in
# place. If you're not using an IDE, you should be using |mach build
# mobile/android && mach package|.
$(ABS_DIST)/fennec/$(OMNIJAR_NAME): FORCE
	$(REPORT_BUILD)
	$(MAKE) -C ../../../faster
	$(MAKE) -C ../installer stage-package
	$(MKDIR) -p $(@D)
	rsync --update $(DIST)/fennec/$(notdir $(OMNIJAR_NAME)) $@
	$(RM) $(DIST)/fennec/$(notdir $(OMNIJAR_NAME))

ifndef MOZILLA_OFFICIAL
# Targets built very early during a Gradle build.  In automation,
# these are built before Gradle is invoked, and gradle-targets is not
# made at all.  This is required to avoid building gradle-targets with
# AB_CD=multi during multi-l10n builds.
gradle-targets: $(generated_resources) $(generated_files)

# Local developers update omni.ja during their builds.  There's a
# chicken-and-egg problem here.
gradle-omnijar: $(abspath $(DIST)/fennec/$(OMNIJAR_NAME))
else
# In automation, omni.ja is built only during packaging.
gradle-omnijar:

gradle-targets:
endif

.PHONY: gradle-targets gradle-omnijar

export:: android_apks