The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1 | # Selects a Java compiler. |
| 2 | # |
| 3 | # Inputs: |
Primiano Tucci | 994c84f | 2014-06-02 17:37:38 +0100 | [diff] [blame] | 4 | # CUSTOM_JAVA_COMPILER -- "eclipse", "openjdk". or nothing for the system |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 5 | # default |
Brian Carlstrom | b6dcef8 | 2014-01-09 15:33:06 -0800 | [diff] [blame] | 6 | # ALTERNATE_JAVAC -- the alternate java compiler to use |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 7 | # |
| 8 | # Outputs: |
| 9 | # COMMON_JAVAC -- Java compiler command with common arguments |
Ying Wang | ad69099 | 2013-09-20 17:11:43 -0700 | [diff] [blame] | 10 | # |
| 11 | |
Nick Reuter | c43ab6e | 2014-05-08 21:36:05 -0500 | [diff] [blame] | 12 | common_jdk_flags := -source 1.7 -target 1.7 -Xmaxerrs 9999999 |
Ying Wang | ad69099 | 2013-09-20 17:11:43 -0700 | [diff] [blame] | 13 | |
Brian Carlstrom | b6dcef8 | 2014-01-09 15:33:06 -0800 | [diff] [blame] | 14 | # Use the indexer wrapper to index the codebase instead of the javac compiler |
| 15 | ifeq ($(ALTERNATE_JAVAC),) |
| 16 | JAVACC := javac |
| 17 | else |
| 18 | JAVACC := $(ALTERNATE_JAVAC) |
| 19 | endif |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 20 | |
Primiano Tucci | 994c84f | 2014-06-02 17:37:38 +0100 | [diff] [blame] | 21 | # The actual compiler can be wrapped by setting the JAVAC_WRAPPER var. |
| 22 | ifdef JAVAC_WRAPPER |
| 23 | ifneq ($(JAVAC_WRAPPER),$(firstword $(JAVACC))) |
| 24 | JAVACC := $(JAVAC_WRAPPER) $(JAVACC) |
| 25 | endif |
| 26 | endif |
| 27 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 28 | # Whatever compiler is on this system. |
Dan Willemsen | 145ae32 | 2015-08-13 14:31:36 -0700 | [diff] [blame] | 29 | COMMON_JAVAC := $(JAVACC) -J-Xmx1024M $(common_jdk_flags) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 30 | |
| 31 | # Eclipse. |
| 32 | ifeq ($(CUSTOM_JAVA_COMPILER), eclipse) |
| 33 | COMMON_JAVAC := java -Xmx256m -jar prebuilt/common/ecj/ecj.jar -5 \ |
| 34 | -maxProblems 9999999 -nowarn |
| 35 | $(info CUSTOM_JAVA_COMPILER=eclipse) |
| 36 | endif |
| 37 | |
Ying Wang | 447d696 | 2015-09-01 19:12:05 -0700 | [diff] [blame^] | 38 | GLOBAL_JAVAC_DEBUG_FLAGS := -g |
| 39 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 40 | HOST_JAVAC ?= $(COMMON_JAVAC) |
| 41 | TARGET_JAVAC ?= $(COMMON_JAVAC) |
Brian Carlstrom | b6dcef8 | 2014-01-09 15:33:06 -0800 | [diff] [blame] | 42 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 43 | #$(info HOST_JAVAC=$(HOST_JAVAC)) |
| 44 | #$(info TARGET_JAVAC=$(TARGET_JAVAC)) |