< prev index next >

make/common/JavaCompilation.gmk

Print this page




 328       $1_SJAVAC_ARGS := $$($1_SJAVAC_ARGS_STRING)
 329     endif
 330 
 331 
 332     ifneq (,$$($1_HEADERS))
 333       $1_HEADERS_ARG := -h $$($1_HEADERS)
 334     endif
 335 
 336     $1_VARDEPS := $$($1_JVM) $$($1_SJAVAC) $$($1_SJAVAC_ARGS_STRING) $$($1_FLAGS) \
 337         $$($1_HEADERS_ARG) $$($1_BIN) $$($1_EXCLUDES) $$($1_INCLUDES) \
 338         $$($1_EXCLUDE_FILES) $$($1_INCLUDE_FILES)
 339     $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$($1_BIN)/_the.$1.vardeps)
 340 
 341     $$($1_COMPILE_TARGET): $$($1_SRCS) $$($1_DEPENDS) $$($1_VARDEPS_FILE)
 342         $(MKDIR) -p $$(@D) $$(dir $$($1_SJAVAC_PORTFILE))
 343         $$(eval $$(call ListPathsSafely,$1_SRCS, $$@.tmp))
 344         ifneq ($$($1_SJAVAC_ARGS_FILE), )
 345           $$(eval $$(call ListPathsSafely,$1_SJAVAC_ARGS_STRING, $$($1_SJAVAC_ARGS_FILE)))
 346         endif
 347         $(ECHO) Compiling $1
 348         $(call LogFailures, $$($1_BIN)/_the.$$($1_SAFE_NAME)_batch.log, $$($1_SAFE_NAME), \
 349             $$($1_JVM) $$($1_SJAVAC) \
 350                 $$($1_REMOTE) \
 351                 -j 1 \
 352                 --permit-unidentified-artifacts \
 353                 --permit-sources-without-package \
 354                 --compare-found-sources $$@.tmp \
 355                 --log=$(LOG_LEVEL) \
 356                 --state-dir=$$($1_BIN) \
 357                 $$($1_SJAVAC_ARGS) \
 358                 $$($1_FLAGS) \
 359                 $$($1_HEADERS_ARG) \
 360                 -d $$($1_BIN)) && \
 361         $(MV) $$@.tmp $$@
 362         # Create a pubapi file that only changes when the pubapi changes. Dependent
 363         # compilations can use this file to only get recompiled when pubapi has changed.
 364         # Grep returns 1 if no matching lines are found. Do not fail for this.
 365         $(GREP) -e "^I" $$($1_BIN)/javac_state > $$($1_BIN)/_the.$1_pubapi.tmp \
 366             || test "$$$$?" = "1"
 367         if [ ! -f $$($1_BIN)/_the.$1_pubapi ] \
 368             || [ "`$(DIFF) $$($1_BIN)/_the.$1_pubapi $$($1_BIN)/_the.$1_pubapi.tmp`" != "" ]; then \


 392 
 393       $1_HEADER_TARGETS := $$($1_HEADERS)/_the.$1_headers
 394     endif
 395 
 396     $1_VARDEPS := $$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) $$($1_BIN) \
 397         $$($1_HEADERS_ARG) $$($1_EXCLUDES) $$($1_INCLUDES) \
 398         $$($1_EXCLUDE_FILES) $$($1_INCLUDE_FILES)
 399     $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$($1_BIN)/_the.$1.vardeps)
 400 
 401     ifeq ($$($1_DISABLE_SJAVAC)x$(ENABLE_JAVAC_SERVER), xyes)
 402       $1_JAVAC_CMD := $$($1_SJAVAC) $$($1_REMOTE)
 403     else
 404       $1_JAVAC_CMD := $$($1_JAVAC)
 405     endif
 406 
 407     # When not using sjavac, pass along all sources to javac using an @file.
 408     $$($1_COMPILE_TARGET): $$($1_SRCS) $$($1_DEPENDS) $$($1_VARDEPS_FILE)
 409         $(MKDIR) -p $$(@D)
 410         $$(eval $$(call ListPathsSafely,$1_SRCS, $$@.tmp))
 411         $(ECHO) Compiling `$(WC) $$@.tmp | $(TR) -s ' ' | $(CUT) -f 2 -d ' '` files for $1
 412         $(call LogFailures, $$($1_BIN)/_the.$$($1_SAFE_NAME)_batch.log, $$($1_SAFE_NAME), \
 413             $$($1_JVM) $$($1_JAVAC_CMD) $$($1_FLAGS) \
 414                 -implicit:none \
 415                 -d $$($1_BIN) $$($1_HEADERS_ARG) @$$@.tmp) && \
 416         $(MV) $$@.tmp $$@
 417   endif
 418 
 419   # Add all targets to main variable
 420   $1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1_COMPILE_TARGET) \
 421       $$($1_HEADER_TARGETS)
 422 
 423   # Check if a jar file was specified, then setup the rules for the jar.
 424   ifneq (,$$($1_JAR))
 425     # If no suffixes was explicitly set for this jar file.
 426     # Use class and the cleaned/copied properties file suffixes as the default
 427     # for the types of files to be put into the jar.
 428     ifeq (,$$($1_SUFFIXES))
 429       $1_SUFFIXES:=.class $$($1_CLEAN) $$($1_COPY)
 430     endif
 431 
 432     $$(eval $$(call SetupJarArchive, ARCHIVE_$1, \




 328       $1_SJAVAC_ARGS := $$($1_SJAVAC_ARGS_STRING)
 329     endif
 330 
 331 
 332     ifneq (,$$($1_HEADERS))
 333       $1_HEADERS_ARG := -h $$($1_HEADERS)
 334     endif
 335 
 336     $1_VARDEPS := $$($1_JVM) $$($1_SJAVAC) $$($1_SJAVAC_ARGS_STRING) $$($1_FLAGS) \
 337         $$($1_HEADERS_ARG) $$($1_BIN) $$($1_EXCLUDES) $$($1_INCLUDES) \
 338         $$($1_EXCLUDE_FILES) $$($1_INCLUDE_FILES)
 339     $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$($1_BIN)/_the.$1.vardeps)
 340 
 341     $$($1_COMPILE_TARGET): $$($1_SRCS) $$($1_DEPENDS) $$($1_VARDEPS_FILE)
 342         $(MKDIR) -p $$(@D) $$(dir $$($1_SJAVAC_PORTFILE))
 343         $$(eval $$(call ListPathsSafely,$1_SRCS, $$@.tmp))
 344         ifneq ($$($1_SJAVAC_ARGS_FILE), )
 345           $$(eval $$(call ListPathsSafely,$1_SJAVAC_ARGS_STRING, $$($1_SJAVAC_ARGS_FILE)))
 346         endif
 347         $(ECHO) Compiling $1
 348         $(call LogFailures, $$($1_BIN)/_the.$$($1_SAFE_NAME)_batch, $$($1_SAFE_NAME), \
 349             $$($1_JVM) $$($1_SJAVAC) \
 350                 $$($1_REMOTE) \
 351                 -j 1 \
 352                 --permit-unidentified-artifacts \
 353                 --permit-sources-without-package \
 354                 --compare-found-sources $$@.tmp \
 355                 --log=$(LOG_LEVEL) \
 356                 --state-dir=$$($1_BIN) \
 357                 $$($1_SJAVAC_ARGS) \
 358                 $$($1_FLAGS) \
 359                 $$($1_HEADERS_ARG) \
 360                 -d $$($1_BIN)) && \
 361         $(MV) $$@.tmp $$@
 362         # Create a pubapi file that only changes when the pubapi changes. Dependent
 363         # compilations can use this file to only get recompiled when pubapi has changed.
 364         # Grep returns 1 if no matching lines are found. Do not fail for this.
 365         $(GREP) -e "^I" $$($1_BIN)/javac_state > $$($1_BIN)/_the.$1_pubapi.tmp \
 366             || test "$$$$?" = "1"
 367         if [ ! -f $$($1_BIN)/_the.$1_pubapi ] \
 368             || [ "`$(DIFF) $$($1_BIN)/_the.$1_pubapi $$($1_BIN)/_the.$1_pubapi.tmp`" != "" ]; then \


 392 
 393       $1_HEADER_TARGETS := $$($1_HEADERS)/_the.$1_headers
 394     endif
 395 
 396     $1_VARDEPS := $$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) $$($1_BIN) \
 397         $$($1_HEADERS_ARG) $$($1_EXCLUDES) $$($1_INCLUDES) \
 398         $$($1_EXCLUDE_FILES) $$($1_INCLUDE_FILES)
 399     $1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, $$($1_BIN)/_the.$1.vardeps)
 400 
 401     ifeq ($$($1_DISABLE_SJAVAC)x$(ENABLE_JAVAC_SERVER), xyes)
 402       $1_JAVAC_CMD := $$($1_SJAVAC) $$($1_REMOTE)
 403     else
 404       $1_JAVAC_CMD := $$($1_JAVAC)
 405     endif
 406 
 407     # When not using sjavac, pass along all sources to javac using an @file.
 408     $$($1_COMPILE_TARGET): $$($1_SRCS) $$($1_DEPENDS) $$($1_VARDEPS_FILE)
 409         $(MKDIR) -p $$(@D)
 410         $$(eval $$(call ListPathsSafely,$1_SRCS, $$@.tmp))
 411         $(ECHO) Compiling `$(WC) $$@.tmp | $(TR) -s ' ' | $(CUT) -f 2 -d ' '` files for $1
 412         $(call LogFailures, $$($1_BIN)/_the.$$($1_SAFE_NAME)_batch, $$($1_SAFE_NAME), \
 413             $$($1_JVM) $$($1_JAVAC_CMD) $$($1_FLAGS) \
 414                 -implicit:none \
 415                 -d $$($1_BIN) $$($1_HEADERS_ARG) @$$@.tmp) && \
 416         $(MV) $$@.tmp $$@
 417   endif
 418 
 419   # Add all targets to main variable
 420   $1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1_COMPILE_TARGET) \
 421       $$($1_HEADER_TARGETS)
 422 
 423   # Check if a jar file was specified, then setup the rules for the jar.
 424   ifneq (,$$($1_JAR))
 425     # If no suffixes was explicitly set for this jar file.
 426     # Use class and the cleaned/copied properties file suffixes as the default
 427     # for the types of files to be put into the jar.
 428     ifeq (,$$($1_SUFFIXES))
 429       $1_SUFFIXES:=.class $$($1_CLEAN) $$($1_COPY)
 430     endif
 431 
 432     $$(eval $$(call SetupJarArchive, ARCHIVE_$1, \


< prev index next >