javac.mk revision 447d69678e6ba108a2f9e034c876a8859015fe17
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
12common_jdk_flags := -source 1.7 -target 1.7 -Xmaxerrs 9999999
13
14# Use the indexer wrapper to index the codebase instead of the javac compiler
15ifeq ($(ALTERNATE_JAVAC),)
16JAVACC := javac
17else
18JAVACC := $(ALTERNATE_JAVAC)
19endif
20
21# The actual compiler can be wrapped by setting the JAVAC_WRAPPER var.
22ifdef JAVAC_WRAPPER
23    ifneq ($(JAVAC_WRAPPER),$(firstword $(JAVACC)))
24        JAVACC := $(JAVAC_WRAPPER) $(JAVACC)
25    endif
26endif
27
28# Whatever compiler is on this system.
29COMMON_JAVAC := $(JAVACC) -J-Xmx1024M $(common_jdk_flags)
30
31# Eclipse.
32ifeq ($(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)
36endif
37
38GLOBAL_JAVAC_DEBUG_FLAGS := -g
39
40HOST_JAVAC ?= $(COMMON_JAVAC)
41TARGET_JAVAC ?= $(COMMON_JAVAC)
42
43#$(info HOST_JAVAC=$(HOST_JAVAC))
44#$(info TARGET_JAVAC=$(TARGET_JAVAC))
45