make/common/JavaCompilation.gmk

Print this page




 426   # param 2,3,4,5,6,7,8 are named args.
 427   #   SETUP:=must point to a previously setup java compiler, for example: SETUP:=BOOTJAVAC
 428   #   JVM:=path to ..bin/java
 429   #   ADD_JAVAC_FLAGS:=javac flags to append to the default ones.
 430   #   SRC:=one or more directories to search for sources
 431   #   BIN:=store classes here
 432   #   INCLUDES:=myapp.foo means will only compile java files in myapp.foo or any of its sub-packages.
 433   #   EXCLUDES:=myapp.foo means will do not compile java files in myapp.foo or any of its sub-packages.
 434   #   COPY:=.prp means copy all prp files to the corresponding package in BIN.
 435   #   COPY_FILES:=myapp/foo/setting.txt means copy this file over to the package myapp/foo
 436   #   CLEAN:=.properties means copy and clean all properties file to the corresponding package in BIN.
 437   #   CLEAN_FILES:=myapp/foo/setting.txt means clean this file over to the package myapp/foo
 438   #   SRCZIP:=Create a src.zip based on the found sources and copied files.
 439   #   INCLUDE_FILES:="com/sun/SolarisFoobar.java" means only compile this file!
 440   #   EXCLUDE_FILES:="com/sun/SolarisFoobar.java" means do not compile this particular file!
 441   #       "SolarisFoobar.java" means do not compile SolarisFoobar, wherever it is found.
 442   #   JAVAC_SOURCE_PATH_OVERRIDE:=This forces an explicit -sourcepath to javac instead of the complete
 443   #       source roots from SRC. This is sometimes needed when compiling specific subsets of the source.
 444   #   HEADERS:=path to directory where all generated c-headers are written.
 445   #   DEPENDS:=Extra dependecy

 446   $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE))
 447   $(call LogSetupMacroEntry,SetupJavaCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
 448   $(if $(16),$(error Internal makefile error: Too many arguments to SetupJavaCompilation, please update JavaCompilation.gmk))
 449 
 450   # Extract the info from the java compiler setup.
 451   $1_JVM := $$($$($1_SETUP)_JVM)
 452   $1_JAVAC := $$($$($1_SETUP)_JAVAC)
 453   $1_FLAGS := $$($$($1_SETUP)_FLAGS) $(JAVAC_FLAGS) $$($1_ADD_JAVAC_FLAGS)
 454   ifeq ($$($1_JAVAC),)
 455     $$(error The Java compilation $1 refers to a non-existant java compiler setup $$($1_SETUP))
 456   endif
 457   $1_SJAVAC_PORTFILE := $$($$($1_SETUP)_SJAVAC_PORTFILE)
 458   $1_SERVER_JVM := $$($$($1_SETUP)_SERVER_JVM)
 459 
 460   # Handle addons and overrides.
 461   $1_SRC:=$$(call ADD_SRCS,$$($1_SRC))
 462   # Make sure the dirs exist.
 463   $$(foreach d,$$($1_SRC), $$(if $$(wildcard $$d),,$$(error SRC specified to SetupJavaCompilation $1 contains missing directory $$d)))
 464   $$(eval $$(call MakeDir,$$($1_BIN)))
 465   # Add all source roots to the find cache since we are likely going to run find 




 426   # param 2,3,4,5,6,7,8 are named args.
 427   #   SETUP:=must point to a previously setup java compiler, for example: SETUP:=BOOTJAVAC
 428   #   JVM:=path to ..bin/java
 429   #   ADD_JAVAC_FLAGS:=javac flags to append to the default ones.
 430   #   SRC:=one or more directories to search for sources
 431   #   BIN:=store classes here
 432   #   INCLUDES:=myapp.foo means will only compile java files in myapp.foo or any of its sub-packages.
 433   #   EXCLUDES:=myapp.foo means will do not compile java files in myapp.foo or any of its sub-packages.
 434   #   COPY:=.prp means copy all prp files to the corresponding package in BIN.
 435   #   COPY_FILES:=myapp/foo/setting.txt means copy this file over to the package myapp/foo
 436   #   CLEAN:=.properties means copy and clean all properties file to the corresponding package in BIN.
 437   #   CLEAN_FILES:=myapp/foo/setting.txt means clean this file over to the package myapp/foo
 438   #   SRCZIP:=Create a src.zip based on the found sources and copied files.
 439   #   INCLUDE_FILES:="com/sun/SolarisFoobar.java" means only compile this file!
 440   #   EXCLUDE_FILES:="com/sun/SolarisFoobar.java" means do not compile this particular file!
 441   #       "SolarisFoobar.java" means do not compile SolarisFoobar, wherever it is found.
 442   #   JAVAC_SOURCE_PATH_OVERRIDE:=This forces an explicit -sourcepath to javac instead of the complete
 443   #       source roots from SRC. This is sometimes needed when compiling specific subsets of the source.
 444   #   HEADERS:=path to directory where all generated c-headers are written.
 445   #   DEPENDS:=Extra dependecy
 446   #   DISABLE_SJAVAC:=Explicitly disable the use of sjavac for this compilation unit.
 447   $(foreach i,2 3 4 5 6 7 8 9 10 11 12 13 14 15, $(if $($i),$1_$(strip $($i)))$(NEWLINE))
 448   $(call LogSetupMacroEntry,SetupJavaCompilation($1),$2,$3,$4,$5,$6,$7,$8,$9,$(10),$(11),$(12),$(13),$(14),$(15))
 449   $(if $(16),$(error Internal makefile error: Too many arguments to SetupJavaCompilation, please update JavaCompilation.gmk))
 450 
 451   # Extract the info from the java compiler setup.
 452   $1_JVM := $$($$($1_SETUP)_JVM)
 453   $1_JAVAC := $$($$($1_SETUP)_JAVAC)
 454   $1_FLAGS := $$($$($1_SETUP)_FLAGS) $(JAVAC_FLAGS) $$($1_ADD_JAVAC_FLAGS)
 455   ifeq ($$($1_JAVAC),)
 456     $$(error The Java compilation $1 refers to a non-existant java compiler setup $$($1_SETUP))
 457   endif
 458   $1_SJAVAC_PORTFILE := $$($$($1_SETUP)_SJAVAC_PORTFILE)
 459   $1_SERVER_JVM := $$($$($1_SETUP)_SERVER_JVM)
 460 
 461   # Handle addons and overrides.
 462   $1_SRC:=$$(call ADD_SRCS,$$($1_SRC))
 463   # Make sure the dirs exist.
 464   $$(foreach d,$$($1_SRC), $$(if $$(wildcard $$d),,$$(error SRC specified to SetupJavaCompilation $1 contains missing directory $$d)))
 465   $$(eval $$(call MakeDir,$$($1_BIN)))
 466   # Add all source roots to the find cache since we are likely going to run find