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. |
Raphael | 63c8af9 | 2010-06-12 11:36:14 -0700 | [diff] [blame] | 29 | ifeq ($(BUILD_OS), windows) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 30 | COMMON_JAVAC := development/host/windows/prebuilt/javawrap.exe -J-Xmx256m \ |
Nick Reuter | c43ab6e | 2014-05-08 21:36:05 -0500 | [diff] [blame] | 31 | $(common_jdk_flags) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 32 | else |
Nick Reuter | c43ab6e | 2014-05-08 21:36:05 -0500 | [diff] [blame] | 33 | COMMON_JAVAC := $(JAVACC) -J-Xmx1024M $(common_jdk_flags) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 34 | endif |
| 35 | |
| 36 | # Eclipse. |
| 37 | ifeq ($(CUSTOM_JAVA_COMPILER), eclipse) |
| 38 | COMMON_JAVAC := java -Xmx256m -jar prebuilt/common/ecj/ecj.jar -5 \ |
| 39 | -maxProblems 9999999 -nowarn |
| 40 | $(info CUSTOM_JAVA_COMPILER=eclipse) |
| 41 | endif |
| 42 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 43 | HOST_JAVAC ?= $(COMMON_JAVAC) |
| 44 | TARGET_JAVAC ?= $(COMMON_JAVAC) |
Brian Carlstrom | b6dcef8 | 2014-01-09 15:33:06 -0800 | [diff] [blame] | 45 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 46 | #$(info HOST_JAVAC=$(HOST_JAVAC)) |
| 47 | #$(info TARGET_JAVAC=$(TARGET_JAVAC)) |