make/common/JavaCompilation.gmk
changeset 32460 9e9bffb3029a
parent 32344 0b288e0efcfa
child 32717 3dfcb41a7326
equal deleted inserted replaced
32457:2050b3a0aadc 32460:9e9bffb3029a
   401 #   JVM:=path to ..bin/java
   401 #   JVM:=path to ..bin/java
   402 #   ADD_JAVAC_FLAGS:=javac flags to append to the default ones.
   402 #   ADD_JAVAC_FLAGS:=javac flags to append to the default ones.
   403 #   SRC:=one or more directories to search for sources. The order of the source roots
   403 #   SRC:=one or more directories to search for sources. The order of the source roots
   404 #        is significant. The first found file of a certain name has priority.
   404 #        is significant. The first found file of a certain name has priority.
   405 #   BIN:=store classes here
   405 #   BIN:=store classes here
       
   406 #   CLASSPATH:=a list of additional entries to set as classpath to javac
   406 #   INCLUDES:=myapp.foo means will only compile java files in myapp.foo or any of its sub-packages.
   407 #   INCLUDES:=myapp.foo means will only compile java files in myapp.foo or any of its sub-packages.
   407 #   EXCLUDES:=myapp.foo means will do not compile java files in myapp.foo or any of its sub-packages.
   408 #   EXCLUDES:=myapp.foo means will do not compile java files in myapp.foo or any of its sub-packages.
   408 #   COPY:=.prp means copy all prp files to the corresponding package in BIN.
   409 #   COPY:=.prp means copy all prp files to the corresponding package in BIN.
   409 #   COPY_FILES:=myapp/foo/setting.txt means copy this file over to the package myapp/foo
   410 #   COPY_FILES:=myapp/foo/setting.txt means copy this file over to the package myapp/foo
   410 #   CLEAN:=.properties means copy and clean all properties file to the corresponding package in BIN.
   411 #   CLEAN:=.properties means copy and clean all properties file to the corresponding package in BIN.
   426 
   427 
   427   # Extract the info from the java compiler setup.
   428   # Extract the info from the java compiler setup.
   428   $1_JVM := $$($$($1_SETUP)_JVM)
   429   $1_JVM := $$($$($1_SETUP)_JVM)
   429   $1_JAVAC := $$($$($1_SETUP)_JAVAC)
   430   $1_JAVAC := $$($$($1_SETUP)_JAVAC)
   430   $1_FLAGS := $$($$($1_SETUP)_FLAGS) $(JAVAC_FLAGS) $$($1_ADD_JAVAC_FLAGS)
   431   $1_FLAGS := $$($$($1_SETUP)_FLAGS) $(JAVAC_FLAGS) $$($1_ADD_JAVAC_FLAGS)
       
   432   ifneq ($$($1_CLASSPATH), )
       
   433     $1_FLAGS += -cp $$(call PathList, $$($1_CLASSPATH))
       
   434   endif
   431   ifeq ($$($1_JAVAC),)
   435   ifeq ($$($1_JAVAC),)
   432     $$(error The Java compilation $1 refers to a non-existant java compiler setup $$($1_SETUP))
   436     $$(error The Java compilation $1 refers to a non-existant java compiler setup $$($1_SETUP))
   433   endif
   437   endif
   434   $1_SJAVAC_PORTFILE := $$($$($1_SETUP)_SJAVAC_PORTFILE)
   438   $1_SJAVAC_PORTFILE := $$($$($1_SETUP)_SJAVAC_PORTFILE)
   435   $1_SERVER_JVM := $$($$($1_SETUP)_SERVER_JVM)
   439   $1_SERVER_JVM := $$($$($1_SETUP)_SERVER_JVM)
   480  # Create the corresponding smart javac wrapper command line.
   484  # Create the corresponding smart javac wrapper command line.
   481   $1_SJAVAC_ARGS:=$$(addprefix -x ,$$(addsuffix /*,$$($1_EXCLUDES))) \
   485   $1_SJAVAC_ARGS:=$$(addprefix -x ,$$(addsuffix /*,$$($1_EXCLUDES))) \
   482       $$(addprefix -i ,$$(addsuffix /*,$$($1_INCLUDES))) \
   486       $$(addprefix -i ,$$(addsuffix /*,$$($1_INCLUDES))) \
   483       $$(addprefix -xf *,$$(strip $$($1_EXCLUDE_FILES) $$($1_SJAVAC_EXCLUDE_FILES))) \
   487       $$(addprefix -xf *,$$(strip $$($1_EXCLUDE_FILES) $$($1_SJAVAC_EXCLUDE_FILES))) \
   484       $$(addprefix -if *,$$(strip $$($1_INCLUDE_FILES))) \
   488       $$(addprefix -if *,$$(strip $$($1_INCLUDE_FILES))) \
   485       -src "$$(subst $$(SPACE),$$(PATH_SEP),$$(strip $$($1_SRC)))"
   489       -src $$(call PathList, $$($1_SRC))
   486 
   490 
   487   # All files below META-INF are always copied.
   491   # All files below META-INF are always copied.
   488   $1_ALL_COPIES := $$(filter $$(addsuffix /META-INF%,$$($1_SRC)),$$($1_ALL_SRCS))
   492   $1_ALL_COPIES := $$(filter $$(addsuffix /META-INF%,$$($1_SRC)),$$($1_ALL_SRCS))
   489   # Find all files to be copied from source to bin.
   493   # Find all files to be copied from source to bin.
   490   ifneq (,$$($1_COPY)$$($1_COPY_FILES))
   494   ifneq (,$$($1_COPY)$$($1_COPY_FILES))