annotate make/CreateJmods.gmk @ 48431:e8e8c9e6ccf8

8194901: remove interim code from javax.tools.ToolProvider Reviewed-by: mchung
author jjg
date Wed, 10 Jan 2018 15:05:33 -0800
parents 45af799ceb6a
children
rev   line source
erikj@48069 1 # Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
alanb@36506 2 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
alanb@36506 3 #
alanb@36506 4 # This code is free software; you can redistribute it and/or modify it
alanb@36506 5 # under the terms of the GNU General Public License version 2 only, as
alanb@36506 6 # published by the Free Software Foundation. Oracle designates this
alanb@36506 7 # particular file as subject to the "Classpath" exception as provided
alanb@36506 8 # by Oracle in the LICENSE file that accompanied this code.
alanb@36506 9 #
alanb@36506 10 # This code is distributed in the hope that it will be useful, but WITHOUT
alanb@36506 11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
alanb@36506 12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
alanb@36506 13 # version 2 for more details (a copy is included in the LICENSE file that
alanb@36506 14 # accompanied this code).
alanb@36506 15 #
alanb@36506 16 # You should have received a copy of the GNU General Public License version
alanb@36506 17 # 2 along with this work; if not, write to the Free Software Foundation,
alanb@36506 18 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
alanb@36506 19 #
alanb@36506 20 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
alanb@36506 21 # or visit www.oracle.com if you need additional information or have any
alanb@36506 22 # questions.
alanb@36506 23 #
alanb@36506 24
alanb@36506 25 default: all
alanb@36506 26
alanb@36506 27 include $(SPEC)
alanb@36506 28 include MakeBase.gmk
alanb@36506 29 include Modules.gmk
alanb@36506 30
alanb@36506 31 ifeq ($(MODULE), )
alanb@36506 32 $(error MODULE must be set when calling CreateJmods.gmk)
alanb@36506 33 endif
alanb@36506 34
erikj@48069 35 $(eval $(call IncludeCustomExtension, CreateJmods.gmk))
erikj@48069 36
alanb@36506 37 ################################################################################
alanb@36506 38
redestad@37770 39 JMODS_DIR := $(IMAGES_OUTPUTDIR)/jmods
erikj@41874 40 JMODS_TEMPDIR := $(SUPPORT_OUTPUTDIR)/jmods
redestad@37770 41
alanb@36506 42 LIBS_DIR := $(firstword $(wildcard $(addsuffix /$(MODULE), \
erikj@41260 43 $(SUPPORT_OUTPUTDIR)/modules_libs $(IMPORT_MODULES_LIBS))))
alanb@36506 44 CMDS_DIR := $(firstword $(wildcard $(addsuffix /$(MODULE), \
erikj@41260 45 $(SUPPORT_OUTPUTDIR)/modules_cmds $(IMPORT_MODULES_CMDS))))
alanb@36506 46 CONF_DIR := $(firstword $(wildcard $(addsuffix /$(MODULE), \
alanb@36506 47 $(SUPPORT_OUTPUTDIR)/modules_conf $(IMPORT_MODULES_CONF))))
alanb@36506 48 CLASSES_DIR := $(wildcard $(JDK_OUTPUTDIR)/modules/$(MODULE))
mchung@41532 49 INCLUDE_HEADERS_DIR := $(firstword $(wildcard $(addsuffix /$(MODULE), \
mchung@41532 50 $(SUPPORT_OUTPUTDIR)/modules_include $(IMPORT_MODULES_INCLUDE_HEADERS))))
mchung@41532 51 MAN_DIR := $(firstword $(wildcard $(addsuffix /$(MODULE), \
mchung@41532 52 $(SUPPORT_OUTPUTDIR)/modules_man $(IMPORT_MODULES_MAN))))
alanb@36506 53
alanb@36506 54 $(eval $(call FillCacheFind, \
alanb@36506 55 $(LIBS_DIR) $(CMDS_DIR) $(CONF_DIR) $(CLASSES_DIR) \
alanb@36506 56 ))
alanb@36506 57
alanb@36506 58 ifneq ($(LIBS_DIR), )
alanb@36506 59 JMOD_FLAGS += --libs $(LIBS_DIR)
alanb@36506 60 DEPS += $(call CacheFind, $(LIBS_DIR))
alanb@36506 61 endif
alanb@36506 62 ifneq ($(CMDS_DIR), )
alanb@36506 63 JMOD_FLAGS += --cmds $(CMDS_DIR)
alanb@36506 64 DEPS += $(call CacheFind, $(CMDS_DIR))
alanb@36506 65 endif
alanb@36506 66 ifneq ($(CONF_DIR), )
alanb@36506 67 JMOD_FLAGS += --config $(CONF_DIR)
alanb@36506 68 DEPS += $(call CacheFind, $(CONF_DIR))
alanb@36506 69 endif
alanb@36506 70 ifneq ($(CLASSES_DIR), )
alanb@36506 71 JMOD_FLAGS += --class-path $(CLASSES_DIR)
alanb@36506 72 DEPS += $(call CacheFind, $(CLASSES_DIR))
alanb@36506 73 endif
mchung@41532 74 ifneq ($(INCLUDE_HEADERS_DIR), )
mchung@41532 75 JMOD_FLAGS += --header-files $(INCLUDE_HEADERS_DIR)
mchung@41532 76 DEPS += $(call CacheFind, $(INCLUDE_HEADERS_DIR))
mchung@41532 77 endif
mchung@41532 78 ifneq ($(MAN_DIR), )
mchung@41532 79 JMOD_FLAGS += --man-pages $(MAN_DIR)
mchung@41532 80 DEPS += $(call CacheFind, $(MAN_DIR))
mchung@41532 81 endif
alanb@36506 82
mchung@42505 83 LEGAL_NOTICES := \
erikj@47735 84 $(call uniq, $(SUPPORT_OUTPUTDIR)/modules_legal/java.base \
erikj@47735 85 $(call FindModuleLegalDirs, $(MODULE))) \
mchung@42505 86 #
mchung@42505 87
mchung@42505 88 LEGAL_NOTICES_PATH := $(call PathList, $(LEGAL_NOTICES))
mchung@42505 89 DEPS += $(call CacheFind, $(LEGAL_NOTICES))
mchung@42505 90
mchung@42505 91 JMOD_FLAGS += --legal-notices $(LEGAL_NOTICES_PATH)
mchung@42505 92
alanb@42517 93 ifeq ($(filter-out jdk.incubator.%, $(MODULE)), )
alanb@42517 94 JMOD_FLAGS += --do-not-resolve-by-default
alanb@42517 95 JMOD_FLAGS += --warn-if-resolved=incubating
alanb@42517 96 endif
alanb@42517 97
alanb@37764 98 # Add dependencies on other jmod files. Only java.base needs access to other
alanb@37764 99 # jmods.
alanb@37764 100 ifeq ($(MODULE), java.base)
redestad@37770 101 # When creating a BUILDJDK, we don't need to add hashes to java.base
redestad@37770 102 ifneq ($(CREATING_BUILDJDK), true)
erikj@41874 103 # When creating interim versions of jmods, skip hashes
erikj@41874 104 ifneq ($(INTERIM_JMOD), true)
erikj@41874 105 ALL_UPGRADEABLE_MODULES := $(call FindAllUpgradeableModules)
erikj@41874 106 DEPS += $(patsubst %, $(JMODS_DIR)/%.jmod, \
erikj@41874 107 $(filter-out java.base $(ALL_UPGRADEABLE_MODULES), $(call FindAllModules)))
alanb@37764 108
mchung@45612 109 EXCLUDE_PATTERN := $(strip $(subst $(SPACE),$$|,$(strip $(ALL_UPGRADEABLE_MODULES))))
alanb@37764 110
erikj@41874 111 JMOD_FLAGS += --module-path $(JMODS_DIR) \
mchung@45612 112 --hash-modules '^(?!$(EXCLUDE_PATTERN)$$)'
erikj@41874 113 endif
redestad@37770 114 endif
alanb@37764 115 endif
alanb@36506 116
erikj@39929 117 # Changes to the jmod tool itself should also trigger a rebuild of all jmods.
erikj@39929 118 # The variable JMOD_CMD could contain an environment variable assignment before
erikj@39929 119 # the actual command. Filter that out using wildcard before adding to DEPS.
erikj@39929 120 DEPS += $(wildcard $(JMOD_CMD))
erikj@38848 121 ifeq ($(EXTERNAL_BUILDJDK), false)
erikj@38848 122 DEPS += $(call CacheFind, $(JDK_OUTPUTDIR)/modules/jdk.jlink/jdk/tools/jmod)
erikj@38848 123 endif
erikj@38848 124
erikj@41874 125 # If creating interim versions of jmods, certain files need to be filtered out
erikj@41874 126 # to avoid false incremental rebuilds.
erikj@41874 127 ifeq ($(INTERIM_JMOD), true)
erikj@41874 128 DEPS := $(filter-out $(SUPPORT_OUTPUTDIR)/modules_libs/java.base/classlist, $(DEPS))
erikj@41874 129 endif
erikj@41874 130
alanb@36506 131 # Create jmods in a temp dir and then move them into place to keep the
alanb@36506 132 # module path in $(IMAGES_OUTPUTDIR)/jmods valid at all times.
redestad@37770 133 $(JMODS_DIR)/$(MODULE).jmod: $(DEPS)
ihse@47253 134 $(call LogWarn, Creating $(patsubst $(OUTPUTDIR)/%, %, $@))
erikj@41874 135 $(call MakeDir, $(JMODS_DIR) $(JMODS_TEMPDIR))
erikj@41874 136 $(RM) $@ $(JMODS_TEMPDIR)/$(notdir $@)
alanb@36506 137 $(JMOD) create \
alanb@36506 138 --module-version $(VERSION_SHORT) \
alanb@44985 139 --target-platform '$(OPENJDK_MODULE_TARGET_PLATFORM)' \
mchung@40241 140 --module-path $(JMODS_DIR) \
erikj@44073 141 --exclude '**{_the.*,_*.marker,*.diz,*.debuginfo,*.dSYM/**,*.dSYM,*.pdb,*.map}' \
erikj@41874 142 $(JMOD_FLAGS) $(JMODS_TEMPDIR)/$(notdir $@)
erikj@41874 143 $(MV) $(JMODS_TEMPDIR)/$(notdir $@) $@
alanb@36506 144
erikj@41874 145 TARGETS += $(JMODS_DIR)/$(MODULE).jmod
alanb@36506 146
alanb@36506 147 ################################################################################
alanb@36506 148
alanb@36506 149 all: $(TARGETS)
alanb@36506 150
alanb@36506 151 ################################################################################