< prev index next >

make/CreateJmods.gmk

Print this page




  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #
  25 
  26 default: all
  27 
  28 include $(SPEC)
  29 include MakeBase.gmk
  30 include Modules.gmk
  31 
  32 ifeq ($(MODULE), )
  33   $(error MODULE must be set when calling CreateJmods.gmk)
  34 endif
  35 
  36 ################################################################################
  37 
  38 JMODS_DIR := $(IMAGES_OUTPUTDIR)/jmods
  39 
  40 LIBS_DIR := $(firstword $(wildcard $(addsuffix /$(MODULE), \
  41     $(SUPPORT_OUTPUTDIR)/modules_libs-stripped $(IMPORT_MODULES_LIBS))))
  42 CMDS_DIR := $(firstword $(wildcard $(addsuffix /$(MODULE), \
  43     $(SUPPORT_OUTPUTDIR)/modules_cmds-stripped $(IMPORT_MODULES_CMDS))))
  44 CONF_DIR := $(firstword $(wildcard $(addsuffix /$(MODULE), \
  45     $(SUPPORT_OUTPUTDIR)/modules_conf $(IMPORT_MODULES_CONF))))
  46 CLASSES_DIR := $(wildcard $(JDK_OUTPUTDIR)/modules/$(MODULE))
  47 
  48 $(eval $(call FillCacheFind, \
  49     $(LIBS_DIR) $(CMDS_DIR) $(CONF_DIR) $(CLASSES_DIR) \
  50 ))
  51 
  52 ifneq ($(LIBS_DIR), )
  53   JMOD_FLAGS += --libs $(LIBS_DIR)
  54   DEPS += $(call CacheFind, $(LIBS_DIR))
  55 endif
  56 ifneq ($(CMDS_DIR), )
  57   JMOD_FLAGS += --cmds $(CMDS_DIR)
  58   DEPS += $(call CacheFind, $(CMDS_DIR))
  59 endif
  60 ifneq ($(CONF_DIR), )
  61   JMOD_FLAGS += --config $(CONF_DIR)
  62   DEPS += $(call CacheFind, $(CONF_DIR))
  63 endif


  86 # The variable JMOD_CMD could contain an environment variable assignment before
  87 # the actual command. Filter that out using wildcard before adding to DEPS.
  88 DEPS += $(wildcard $(JMOD_CMD))
  89 ifeq ($(EXTERNAL_BUILDJDK), false)
  90   DEPS += $(call CacheFind, $(JDK_OUTPUTDIR)/modules/jdk.jlink/jdk/tools/jmod)
  91 endif
  92 
  93 # TODO: What about headers?
  94 # Create jmods in a temp dir and then move them into place to keep the
  95 # module path in $(IMAGES_OUTPUTDIR)/jmods valid at all times.
  96 $(JMODS_DIR)/$(MODULE).jmod: $(DEPS)
  97         $(call LogWarn, Creating $(patsubst $(OUTPUT_ROOT)/%, %, $@))
  98         $(call MakeDir, $(@D) $(SUPPORT_OUTPUTDIR)/jmods)
  99         $(RM) $@ $(SUPPORT_OUTPUTDIR)/jmods/$(notdir $@)
 100         $(JMOD) create \
 101             --module-version $(VERSION_SHORT) \
 102             --os-name $(REQUIRED_OS_NAME) \
 103             --os-arch $(OPENJDK_TARGET_CPU_LEGACY) \
 104             --os-version $(REQUIRED_OS_VERSION) \
 105             --module-path $(JMODS_DIR) \
 106             --exclude '**{_the.*,*.diz,*.debuginfo,*.dSYM/**,*.pdb,*.map}' \
 107             $(JMOD_FLAGS) $(SUPPORT_OUTPUTDIR)/jmods/$(notdir $@)
 108         $(MV) $(SUPPORT_OUTPUTDIR)/jmods/$(notdir $@) $@
 109 
 110 TARGETS += $(IMAGES_OUTPUTDIR)/jmods/$(MODULE).jmod
 111 
 112 ################################################################################
 113 
 114 all: $(TARGETS)
 115 
 116 ################################################################################


  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #
  25 
  26 default: all
  27 
  28 include $(SPEC)
  29 include MakeBase.gmk
  30 include Modules.gmk
  31 
  32 ifeq ($(MODULE), )
  33   $(error MODULE must be set when calling CreateJmods.gmk)
  34 endif
  35 
  36 ################################################################################
  37 
  38 JMODS_DIR := $(IMAGES_OUTPUTDIR)/jmods
  39 
  40 LIBS_DIR := $(firstword $(wildcard $(addsuffix /$(MODULE), \
  41     $(SUPPORT_OUTPUTDIR)/modules_libs $(IMPORT_MODULES_LIBS))))
  42 CMDS_DIR := $(firstword $(wildcard $(addsuffix /$(MODULE), \
  43     $(SUPPORT_OUTPUTDIR)/modules_cmds $(IMPORT_MODULES_CMDS))))
  44 CONF_DIR := $(firstword $(wildcard $(addsuffix /$(MODULE), \
  45     $(SUPPORT_OUTPUTDIR)/modules_conf $(IMPORT_MODULES_CONF))))
  46 CLASSES_DIR := $(wildcard $(JDK_OUTPUTDIR)/modules/$(MODULE))
  47 
  48 $(eval $(call FillCacheFind, \
  49     $(LIBS_DIR) $(CMDS_DIR) $(CONF_DIR) $(CLASSES_DIR) \
  50 ))
  51 
  52 ifneq ($(LIBS_DIR), )
  53   JMOD_FLAGS += --libs $(LIBS_DIR)
  54   DEPS += $(call CacheFind, $(LIBS_DIR))
  55 endif
  56 ifneq ($(CMDS_DIR), )
  57   JMOD_FLAGS += --cmds $(CMDS_DIR)
  58   DEPS += $(call CacheFind, $(CMDS_DIR))
  59 endif
  60 ifneq ($(CONF_DIR), )
  61   JMOD_FLAGS += --config $(CONF_DIR)
  62   DEPS += $(call CacheFind, $(CONF_DIR))
  63 endif


  86 # The variable JMOD_CMD could contain an environment variable assignment before
  87 # the actual command. Filter that out using wildcard before adding to DEPS.
  88 DEPS += $(wildcard $(JMOD_CMD))
  89 ifeq ($(EXTERNAL_BUILDJDK), false)
  90   DEPS += $(call CacheFind, $(JDK_OUTPUTDIR)/modules/jdk.jlink/jdk/tools/jmod)
  91 endif
  92 
  93 # TODO: What about headers?
  94 # Create jmods in a temp dir and then move them into place to keep the
  95 # module path in $(IMAGES_OUTPUTDIR)/jmods valid at all times.
  96 $(JMODS_DIR)/$(MODULE).jmod: $(DEPS)
  97         $(call LogWarn, Creating $(patsubst $(OUTPUT_ROOT)/%, %, $@))
  98         $(call MakeDir, $(@D) $(SUPPORT_OUTPUTDIR)/jmods)
  99         $(RM) $@ $(SUPPORT_OUTPUTDIR)/jmods/$(notdir $@)
 100         $(JMOD) create \
 101             --module-version $(VERSION_SHORT) \
 102             --os-name $(REQUIRED_OS_NAME) \
 103             --os-arch $(OPENJDK_TARGET_CPU_LEGACY) \
 104             --os-version $(REQUIRED_OS_VERSION) \
 105             --module-path $(JMODS_DIR) \
 106             --exclude '**{_the.*,*.diz,*.debuginfo,*.dSYM/**,*.dSYM,*.pdb,*.map}' \
 107             $(JMOD_FLAGS) $(SUPPORT_OUTPUTDIR)/jmods/$(notdir $@)
 108         $(MV) $(SUPPORT_OUTPUTDIR)/jmods/$(notdir $@) $@
 109 
 110 TARGETS += $(IMAGES_OUTPUTDIR)/jmods/$(MODULE).jmod
 111 
 112 ################################################################################
 113 
 114 all: $(TARGETS)
 115 
 116 ################################################################################
< prev index next >