make/CopyIntoClasses.gmk

Print this page




  94 # source root (.../classes/META-INF) are automatically copied verbatim by the
  95 # SetupJavaCompilation macro.
  96 #
  97 # Any other META-INF/services configuration file is found here and platform specific comments
  98 # are uncommented and the configuration file is stored in the output META-INF directory.
  99 
 100 # Make sure the output directory is created.
 101 $(eval $(call MakeDir, $(JDK_OUTPUTDIR)/classes/META-INF/services))
 102 # Find all META-INF/services/* files
 103 ALL_META-INF_DIRS_share := $(shell $(FIND) $(JDK_TOPDIR)/src/share/classes -type d -a -name META-INF)
 104 ALL_META-INF_DIRS_targetapi := $(shell $(FIND) $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes -type d -a -name META-INF)
 105 # Platform specific overrides shared
 106 ifneq ($(ALL_META-INF_DIRS_targetapi), )
 107   ALL_META-INF_DIRS := $(ALL_META-INF_DIRS_targetapi) \
 108       $(filter-out %$(patsubst $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes%,%,$(ALL_META-INF_DIRS_targetapi)), \
 109       $(ALL_META-INF_DIRS_share))
 110 else
 111   ALL_META-INF_DIRS := $(ALL_META-INF_DIRS_share)
 112 endif
 113 
 114 ifndef OPENJDK
 115   ALL_META-INF_DIRS += $(JDK_TOPDIR)/src/closed/share/classes/sun/java2d/cmm/kcms/META-INF
 116 endif
 117 
 118 SRC_SERVICES_FILES := $(wildcard $(addsuffix /services/*, $(ALL_META-INF_DIRS)))
 119 
 120 ifdef OPENJDK
 121   SRC_SERVICES_FILES := $(filter-out %sun/java2d/cmm/kcms/META-INF/services/sun.java2d.cmm.CMMServiceProvider, $(SRC_SERVICES_FILES))
 122 else
 123   SRC_SERVICES_FILES := $(filter-out %sun/java2d/cmm/lcms/META-INF/services/sun.java2d.cmm.CMMServiceProvider, $(SRC_SERVICES_FILES))
 124 endif
 125 
 126 # The number of services files are relatively few. If the increase in numbers, then
 127 # we have to use ListPathsSafelyNow here.
 128 # Change $(JDK_TOPDIR)/src/.../META-INF/services/yyyy into $(JDK_OUTPUTDIR)/classes/META-INF/services/yyyy
 129 # The \n in the printf command is needed to make sed work on Solaris.
 130 OUT_SERVICES_FILES := $(addprefix $(JDK_OUTPUTDIR)/classes/META-INF/services/, \
 131     $(shell $(PRINTF) "$(SRC_SERVICES_FILES)\n" | $(SED) -e 's|/[^ ]*/META-INF/services/||g'))
 132 OUT_SERVICES_FILES_COLON := $(addsuffix :, $(OUT_SERVICES_FILES))
 133 # Exception handling for print services with no META-INF directory
 134 SRC_SERVICES_FILES_PRINT = $(wildcard $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes/sun/print/services/*)
 135 OUT_SERVICES_FILES_PRINT = $(addprefix $(JDK_OUTPUTDIR)/classes/META-INF/services/, \
 136     $(patsubst $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes/sun/print/services/%, %, \
 137     $(SRC_SERVICES_FILES_PRINT)))
 138 OUT_SERVICES_FILES_PRINT_COLON = $(addsuffix :, $(OUT_SERVICES_FILES_PRINT))
 139 RULES_SERVICES_PRINT = $(join $(OUT_SERVICES_FILES_PRINT_COLON), $(SRC_SERVICES_FILES_PRINT))
 140 
 141 # Now setup the dependency rules to generate a META-INF/services/... from the correct source.
 142 META-INF_RULES_SERVICES := $(RULES_SERVICES_PRINT) $(join $(OUT_SERVICES_FILES_COLON), $(SRC_SERVICES_FILES))
 143 # Eval the newly created rules to incorporate them into the make tree.
 144 define addto_meta-inf_services




  94 # source root (.../classes/META-INF) are automatically copied verbatim by the
  95 # SetupJavaCompilation macro.
  96 #
  97 # Any other META-INF/services configuration file is found here and platform specific comments
  98 # are uncommented and the configuration file is stored in the output META-INF directory.
  99 
 100 # Make sure the output directory is created.
 101 $(eval $(call MakeDir, $(JDK_OUTPUTDIR)/classes/META-INF/services))
 102 # Find all META-INF/services/* files
 103 ALL_META-INF_DIRS_share := $(shell $(FIND) $(JDK_TOPDIR)/src/share/classes -type d -a -name META-INF)
 104 ALL_META-INF_DIRS_targetapi := $(shell $(FIND) $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes -type d -a -name META-INF)
 105 # Platform specific overrides shared
 106 ifneq ($(ALL_META-INF_DIRS_targetapi), )
 107   ALL_META-INF_DIRS := $(ALL_META-INF_DIRS_targetapi) \
 108       $(filter-out %$(patsubst $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes%,%,$(ALL_META-INF_DIRS_targetapi)), \
 109       $(ALL_META-INF_DIRS_share))
 110 else
 111   ALL_META-INF_DIRS := $(ALL_META-INF_DIRS_share)
 112 endif
 113 




 114 SRC_SERVICES_FILES := $(wildcard $(addsuffix /services/*, $(ALL_META-INF_DIRS)))






 115 
 116 # The number of services files are relatively few. If the increase in numbers, then
 117 # we have to use ListPathsSafelyNow here.
 118 # Change $(JDK_TOPDIR)/src/.../META-INF/services/yyyy into $(JDK_OUTPUTDIR)/classes/META-INF/services/yyyy
 119 # The \n in the printf command is needed to make sed work on Solaris.
 120 OUT_SERVICES_FILES := $(addprefix $(JDK_OUTPUTDIR)/classes/META-INF/services/, \
 121     $(shell $(PRINTF) "$(SRC_SERVICES_FILES)\n" | $(SED) -e 's|/[^ ]*/META-INF/services/||g'))
 122 OUT_SERVICES_FILES_COLON := $(addsuffix :, $(OUT_SERVICES_FILES))
 123 # Exception handling for print services with no META-INF directory
 124 SRC_SERVICES_FILES_PRINT = $(wildcard $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes/sun/print/services/*)
 125 OUT_SERVICES_FILES_PRINT = $(addprefix $(JDK_OUTPUTDIR)/classes/META-INF/services/, \
 126     $(patsubst $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/classes/sun/print/services/%, %, \
 127     $(SRC_SERVICES_FILES_PRINT)))
 128 OUT_SERVICES_FILES_PRINT_COLON = $(addsuffix :, $(OUT_SERVICES_FILES_PRINT))
 129 RULES_SERVICES_PRINT = $(join $(OUT_SERVICES_FILES_PRINT_COLON), $(SRC_SERVICES_FILES_PRINT))
 130 
 131 # Now setup the dependency rules to generate a META-INF/services/... from the correct source.
 132 META-INF_RULES_SERVICES := $(RULES_SERVICES_PRINT) $(join $(OUT_SERVICES_FILES_COLON), $(SRC_SERVICES_FILES))
 133 # Eval the newly created rules to incorporate them into the make tree.
 134 define addto_meta-inf_services