@@ -535,8 +535,13 @@ jdk.incubator.vector_DOCLINT += -Xdoclint:all/protected
535535################################################################################
536536# If this is an imported module that has prebuilt classes, only compile
537537# module-info.java.
538- ifneq ($(wildcard $(IMPORT_MODULES_CLASSES)/$(MODULE)), )
539- $(MODULE)_INCLUDE_FILES := module-info.java
538+ ifneq ($(IMPORT_MODULES_CLASSES), )
539+ IMPORT_MODULE_DIR := $(IMPORT_MODULES_CLASSES)/$(MODULE)
540+ ifneq ($(wildcard $(IMPORT_MODULE_DIR)), )
541+ $(MODULE)_INCLUDE_FILES := module-info.java
542+ endif
543+ else
544+ IMPORT_MODULE_DIR :=
540545endif
541546
542547################################################################################
@@ -642,13 +647,13 @@ endif
642647# If this is an imported module, copy the pre built classes and resources into
643648# the modules output dir
644649
645- ifneq ($(wildcard $(IMPORT_MODULES_CLASSES)/$(MODULE )), )
650+ ifneq ($(wildcard $(IMPORT_MODULE_DIR )), )
646651 $(JDK_OUTPUTDIR)/modules/$(MODULE)/_imported.marker: \
647- $(call FindFiles , $(IMPORT_MODULES_CLASSES)/$(MODULE ))
652+ $(call CacheFind , $(IMPORT_MODULE_DIR ))
648653 $(call MakeDir, $(@D))
649654 # Do not delete marker and build meta data files
650655 $(RM) -r $(filter-out $(@D)/_%, $(wildcard $(@D)/*))
651- $(CP) -R $(IMPORT_MODULES_CLASSES)/$(MODULE )/* $(@D)/
656+ $(CP) -R $(IMPORT_MODULE_DIR )/* $(@D)/
652657 $(TOUCH) $@
653658
654659 TARGETS += $(JDK_OUTPUTDIR)/modules/$(MODULE)/_imported.marker
0 commit comments