@@ -531,8 +531,13 @@ jdk.jfr_ADD_JAVAC_FLAGS := -XDstringConcat=inline -Xlint:-exports
531531################################################################################
532532# If this is an imported module that has prebuilt classes, only compile
533533# module-info.java.
534- ifneq ($(wildcard $(IMPORT_MODULES_CLASSES)/$(MODULE)), )
535- $(MODULE)_INCLUDE_FILES := module-info.java
534+ ifneq ($(IMPORT_MODULES_CLASSES), )
535+ IMPORT_MODULE_DIR := $(IMPORT_MODULES_CLASSES)/$(MODULE)
536+ ifneq ($(wildcard $(IMPORT_MODULE_DIR)), )
537+ $(MODULE)_INCLUDE_FILES := module-info.java
538+ endif
539+ else
540+ IMPORT_MODULE_DIR :=
536541endif
537542
538543################################################################################
@@ -638,13 +643,13 @@ endif
638643# If this is an imported module, copy the pre built classes and resources into
639644# the modules output dir
640645
641- ifneq ($(wildcard $(IMPORT_MODULES_CLASSES)/$(MODULE )), )
646+ ifneq ($(wildcard $(IMPORT_MODULE_DIR )), )
642647 $(JDK_OUTPUTDIR)/modules/$(MODULE)/_imported.marker: \
643- $(call FindFiles, $(IMPORT_MODULES_CLASSES)/$(MODULE ))
648+ $(call FindFiles, $(IMPORT_MODULE_DIR ))
644649 $(call MakeDir, $(@D))
645650 # Do not delete marker and build meta data files
646651 $(RM) -r $(filter-out $(@D)/_%, $(wildcard $(@D)/*))
647- $(CP) -R $(IMPORT_MODULES_CLASSES)/$(MODULE )/* $(@D)/
652+ $(CP) -R $(IMPORT_MODULE_DIR )/* $(@D)/
648653 $(TOUCH) $@
649654
650655 TARGETS += $(JDK_OUTPUTDIR)/modules/$(MODULE)/_imported.marker
0 commit comments