8055735: JDK_FILTER is broken
authorerikj
Fri, 10 Jun 2016 16:56:29 +0200
changeset 38847 57689ec78480
parent 38846 221a3402ad10
child 38848 0bc7ed792590
8055735: JDK_FILTER is broken Reviewed-by: redestad, alanb, tbell
make/CompileJavaModules.gmk
make/common/JavaCompilation.gmk
--- a/make/CompileJavaModules.gmk	Thu Jun 09 19:06:34 2016 +0000
+++ b/make/CompileJavaModules.gmk	Fri Jun 10 16:56:29 2016 +0200
@@ -477,6 +477,13 @@
 # be recompiled. If multiple paths are separated by comma, convert that into a
 # space separated list.
 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.
 MODULESOURCEPATH := $(call GetModuleSrcPath)
@@ -496,7 +503,8 @@
     SETUP := $(if $($(MODULE)_SETUP), $($(MODULE)_SETUP), GENERATE_JDKBYTECODE), \
     MODULE := $(MODULE), \
     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), \
     HEADERS := $(SUPPORT_OUTPUTDIR)/headers, \
     ADD_JAVAC_FLAGS := \
--- a/make/common/JavaCompilation.gmk	Thu Jun 09 19:06:34 2016 +0000
+++ b/make/common/JavaCompilation.gmk	Fri Jun 10 16:56:29 2016 +0200
@@ -170,6 +170,8 @@
 #   DEPENDS:=Extra dependecy
 #   DISABLE_SJAVAC:=Explicitly disable the use of sjavac for this compilation unit.
 #   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)
 define SetupJavaCompilationBody
 
@@ -191,7 +193,7 @@
   $1_SJAVAC_PORTFILE := $$($$($1_SETUP)_SJAVAC_PORTFILE)
   $1_SERVER_JVM := $$($$($1_SETUP)_SERVER_JVM)
   $1_DISABLE_SJAVAC := $$($$($1_SETUP)_DISABLE_SJAVAC)
- 
+
   ifneq ($$($1_MODULE), )
     $1_MODULE_SUBDIR := /$$($1_MODULE)
   endif
@@ -246,146 +248,148 @@
   endif
 
   ifeq ($$(strip $$($1_SRCS)), )
-    $$(error No source files found for $1)
-  endif
+    ifneq ($$($1_FAIL_NO_SRC), false)
+      $$(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.
-  $1_ALL_COPIES := $$(filter $$(addsuffix /META-INF%,$$($1_SRC)),$$($1_ALL_SRCS))
-  # Find all files to be copied from source to bin.
-  ifneq (,$$($1_COPY)$$($1_COPY_FILES))
-    # Search for all files to be copied.
-    $1_ALL_COPIES += $$(filter $$(addprefix %,$$($1_COPY)),$$($1_ALL_SRCS))
-    # Copy these explicitly
-    $1_ALL_COPIES += $$($1_COPY_FILES)
-  endif
-  # 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.
+    # All files below META-INF are always copied.
+    $1_ALL_COPIES := $$(filter $$(addsuffix /META-INF%,$$($1_SRC)),$$($1_ALL_SRCS))
+    # Find all files to be copied from source to bin.
+    ifneq (,$$($1_COPY)$$($1_COPY_FILES))
+      # Search for all files to be copied.
+      $1_ALL_COPIES += $$(filter $$(addprefix %,$$($1_COPY)),$$($1_ALL_SRCS))
+      # Copy these explicitly
+      $1_ALL_COPIES += $$($1_COPY_FILES)
+    endif
+    # Copy must also respect filters.
     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
     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
-    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!
+    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
-  endif
 
-  # Create a sed expression to remove the source roots and to replace / with .
-  # and remove .java at the end.
-  $1_REWRITE_INTO_CLASSES:=$$(foreach i,$$($1_SRC),-e 's|$$i/||g') -e 's|/|.|g' -e 's|.java$$$$||g'
+    # 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))
+        $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
-  # "bootclasspathprepend -cp .../javac.jar com.sun.tools.javac.Main"
-  # and javac is simply replaced with sjavac.
-  $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.
-  $1_REMOTE:=--server:portfile=$$($1_SJAVAC_PORTFILE),id=$1,sjavac=$$(subst \
-      $$(SPACE),%20,$$(subst $$(COMMA),%2C,$$(strip $$($1_SERVER_JVM) $$($1_SJAVAC))))
+    # Create a sed expression to remove the source roots and to replace / with .
+    # and remove .java at the end.
+    $1_REWRITE_INTO_CLASSES:=$$(foreach i,$$($1_SRC),-e 's|$$i/||g') -e 's|/|.|g' -e 's|.java$$$$||g'
 
-  $1_COMPILE_TARGET := $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_batch
+    # Create SJAVAC variable from JAVAC variable. Expects $1_JAVAC to be
+    # "bootclasspathprepend -cp .../javac.jar com.sun.tools.javac.Main"
+    # and javac is simply replaced with sjavac.
+    $1_SJAVAC:=$$(subst com.sun.tools.javac.Main,com.sun.tools.sjavac.Main,$$($1_JAVAC))
 
-  ifeq ($$($1_DISABLE_SJAVAC)x$$(ENABLE_SJAVAC),xyes)
-    # Using sjavac to compile.
+    # 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))))
+
+    $1_COMPILE_TARGET := $$($1_BIN)$$($1_MODULE_SUBDIR)/_the.$1_batch
+
+    ifeq ($$($1_DISABLE_SJAVAC)x$$(ENABLE_SJAVAC),xyes)
+      # Using sjavac to compile.
 
-    # Create the sjavac wrapper command line. Sjavac doesn't handle patterns that
-    # match the absolute path, only the part inside each src dir. Instead -i and
-    # -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)
-    $1_EXCLUDE_FILES_REL := $$(filter-out /%, $$($1_EXCLUDE_FILES))
-    $1_SJAVAC_ARGS_STRING := $$(foreach s, $$(patsubst %/, %, $$($1_SRC)), \
-        $$(addprefix -x ,$$(addsuffix /**,$$($1_EXCLUDES))) \
-        $$(addprefix -i ,$$(addsuffix /**,$$($1_INCLUDES))) \
-        $$(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))
+      # Create the sjavac wrapper command line. Sjavac doesn't handle patterns that
+      # match the absolute path, only the part inside each src dir. Instead -i and
+      # -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)
+      $1_EXCLUDE_FILES_REL := $$(filter-out /%, $$($1_EXCLUDE_FILES))
+      $1_SJAVAC_ARGS_STRING := $$(foreach s, $$(patsubst %/, %, $$($1_SRC)), \
+          $$(addprefix -x ,$$(addsuffix /**,$$($1_EXCLUDES))) \
+          $$(addprefix -i ,$$(addsuffix /**,$$($1_INCLUDES))) \
+          $$(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 ($$(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
+      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_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
+      $$($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.
+    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
+      # 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)
+        $$($1_HEADERS)/_the.$1_headers: $$($1_COMPILE_TARGET)
 		$(MKDIR) -p $$(@D)
 		if [ -d "$$($1_HEADERS).$1.tmp" ]; then \
 		  for f in `$(CD) $$($1_HEADERS).$1.tmp && $(FIND) . -type f`; do \
@@ -399,78 +403,79 @@
 		$(RM) -r $$($1_HEADERS).$1.tmp
 		$(TOUCH) $$@
 
-      $1_HEADER_TARGETS := $$($1_HEADERS)/_the.$1_headers
-    endif
+        $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)
 
-    $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
 
-    ifeq ($$($1_DISABLE_SJAVAC)x$(ENABLE_JAVAC_SERVER), xyes)
-      $1_JAVAC_CMD := $$($1_SJAVAC) $$($1_REMOTE)
-    else
-      $1_JAVAC_CMD := $$($1_JAVAC)
+      # 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
 
-    # 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
+    # Add all targets to main variable
+    $1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1_COMPILE_TARGET) \
+        $$($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
 
-  # Add all targets to main variable
-  $1 := $$($1_ALL_COPY_TARGETS) $$($1_ALL_COPY_CLEAN_TARGETS) $$($1_COMPILE_TARGET) \
-      $$($1_HEADER_TARGETS)
+      $$(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), \
+      ))
 
-  # 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)
+      # Add jar to target list
+      $1 += $$($1_JAR)
     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), \
-    ))
+    # 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 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
+      # Add zip to target list
+      $1 += $$($1_SRCZIP)
+    endif
+  endif # Source files found
 endef
 
 # Use this macro to find the correct target to depend on when the original