8055735: JDK_FILTER is broken

Reviewed-by: redestad, alanb, tbell
This commit is contained in:
Erik Joelsson 2016-06-10 16:56:29 +02:00
parent 4c4d28cabc
commit 0295c28e94
2 changed files with 203 additions and 190 deletions

View File

@ -477,6 +477,13 @@ MODULE_SRC_DIRS := $(call FindModuleSrcDirs, $(MODULE))
# be recompiled. If multiple paths are separated by comma, convert that into a # be recompiled. If multiple paths are separated by comma, convert that into a
# space separated list. # space separated list.
JDK_USER_DEFINED_FILTER := $(strip $(subst $(COMMA),$(SPACE), $(JDK_FILTER))) JDK_USER_DEFINED_FILTER := $(strip $(subst $(COMMA),$(SPACE), $(JDK_FILTER)))
ifeq ($(JDK_FILTER), )
FAIL_NO_SRC := true
else
# When using JDK_FILTER, most module java compilations will end up finding
# no source files. Don't let that fail the build.
FAIL_NO_SRC := false
endif
# Get the complete module source path. # Get the complete module source path.
MODULESOURCEPATH := $(call GetModuleSrcPath) MODULESOURCEPATH := $(call GetModuleSrcPath)
@ -496,7 +503,8 @@ $(eval $(call SetupJavaCompilation, $(MODULE), \
SETUP := $(if $($(MODULE)_SETUP), $($(MODULE)_SETUP), GENERATE_JDKBYTECODE), \ SETUP := $(if $($(MODULE)_SETUP), $($(MODULE)_SETUP), GENERATE_JDKBYTECODE), \
MODULE := $(MODULE), \ MODULE := $(MODULE), \
SRC := $(wildcard $(MODULE_SRC_DIRS)), \ SRC := $(wildcard $(MODULE_SRC_DIRS)), \
INCLUDES := $(JDK_USER_DEFINED_FILTER),\ INCLUDES := $(JDK_USER_DEFINED_FILTER), \
FAIL_NO_SRC := $(FAIL_NO_SRC), \
BIN := $(if $($(MODULE)_BIN), $($(MODULE)_BIN), $(JDK_OUTPUTDIR)/modules), \ BIN := $(if $($(MODULE)_BIN), $($(MODULE)_BIN), $(JDK_OUTPUTDIR)/modules), \
HEADERS := $(SUPPORT_OUTPUTDIR)/headers, \ HEADERS := $(SUPPORT_OUTPUTDIR)/headers, \
ADD_JAVAC_FLAGS := \ ADD_JAVAC_FLAGS := \

View File

@ -170,6 +170,8 @@ endef
# DEPENDS:=Extra dependecy # DEPENDS:=Extra dependecy
# DISABLE_SJAVAC:=Explicitly disable the use of sjavac for this compilation unit. # DISABLE_SJAVAC:=Explicitly disable the use of sjavac for this compilation unit.
# KEEP_DUPS:=Do not remove duplicate file names from different source roots. # KEEP_DUPS:=Do not remove duplicate file names from different source roots.
# FAIL_NO_SRC:=Set to false to not fail the build if no source files are found,
# default is true.
SetupJavaCompilation = $(NamedParamsMacroTemplate) SetupJavaCompilation = $(NamedParamsMacroTemplate)
define SetupJavaCompilationBody define SetupJavaCompilationBody
@ -191,7 +193,7 @@ define SetupJavaCompilationBody
$1_SJAVAC_PORTFILE := $$($$($1_SETUP)_SJAVAC_PORTFILE) $1_SJAVAC_PORTFILE := $$($$($1_SETUP)_SJAVAC_PORTFILE)
$1_SERVER_JVM := $$($$($1_SETUP)_SERVER_JVM) $1_SERVER_JVM := $$($$($1_SETUP)_SERVER_JVM)
$1_DISABLE_SJAVAC := $$($$($1_SETUP)_DISABLE_SJAVAC) $1_DISABLE_SJAVAC := $$($$($1_SETUP)_DISABLE_SJAVAC)
ifneq ($$($1_MODULE), ) ifneq ($$($1_MODULE), )
$1_MODULE_SUBDIR := /$$($1_MODULE) $1_MODULE_SUBDIR := /$$($1_MODULE)
endif endif
@ -246,146 +248,148 @@ define SetupJavaCompilationBody
endif endif
ifeq ($$(strip $$($1_SRCS)), ) ifeq ($$(strip $$($1_SRCS)), )
$$(error No source files found for $1) ifneq ($$($1_FAIL_NO_SRC), false)
endif $$(error No source files found for $1)
endif
else
$1_SAFE_NAME := $$(strip $$(subst /,_, $1)) $1_SAFE_NAME := $$(strip $$(subst /,_, $1))
# All files below META-INF are always copied. # All files below META-INF are always copied.
$1_ALL_COPIES := $$(filter $$(addsuffix /META-INF%,$$($1_SRC)),$$($1_ALL_SRCS)) $1_ALL_COPIES := $$(filter $$(addsuffix /META-INF%,$$($1_SRC)),$$($1_ALL_SRCS))
# Find all files to be copied from source to bin. # Find all files to be copied from source to bin.
ifneq (,$$($1_COPY)$$($1_COPY_FILES)) ifneq (,$$($1_COPY)$$($1_COPY_FILES))
# Search for all files to be copied. # Search for all files to be copied.
$1_ALL_COPIES += $$(filter $$(addprefix %,$$($1_COPY)),$$($1_ALL_SRCS)) $1_ALL_COPIES += $$(filter $$(addprefix %,$$($1_COPY)),$$($1_ALL_SRCS))
# Copy these explicitly # Copy these explicitly
$1_ALL_COPIES += $$($1_COPY_FILES) $1_ALL_COPIES += $$($1_COPY_FILES)
endif endif
# Copy must also respect filters. # Copy must also respect filters.
ifneq (,$$($1_INCLUDE_PATTERN))
$1_ALL_COPIES := $$(filter $$($1_INCLUDE_PATTERN),$$($1_ALL_COPIES))
endif
ifneq (,$$($1_EXCLUDE_PATTERN))
$1_ALL_COPIES := $$(filter-out $$($1_EXCLUDE_PATTERN),$$($1_ALL_COPIES))
endif
ifneq (,$$($1_ALL_COPIES))
# Yep, there are files to be copied!
$1_ALL_COPY_TARGETS:=
$$(foreach i,$$($1_ALL_COPIES),$$(eval $$(call add_file_to_copy,$1,$$i)))
# Now we can depend on $$($1_ALL_COPY_TARGETS) to copy all files!
endif
# Find all property files to be copied and cleaned from source to bin.
ifneq (,$$($1_CLEAN)$$($1_CLEAN_FILES))
# Search for all files to be copied.
$1_ALL_CLEANS := $$(filter $$(addprefix %,$$($1_CLEAN)),$$($1_ALL_SRCS))
# Clean these explicitly
$1_ALL_CLEANS += $$($1_CLEAN_FILES)
# Copy and clean must also respect filters.
ifneq (,$$($1_INCLUDE_PATTERN)) ifneq (,$$($1_INCLUDE_PATTERN))
$1_ALL_CLEANS := $$(filter $$($1_INCLUDE_PATTERN),$$($1_ALL_CLEANS)) $1_ALL_COPIES := $$(filter $$($1_INCLUDE_PATTERN),$$($1_ALL_COPIES))
endif endif
ifneq (,$$($1_EXCLUDE_PATTERN)) ifneq (,$$($1_EXCLUDE_PATTERN))
$1_ALL_CLEANS := $$(filter-out $$($1_EXCLUDE_PATTERN),$$($1_ALL_CLEANS)) $1_ALL_COPIES := $$(filter-out $$($1_EXCLUDE_PATTERN),$$($1_ALL_COPIES))
endif endif
ifneq (,$$($1_ALL_CLEANS)) ifneq (,$$($1_ALL_COPIES))
# Yep, there are files to be copied and cleaned! # Yep, there are files to be copied!
$1_ALL_COPY_CLEAN_TARGETS:= $1_ALL_COPY_TARGETS:=
$$(foreach i,$$($1_ALL_CLEANS),$$(eval $$(call add_file_to_clean,$1,$$i))) $$(foreach i,$$($1_ALL_COPIES),$$(eval $$(call add_file_to_copy,$1,$$i)))
# Now we can depend on $$($1_ALL_COPY_CLEAN_TARGETS) to copy all files! # Now we can depend on $$($1_ALL_COPY_TARGETS) to copy all files!
endif endif
endif
# Create a sed expression to remove the source roots and to replace / with . # Find all property files to be copied and cleaned from source to bin.
# and remove .java at the end. ifneq (,$$($1_CLEAN)$$($1_CLEAN_FILES))
$1_REWRITE_INTO_CLASSES:=$$(foreach i,$$($1_SRC),-e 's|$$i/||g') -e 's|/|.|g' -e 's|.java$$$$||g' # Search for all files to be copied.
$1_ALL_CLEANS := $$(filter $$(addprefix %,$$($1_CLEAN)),$$($1_ALL_SRCS))
# Clean these explicitly
$1_ALL_CLEANS += $$($1_CLEAN_FILES)
# Copy and clean must also respect filters.
ifneq (,$$($1_INCLUDE_PATTERN))
$1_ALL_CLEANS := $$(filter $$($1_INCLUDE_PATTERN),$$($1_ALL_CLEANS))
endif
ifneq (,$$($1_EXCLUDE_PATTERN))
$1_ALL_CLEANS := $$(filter-out $$($1_EXCLUDE_PATTERN),$$($1_ALL_CLEANS))
endif
ifneq (,$$($1_ALL_CLEANS))
# Yep, there are files to be copied and cleaned!
$1_ALL_COPY_CLEAN_TARGETS:=
$$(foreach i,$$($1_ALL_CLEANS),$$(eval $$(call add_file_to_clean,$1,$$i)))
# Now we can depend on $$($1_ALL_COPY_CLEAN_TARGETS) to copy all files!
endif
endif
# Create SJAVAC variable from JAVAC variable. Expects $1_JAVAC to be # Create a sed expression to remove the source roots and to replace / with .
# "bootclasspathprepend -cp .../javac.jar com.sun.tools.javac.Main" # and remove .java at the end.
# and javac is simply replaced with sjavac. $1_REWRITE_INTO_CLASSES:=$$(foreach i,$$($1_SRC),-e 's|$$i/||g') -e 's|/|.|g' -e 's|.java$$$$||g'
$1_SJAVAC:=$$(subst com.sun.tools.javac.Main,com.sun.tools.sjavac.Main,$$($1_JAVAC))
# Set the $1_REMOTE to spawn a background javac server. # Create SJAVAC variable from JAVAC variable. Expects $1_JAVAC to be
$1_REMOTE:=--server:portfile=$$($1_SJAVAC_PORTFILE),id=$1,sjavac=$$(subst \ # "bootclasspathprepend -cp .../javac.jar com.sun.tools.javac.Main"
$$(SPACE),%20,$$(subst $$(COMMA),%2C,$$(strip $$($1_SERVER_JVM) $$($1_SJAVAC)))) # and javac is simply replaced with sjavac.
$1_SJAVAC:=$$(subst com.sun.tools.javac.Main,com.sun.tools.sjavac.Main,$$($1_JAVAC))
$1_COMPILE_TARGET := $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_batch # Set the $1_REMOTE to spawn a background javac server.
$1_REMOTE:=--server:portfile=$$($1_SJAVAC_PORTFILE),id=$1,sjavac=$$(subst \
$$(SPACE),%20,$$(subst $$(COMMA),%2C,$$(strip $$($1_SERVER_JVM) $$($1_SJAVAC))))
ifeq ($$($1_DISABLE_SJAVAC)x$$(ENABLE_SJAVAC),xyes) $1_COMPILE_TARGET := $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_batch
# Using sjavac to compile.
# Create the sjavac wrapper command line. Sjavac doesn't handle patterns that ifeq ($$($1_DISABLE_SJAVAC)x$$(ENABLE_SJAVAC),xyes)
# match the absolute path, only the part inside each src dir. Instead -i and # Using sjavac to compile.
# -x flags apply only to the next -src arg on the command line.
$1_EXCLUDE_FILES_ABS := $$(filter /%, $$($1_EXCLUDE_FILES)) $$($1_SJAVAC_EXCLUDE_FILES) # Create the sjavac wrapper command line. Sjavac doesn't handle patterns that
$1_EXCLUDE_FILES_REL := $$(filter-out /%, $$($1_EXCLUDE_FILES)) # match the absolute path, only the part inside each src dir. Instead -i and
$1_SJAVAC_ARGS_STRING := $$(foreach s, $$(patsubst %/, %, $$($1_SRC)), \ # -x flags apply only to the next -src arg on the command line.
$$(addprefix -x ,$$(addsuffix /**,$$($1_EXCLUDES))) \ $1_EXCLUDE_FILES_ABS := $$(filter /%, $$($1_EXCLUDE_FILES)) $$($1_SJAVAC_EXCLUDE_FILES)
$$(addprefix -i ,$$(addsuffix /**,$$($1_INCLUDES))) \ $1_EXCLUDE_FILES_REL := $$(filter-out /%, $$($1_EXCLUDE_FILES))
$$(addprefix -x **,$$(strip $$($1_EXCLUDE_FILES_REL))) \ $1_SJAVAC_ARGS_STRING := $$(foreach s, $$(patsubst %/, %, $$($1_SRC)), \
$$(addprefix -i **,$$(strip $$($1_INCLUDE_FILES))) \ $$(addprefix -x ,$$(addsuffix /**,$$($1_EXCLUDES))) \
$$(addprefix -x , $$(strip $$(patsubst $$(s)/%, %, $$(filter $$(s)/%, $$($1_EXCLUDE_FILES_ABS))))) \ $$(addprefix -i ,$$(addsuffix /**,$$($1_INCLUDES))) \
-src $$(s)) $$(addprefix -x **,$$(strip $$($1_EXCLUDE_FILES_REL))) \
$$(addprefix -i **,$$(strip $$($1_INCLUDE_FILES))) \
$$(addprefix -x , $$(strip $$(patsubst $$(s)/%, %, $$(filter $$(s)/%, $$($1_EXCLUDE_FILES_ABS))))) \
-src $$(s))
ifneq ($$(word 20, $$($1_SJAVAC_ARGS_STRING)), )
$1_SJAVAC_ARGS_FILE := $$($1_BIN)/_the.$1_args
$1_SJAVAC_ARGS := @$$($1_SJAVAC_ARGS_FILE)
else
$1_SJAVAC_ARGS := $$($1_SJAVAC_ARGS_STRING)
endif
ifneq (,$$($1_HEADERS))
$1_HEADERS_ARG := -h $$($1_HEADERS)
endif
$1_VARDEPS := $$($1_JVM) $$($1_SJAVAC) $$($1_SJAVAC_ARGS_STRING) $$($1_FLAGS) \
$$($1_HEADERS_ARG) $$($1_BIN) $$($1_EXCLUDES) $$($1_INCLUDES) \
$$($1_EXCLUDE_FILES) $$($1_INCLUDE_FILES)
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
$$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1.vardeps)
$$($1_COMPILE_TARGET): $$($1_SRCS) $$($1_DEPENDS) $$($1_VARDEPS_FILE)
$$(call MakeDir, $$(@D) $$(dir $$($1_SJAVAC_PORTFILE)))
$$(eval $$(call ListPathsSafely,$1_SRCS, $$@.tmp))
ifneq ($$($1_SJAVAC_ARGS_FILE), )
$$(eval $$(call ListPathsSafely,$1_SJAVAC_ARGS_STRING, $$($1_SJAVAC_ARGS_FILE)))
endif
$$(call LogWarn, Compiling $1)
$$(call ExecuteWithLog, $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$$($1_SAFE_NAME)_batch, \
$$($1_JVM) $$($1_SJAVAC) \
$$($1_REMOTE) \
-j 1 \
--permit-unidentified-artifacts \
--permit-sources-without-package \
--compare-found-sources $$@.tmp \
--log=$(LOG_LEVEL) \
--state-dir=$$($1_BIN)$$($1_MODULE_SUBDIR) \
$$($1_SJAVAC_ARGS) \
$$($1_FLAGS) \
$$($1_HEADERS_ARG) \
-d $$($1_BIN)) && \
$(MV) $$@.tmp $$@
# Create a pubapi file that only changes when the pubapi changes. Dependent
# compilations can use this file to only get recompiled when pubapi has changed.
# Grep returns 1 if no matching lines are found. Do not fail for this.
$(GREP) -e "^I" $$($1_BIN)$$($1_MODULE_SUBDIR)/javac_state > $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_pubapi.tmp \
|| test "$$$$?" = "1"
if [ ! -f $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_pubapi ] \
|| [ "`$(DIFF) $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_pubapi \
$$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_pubapi.tmp`" != "" ]; then \
$(MV) $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_pubapi.tmp \
$$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_pubapi; \
fi
ifneq ($$(word 20, $$($1_SJAVAC_ARGS_STRING)), )
$1_SJAVAC_ARGS_FILE := $$($1_BIN)/_the.$1_args
$1_SJAVAC_ARGS := @$$($1_SJAVAC_ARGS_FILE)
else else
$1_SJAVAC_ARGS := $$($1_SJAVAC_ARGS_STRING) # Using plain javac to batch compile everything.
endif
# When building in batch, put headers in a temp dir to filter out those that actually
# changed before copying them to the real header dir.
ifneq (,$$($1_HEADERS))
$1_HEADERS_ARG := -h $$($1_HEADERS).$1.tmp
ifneq (,$$($1_HEADERS)) $$($1_HEADERS)/_the.$1_headers: $$($1_COMPILE_TARGET)
$1_HEADERS_ARG := -h $$($1_HEADERS)
endif
$1_VARDEPS := $$($1_JVM) $$($1_SJAVAC) $$($1_SJAVAC_ARGS_STRING) $$($1_FLAGS) \
$$($1_HEADERS_ARG) $$($1_BIN) $$($1_EXCLUDES) $$($1_INCLUDES) \
$$($1_EXCLUDE_FILES) $$($1_INCLUDE_FILES)
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
$$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1.vardeps)
$$($1_COMPILE_TARGET): $$($1_SRCS) $$($1_DEPENDS) $$($1_VARDEPS_FILE)
$$(call MakeDir, $$(@D) $$(dir $$($1_SJAVAC_PORTFILE)))
$$(eval $$(call ListPathsSafely,$1_SRCS, $$@.tmp))
ifneq ($$($1_SJAVAC_ARGS_FILE), )
$$(eval $$(call ListPathsSafely,$1_SJAVAC_ARGS_STRING, $$($1_SJAVAC_ARGS_FILE)))
endif
$$(call LogWarn, Compiling $1)
$$(call ExecuteWithLog, $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$$($1_SAFE_NAME)_batch, \
$$($1_JVM) $$($1_SJAVAC) \
$$($1_REMOTE) \
-j 1 \
--permit-unidentified-artifacts \
--permit-sources-without-package \
--compare-found-sources $$@.tmp \
--log=$(LOG_LEVEL) \
--state-dir=$$($1_BIN)$$($1_MODULE_SUBDIR) \
$$($1_SJAVAC_ARGS) \
$$($1_FLAGS) \
$$($1_HEADERS_ARG) \
-d $$($1_BIN)) && \
$(MV) $$@.tmp $$@
# Create a pubapi file that only changes when the pubapi changes. Dependent
# compilations can use this file to only get recompiled when pubapi has changed.
# Grep returns 1 if no matching lines are found. Do not fail for this.
$(GREP) -e "^I" $$($1_BIN)$$($1_MODULE_SUBDIR)/javac_state > $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_pubapi.tmp \
|| test "$$$$?" = "1"
if [ ! -f $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_pubapi ] \
|| [ "`$(DIFF) $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_pubapi \
$$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_pubapi.tmp`" != "" ]; then \
$(MV) $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_pubapi.tmp \
$$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_pubapi; \
fi
else
# Using plain javac to batch compile everything.
# When building in batch, put headers in a temp dir to filter out those that actually
# changed before copying them to the real header dir.
ifneq (,$$($1_HEADERS))
$1_HEADERS_ARG := -h $$($1_HEADERS).$1.tmp
$$($1_HEADERS)/_the.$1_headers: $$($1_COMPILE_TARGET)
$(MKDIR) -p $$(@D) $(MKDIR) -p $$(@D)
if [ -d "$$($1_HEADERS).$1.tmp" ]; then \ if [ -d "$$($1_HEADERS).$1.tmp" ]; then \
for f in `$(CD) $$($1_HEADERS).$1.tmp && $(FIND) . -type f`; do \ for f in `$(CD) $$($1_HEADERS).$1.tmp && $(FIND) . -type f`; do \
@ -399,78 +403,79 @@ define SetupJavaCompilationBody
$(RM) -r $$($1_HEADERS).$1.tmp $(RM) -r $$($1_HEADERS).$1.tmp
$(TOUCH) $$@ $(TOUCH) $$@
$1_HEADER_TARGETS := $$($1_HEADERS)/_the.$1_headers $1_HEADER_TARGETS := $$($1_HEADERS)/_the.$1_headers
endif
$1_VARDEPS := $$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) $$($1_BIN) \
$$($1_HEADERS_ARG) $$($1_EXCLUDES) $$($1_INCLUDES) \
$$($1_EXCLUDE_FILES) $$($1_INCLUDE_FILES)
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
$$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1.vardeps)
ifeq ($$($1_DISABLE_SJAVAC)x$(ENABLE_JAVAC_SERVER), xyes)
$1_JAVAC_CMD := $$($1_SJAVAC) $$($1_REMOTE)
else
$1_JAVAC_CMD := $$($1_JAVAC)
endif
# When not using sjavac, pass along all sources to javac using an @file.
$$($1_COMPILE_TARGET): $$($1_SRCS) $$($1_DEPENDS) $$($1_VARDEPS_FILE)
$$(call MakeDir, $$(@D))
$$(eval $$(call ListPathsSafely,$1_SRCS, $$@.tmp))
$$(call LogWarn, Compiling $$(words $$($1_SRCS)) files for $1)
$$(call ExecuteWithLog, $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$$($1_SAFE_NAME)_batch, \
$$($1_JVM) $$($1_JAVAC_CMD) $$($1_FLAGS) \
-implicit:none \
-d $$($1_BIN) $$($1_HEADERS_ARG) @$$@.tmp) && \
$(MV) $$@.tmp $$@
endif endif
$1_VARDEPS := $$($1_JVM) $$($1_JAVAC) $$($1_FLAGS) $$($1_BIN) \ # Add all targets to main variable
$$($1_HEADERS_ARG) $$($1_EXCLUDES) $$($1_INCLUDES) \ $1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1_COMPILE_TARGET) \
$$($1_EXCLUDE_FILES) $$($1_INCLUDE_FILES) $$($1_HEADER_TARGETS)
$1_VARDEPS_FILE := $$(call DependOnVariable, $1_VARDEPS, \
$$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1.vardeps)
ifeq ($$($1_DISABLE_SJAVAC)x$(ENABLE_JAVAC_SERVER), xyes) # Check if a jar file was specified, then setup the rules for the jar.
$1_JAVAC_CMD := $$($1_SJAVAC) $$($1_REMOTE) ifneq (,$$($1_JAR))
else # If no suffixes was explicitly set for this jar file.
$1_JAVAC_CMD := $$($1_JAVAC) # Use class and the cleaned/copied properties file suffixes as the default
# for the types of files to be put into the jar.
ifeq (,$$($1_SUFFIXES))
$1_SUFFIXES:=.class $$($1_CLEAN) $$($1_COPY)
endif
$$(eval $$(call SetupJarArchive, ARCHIVE_$1, \
DEPENDENCIES:=$$($1), \
SRCS:=$$($1_BIN)$$($1_MODULE_SUBDIR), \
SUFFIXES:=$$($1_SUFFIXES), \
EXCLUDE:=$$($1_EXCLUDES), \
INCLUDES:=$$($1_INCLUDES), \
EXTRA_FILES:=$$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS), \
JAR:=$$($1_JAR), \
JARMAIN:=$$($1_JARMAIN), \
MANIFEST:=$$($1_MANIFEST), \
EXTRA_MANIFEST_ATTR:=$$($1_EXTRA_MANIFEST_ATTR), \
JARINDEX:=$$($1_JARINDEX), \
HEADERS:=$$($1_HEADERS), \
SETUP:=$$($1_SETUP), \
))
# Add jar to target list
$1 += $$($1_JAR)
endif endif
# When not using sjavac, pass along all sources to javac using an @file. # Check if a srczip was specified, then setup the rules for the srczip.
$$($1_COMPILE_TARGET): $$($1_SRCS) $$($1_DEPENDS) $$($1_VARDEPS_FILE) ifneq (,$$($1_SRCZIP))
$$(call MakeDir, $$(@D)) $$(eval $$(call SetupZipArchive, ZIP_ARCHIVE_$1, \
$$(eval $$(call ListPathsSafely,$1_SRCS, $$@.tmp)) SRC:=$$($1_SRC), \
$$(call LogWarn, Compiling $$(words $$($1_SRCS)) files for $1) ZIP:=$$($1_SRCZIP), \
$$(call ExecuteWithLog, $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$$($1_SAFE_NAME)_batch, \ INCLUDES:=$$($1_INCLUDES), \
$$($1_JVM) $$($1_JAVAC_CMD) $$($1_FLAGS) \ EXCLUDES:=$$($1_EXCLUDES), \
-implicit:none \ EXCLUDE_FILES:=$$($1_EXCLUDE_FILES)))
-d $$($1_BIN) $$($1_HEADERS_ARG) @$$@.tmp) && \
$(MV) $$@.tmp $$@
endif
# Add all targets to main variable # Add zip to target list
$1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1_COMPILE_TARGET) \ $1 += $$($1_SRCZIP)
$$($1_HEADER_TARGETS)
# Check if a jar file was specified, then setup the rules for the jar.
ifneq (,$$($1_JAR))
# If no suffixes was explicitly set for this jar file.
# Use class and the cleaned/copied properties file suffixes as the default
# for the types of files to be put into the jar.
ifeq (,$$($1_SUFFIXES))
$1_SUFFIXES:=.class $$($1_CLEAN) $$($1_COPY)
endif endif
endif # Source files found
$$(eval $$(call SetupJarArchive, ARCHIVE_$1, \
DEPENDENCIES:=$$($1), \
SRCS:=$$($1_BIN)$$($1_MODULE_SUBDIR), \
SUFFIXES:=$$($1_SUFFIXES), \
EXCLUDE:=$$($1_EXCLUDES), \
INCLUDES:=$$($1_INCLUDES), \
EXTRA_FILES:=$$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS), \
JAR:=$$($1_JAR), \
JARMAIN:=$$($1_JARMAIN), \
MANIFEST:=$$($1_MANIFEST), \
EXTRA_MANIFEST_ATTR:=$$($1_EXTRA_MANIFEST_ATTR), \
JARINDEX:=$$($1_JARINDEX), \
HEADERS:=$$($1_HEADERS), \
SETUP:=$$($1_SETUP), \
))
# Add jar to target list
$1 += $$($1_JAR)
endif
# Check if a srczip was specified, then setup the rules for the srczip.
ifneq (,$$($1_SRCZIP))
$$(eval $$(call SetupZipArchive, ZIP_ARCHIVE_$1, \
SRC:=$$($1_SRC), \
ZIP:=$$($1_SRCZIP), \
INCLUDES:=$$($1_INCLUDES), \
EXCLUDES:=$$($1_EXCLUDES), \
EXCLUDE_FILES:=$$($1_EXCLUDE_FILES)))
# Add zip to target list
$1 += $$($1_SRCZIP)
endif
endef endef
# Use this macro to find the correct target to depend on when the original # Use this macro to find the correct target to depend on when the original