blob: 5c2668c17b0667e4cb353348ca5a8398bfae0e78 [file] [log] [blame]
The Android Open Source Project88b60792009-03-03 19:28:42 -08001# Selects a Java compiler.
2#
3# Inputs:
Primiano Tucci994c84f2014-06-02 17:37:38 +01004# CUSTOM_JAVA_COMPILER -- "eclipse", "openjdk". or nothing for the system
The Android Open Source Project88b60792009-03-03 19:28:42 -08005# default
Brian Carlstromb6dcef82014-01-09 15:33:06 -08006# ALTERNATE_JAVAC -- the alternate java compiler to use
The Android Open Source Project88b60792009-03-03 19:28:42 -08007#
8# Outputs:
9# COMMON_JAVAC -- Java compiler command with common arguments
Ying Wangad690992013-09-20 17:11:43 -070010#
11
Colin Cross79e2f732016-12-21 14:29:13 -080012ifndef ANDROID_COMPILE_WITH_JACK
13# Defines if compilation with jack is enabled by default.
14ANDROID_COMPILE_WITH_JACK := true
15endif
16
Neil Fuller2428bfe2016-01-15 19:41:26 -080017common_jdk_flags := -Xmaxerrs 9999999
Ying Wangad690992013-09-20 17:11:43 -070018
Brian Carlstromb6dcef82014-01-09 15:33:06 -080019# Use the indexer wrapper to index the codebase instead of the javac compiler
20ifeq ($(ALTERNATE_JAVAC),)
21JAVACC := javac
22else
23JAVACC := $(ALTERNATE_JAVAC)
24endif
The Android Open Source Project88b60792009-03-03 19:28:42 -080025
Colin Cross0851df82017-06-30 13:55:38 -070026JAVA := java
27JAVADOC := javadoc
28JAR := jar
29
Primiano Tucci994c84f2014-06-02 17:37:38 +010030# The actual compiler can be wrapped by setting the JAVAC_WRAPPER var.
31ifdef JAVAC_WRAPPER
32 ifneq ($(JAVAC_WRAPPER),$(firstword $(JAVACC)))
33 JAVACC := $(JAVAC_WRAPPER) $(JAVACC)
34 endif
35endif
36
The Android Open Source Project88b60792009-03-03 19:28:42 -080037# Whatever compiler is on this system.
Colin Cross0e785c72017-03-22 20:41:14 -070038COMMON_JAVAC := $(JAVACC) -J-Xmx2048M $(common_jdk_flags)
The Android Open Source Project88b60792009-03-03 19:28:42 -080039
40# Eclipse.
41ifeq ($(CUSTOM_JAVA_COMPILER), eclipse)
42 COMMON_JAVAC := java -Xmx256m -jar prebuilt/common/ecj/ecj.jar -5 \
43 -maxProblems 9999999 -nowarn
44 $(info CUSTOM_JAVA_COMPILER=eclipse)
45endif
46
Ying Wang447d6962015-09-01 19:12:05 -070047GLOBAL_JAVAC_DEBUG_FLAGS := -g
48
The Android Open Source Project88b60792009-03-03 19:28:42 -080049HOST_JAVAC ?= $(COMMON_JAVAC)
50TARGET_JAVAC ?= $(COMMON_JAVAC)
Brian Carlstromb6dcef82014-01-09 15:33:06 -080051
The Android Open Source Project88b60792009-03-03 19:28:42 -080052#$(info HOST_JAVAC=$(HOST_JAVAC))
53#$(info TARGET_JAVAC=$(TARGET_JAVAC))