javac.mk revision c84889b80ae40dec85ac4810fc500db70cbc82b2
1# Selects a Java compiler.
2#
3# Inputs:
4#	CUSTOM_JAVA_COMPILER -- "eclipse", "openjdk". or nothing for the system 
5#                           default
6#	ALTERNATE_JAVAC -- the alternate java compiler to use
7#
8# Outputs:
9#   COMMON_JAVAC -- Java compiler command with common arguments
10#
11
12ifneq ($(LEGACY_USE_JAVA6),)
13common_flags := -target 1.5 -Xmaxerrs 9999999
14else
15common_flags := -source 1.7 -target 1.7 -Xmaxerrs 9999999
16endif
17
18# Use the indexer wrapper to index the codebase instead of the javac compiler
19ifeq ($(ALTERNATE_JAVAC),)
20JAVACC := javac
21else
22JAVACC := $(ALTERNATE_JAVAC)
23endif
24
25# Whatever compiler is on this system.
26ifeq ($(BUILD_OS), windows)
27    COMMON_JAVAC := development/host/windows/prebuilt/javawrap.exe -J-Xmx256m \
28        $(common_flags)
29else
30    COMMON_JAVAC := $(JAVACC) -J-Xmx768M $(common_flags)
31endif
32
33# Eclipse.
34ifeq ($(CUSTOM_JAVA_COMPILER), eclipse)
35    COMMON_JAVAC := java -Xmx256m -jar prebuilt/common/ecj/ecj.jar -5 \
36        -maxProblems 9999999 -nowarn
37    $(info CUSTOM_JAVA_COMPILER=eclipse)
38endif
39
40HOST_JAVAC ?= $(COMMON_JAVAC)
41TARGET_JAVAC ?= $(COMMON_JAVAC)
42
43#$(info HOST_JAVAC=$(HOST_JAVAC))
44#$(info TARGET_JAVAC=$(TARGET_JAVAC))
45