javac.mk revision b6c1cf6de79035f58b512f4400db458c8401379a
1# Selects a Java compiler.
2#
3# Inputs:
4#	CUSTOM_JAVA_COMPILER -- "eclipse", "openjdk". or nothing for the system 
5#                           default
6#
7# Outputs:
8#   COMMON_JAVAC -- Java compiler command with common arguments
9
10# Whatever compiler is on this system.
11ifeq ($(HOST_OS), windows)
12    COMMON_JAVAC := prebuilt/windows/host/bin/javawrap.exe -J-Xmx256m \
13        -target 1.5 -Xmaxerrs 9999999
14else
15    COMMON_JAVAC := javac -J-Xmx256m -target 1.5 -Xmaxerrs 9999999
16endif
17
18# Eclipse.
19ifeq ($(CUSTOM_JAVA_COMPILER), eclipse)
20    COMMON_JAVAC := java -Xmx256m -jar prebuilt/common/ecj/ecj.jar -5 \
21        -maxProblems 9999999 -nowarn
22    $(info CUSTOM_JAVA_COMPILER=eclipse)
23endif
24
25# OpenJDK.
26ifeq ($(CUSTOM_JAVA_COMPILER), openjdk)
27    # We set the VM options (like -Xmx) in the javac script.
28    COMMON_JAVAC := prebuilt/common/openjdk/bin/javac -target 1.5 \
29        -Xmaxerrs 9999999
30    $(info CUSTOM_JAVA_COMPILER=openjdk)
31endif
32   
33HOST_JAVAC ?= $(COMMON_JAVAC)
34TARGET_JAVAC ?= $(COMMON_JAVAC)
35    
36#$(info HOST_JAVAC=$(HOST_JAVAC))
37#$(info TARGET_JAVAC=$(TARGET_JAVAC))
38